Skip to content

Commit 5277aef

Browse files
committed
Added header with logo.
1 parent 7765c05 commit 5277aef

File tree

5 files changed

+51
-2
lines changed

5 files changed

+51
-2
lines changed

src/App/App.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { Component } from 'react';
22
import axios from 'axios';
3+
import Header from '../components/Header';
34
import CodeEditor from '../components/CodeEditor';
45
import ResultsEditor from '../components/ResultsEditor';
56
import { Grid, Button, FormControl, FormControlLabel, Checkbox, Select, MenuItem } from '@material-ui/core';
@@ -153,6 +154,8 @@ class App extends Component {
153154
render() {
154155
return (
155156
<div className="App">
157+
<Header />
158+
156159
<Grid container style={{ marginBottom: '1.5%' }}>
157160
<Grid item xs={6}>
158161
<CodeEditor

src/components/CodeEditor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class CodeEditor extends Component {
1515
constructor(props) {
1616
super(props)
1717
this.state = {
18-
editorHeight: '90vh',
18+
editorHeight: '85vh',
1919
editorWidth: 'auto'
2020
}
2121
this.onResize = this.onResize.bind(this);

src/components/Header.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import React, { Component } from 'react'
2+
import { makeStyles, AppBar, Toolbar, Typography, Button, IconButton } from '@material-ui/core';
3+
import logo from '../resources/logo.png'
4+
5+
const useStyles = makeStyles(theme => ({
6+
root: {
7+
flexGrow: 1,
8+
paddingBottom: 2.5,
9+
},
10+
logo: {
11+
width: '3.5vh',
12+
height: '3.5vh'
13+
},
14+
bar: {
15+
background: '#0269a4',
16+
borderBottomStyle: 'solid',
17+
borderBottomWidth: '2.5px',
18+
borderColor: '#013F64'
19+
},
20+
menuButton: {
21+
marginRight: theme.spacing(2),
22+
},
23+
title: {
24+
fontFamily: 'Roboto',
25+
flexGrow: 1,
26+
},
27+
}));
28+
29+
export default function Header() {
30+
const classes = useStyles()
31+
32+
return (
33+
<div className={classes.root}>
34+
<AppBar position='static' className={classes.bar}>
35+
<Toolbar>
36+
<IconButton edge='start' className={classes.menuButton} color='inherit' aria-label='menu'>
37+
<img className={classes.logo} src={logo} alt='Logo' />
38+
</IconButton>
39+
<Typography variant='h5' className={classes.title}>
40+
Coderpad
41+
</Typography>
42+
</Toolbar>
43+
</AppBar>
44+
</div>
45+
)
46+
}

src/components/ResultsEditor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class ResultsEditor extends Component {
88
constructor(props) {
99
super(props)
1010
this.state = {
11-
editorHeight: '90vh',
11+
editorHeight: '85vh',
1212
editorWidth: 'auto'
1313
}
1414
this.onResize = this.onResize.bind(this);

src/resources/logo.png

156 KB
Loading

0 commit comments

Comments
 (0)