Skip to content

Commit

Permalink
Merge pull request #6 from graasp/3/materialUI
Browse files Browse the repository at this point in the history
feat: add materialUI and materialUI scaffolding
  • Loading branch information
hagoptaminian authored Sep 18, 2020
2 parents fa1a3c1 + ffa52f7 commit 15e44b6
Show file tree
Hide file tree
Showing 11 changed files with 321 additions and 79 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "4.11.0",
"@material-ui/icons": "4.9.1",
"@material-ui/lab": "4.0.0-alpha.56",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>Graasp</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
38 changes: 0 additions & 38 deletions src/App.css

This file was deleted.

28 changes: 0 additions & 28 deletions src/App.js

This file was deleted.

12 changes: 12 additions & 0 deletions src/components/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';
import Header from './layout/Header';

function App() {
return (
<Header>
<div>Hello</div>
</Header>
);
}

export default App;
23 changes: 23 additions & 0 deletions src/components/Root.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from 'react';
import { createMuiTheme, MuiThemeProvider } from '@material-ui/core/styles';
import App from './App';

const theme = createMuiTheme({
palette: {
primary: {
main: '#5050d2',
},
},
});

const Root = () => {
return (
<div>
<MuiThemeProvider theme={theme}>
<App />
</MuiThemeProvider>
</div>
);
};

export default Root;
44 changes: 44 additions & 0 deletions src/components/layout/Header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import { AppBar, Toolbar, Typography, IconButton } from '@material-ui/core';
import { AccountCircle } from '@material-ui/icons';
import { ReactComponent as GraaspLogo } from '../../resources/graasp-logo.svg';

const useStyles = makeStyles((theme) => ({
header: {
display: 'flex',
justifyContent: 'space-between',
},
headerLeft: {
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
},
logo: {
height: '48px',
marginRight: theme.spacing(2),
},
}));

const Header = () => {
const classes = useStyles();
return (
<header>
<AppBar position="static">
<Toolbar className={classes.header}>
<div className={classes.headerLeft}>
<GraaspLogo className={classes.logo} />
<Typography variant="h6" color="inherit">
Graasp
</Typography>
</div>
<IconButton color="inherit">
<AccountCircle />
</IconButton>
</Toolbar>
</AppBar>
</header>
);
};

export default Header;
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import Root from './components/Root';
import * as serviceWorker from './serviceWorker';

ReactDOM.render(
<React.StrictMode>
<App />
<Root />
</React.StrictMode>,
document.getElementById('root')
document.getElementById('root'),
);

// If you want your app to work offline and load faster, you can change
Expand Down
7 changes: 0 additions & 7 deletions src/logo.svg

This file was deleted.

6 changes: 6 additions & 0 deletions src/resources/graasp-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 15e44b6

Please sign in to comment.