Skip to content

Commit

Permalink
feature(requests-table):Implement requests table [Finishes #171380698]
Browse files Browse the repository at this point in the history
  • Loading branch information
the22mastermind committed Jun 3, 2020
1 parent bcf9180 commit a4ea2ab
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 3 deletions.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,14 @@
"dependencies": {
"@babel/core": "^7.9.6",
"@babel/preset-react": "^7.9.4",
"@material-ui/core": "^4.10.1",
"@material-ui/icons": "^4.9.1",
"@storybook/addon-actions": "^5.3.18",
"@storybook/addon-links": "^5.3.18",
"@storybook/addons": "^5.3.18",
"@storybook/react": "^5.3.18",
"@testing-library/react": "^10.0.6",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.0.1",
"babel-loader": "^8.1.0",
"babel-plugin-transform-class-properties": "^6.24.1",
Expand Down
1 change: 1 addition & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
<title>Barefoot nomad</title>
</head>
<body>
Expand Down
13 changes: 13 additions & 0 deletions src/__tests__/SectionHeader.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* eslint-disable no-undef */
import React from 'react';
import renderer from 'react-test-renderer';
import { cleanup } from '@testing-library/react';
import SectionHeader from '../components/SectionHeader/SectionHeader';

describe('<SectionHeader/>', () => {
afterEach(cleanup);
it('Should match the SectionHeader component snapshot', () => {
const tree = renderer.create(<SectionHeader />).toJSON();
expect(tree).toMatchSnapshot();
});
});
9 changes: 9 additions & 0 deletions src/__tests__/__snapshots__/SectionHeader.test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`<SectionHeader/> Should match the SectionHeader component snapshot 1`] = `
<p
className="MuiTypography-root makeStyles-title-1 MuiTypography-body1"
>
Trip requests
</p>
`;
28 changes: 28 additions & 0 deletions src/components/SectionHeader/SectionHeader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Typography from '@material-ui/core/Typography';

const useStyles = makeStyles({
title: {
borderWidth: 1,
borderColor: '#00A799',
color: '#484848',
backgroundColor: '#00a7990f',
padding: 24,
fontSize: 14,
fontFamily: 'Roboto',
fontWeight: 500,
},
});

const SectionHeader = () => {
const classes = useStyles();

return (
<Typography className={classes.title}>
Trip requests
</Typography>
);
};

export default SectionHeader;
4 changes: 3 additions & 1 deletion src/entry/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@ import {
import './app.css';
import HelloComponent from '../components/HelloComponent';
import FrontPage from '../views/frontPage';
import SectionHeader from '../components/SectionHeader/SectionHeader';

const App = () => (
<div>
<Router>
<ul>
<li><Link to="/login">Login</Link></li>
<li><Link to="/dashboard/requests">Login</Link></li>
</ul>
<Switch>
<Route path="/" component={HelloComponent} exact />
<Route path="/login" component={FrontPage} />
<Route path="/dashboard/requests" component={SectionHeader} />
</Switch>
</Router>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/styles/sass/index.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$color: #00A799;
$text: #FFFFFF;
$text: #484848;

body {
background-color: $color;
background-color: #ffffff;
color: $text;
}

0 comments on commit a4ea2ab

Please sign in to comment.