Skip to content

Commit 225440f

Browse files
committed
resolved merge conflict for NavBar.tsx
1 parent b5fd265 commit 225440f

File tree

1 file changed

+51
-57
lines changed

1 file changed

+51
-57
lines changed

app/src/components/top/NavBar.tsx

Lines changed: 51 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
withStyles,
44
createStyles,
55
makeStyles,
6-
Theme
6+
Theme,
77
} from '@material-ui/core/styles';
88
import AppBar from '@material-ui/core/AppBar';
99
import Avatar from '@material-ui/core/Avatar';
@@ -13,15 +13,16 @@ import Typography from '@material-ui/core/Typography';
1313
import Button from '@material-ui/core/Button';
1414
import IconButton from '@material-ui/core/IconButton';
1515
import MenuIcon from '@material-ui/icons/Menu';
16-
import { styleContext } from '../../containers/AppContainer';
1716
import Menu from '@material-ui/core/Menu';
1817
import MenuItem from '@material-ui/core/MenuItem';
1918
import List from '@material-ui/core/List';
2019
import ListItem from '@material-ui/core/ListItem';
2120
import ListItemText from '@material-ui/core/ListItemText';
2221
import ListItemIcon from '@material-ui/core/ListItemIcon';
23-
import LoginButton from '../right/LoginButton'
24-
import ExportButton from '../right/ExportButton'
22+
import { Link } from 'react-router-dom';
23+
import { styleContext } from '../../containers/AppContainer';
24+
import LoginButton from '../right/LoginButton';
25+
import ExportButton from '../right/ExportButton';
2526
import SaveProjectButton from '../right/SaveProjectButton';
2627
import DeleteProjects from '../right/DeleteProjects';
2728
import ProjectsFolder from '../right/OpenProjects';
@@ -30,51 +31,44 @@ import StateContext from '../../context/context';
3031
import logo from '../../public/icons/win/logo.png';
3132

3233

33-
// ROUTING TO DASHBOARD
34-
import { Link } from "react-router-dom";
34+
// ROUTING TO DASHBOARD
3535

36-
<<<<<<< HEAD
37-
38-
=======
39-
>>>>>>> master
4036
// NavBar text and button styling
41-
const useStyles = makeStyles((theme: Theme) =>
42-
createStyles({
43-
root: {
44-
flexGrow: 1,
45-
width: '100%'
46-
},
47-
menuButton: {
48-
marginRight: theme.spacing(2),
49-
color: 'white'
50-
},
51-
title: {
52-
flexGrow: 1,
53-
color: 'white'
54-
},
55-
manageProject: {
56-
display: 'flex',
57-
justifyContent: 'center'
58-
}
59-
})
60-
);
37+
const useStyles = makeStyles((theme: Theme) => createStyles({
38+
root: {
39+
flexGrow: 1,
40+
width: '100%',
41+
},
42+
menuButton: {
43+
marginRight: theme.spacing(2),
44+
color: 'white',
45+
},
46+
title: {
47+
flexGrow: 1,
48+
color: 'white',
49+
},
50+
manageProject: {
51+
display: 'flex',
52+
justifyContent: 'center',
53+
},
54+
}));
6155

6256
// Drop down menu button for export
6357
const StyledMenu = withStyles({
6458
paper: {
65-
border: '1px solid #d3d4d5'
66-
}
59+
border: '1px solid #d3d4d5',
60+
},
6761
})(props => (
6862
<Menu
6963
elevation={0}
7064
getContentAnchorEl={null}
7165
anchorOrigin={{
7266
vertical: 'bottom',
73-
horizontal: 'center'
67+
horizontal: 'center',
7468
}}
7569
transformOrigin={{
7670
vertical: 'top',
77-
horizontal: 'center'
71+
horizontal: 'center',
7872
}}
7973
{...props}
8074
/>
@@ -84,10 +78,10 @@ const StyledMenuItem = withStyles(theme => ({
8478
root: {
8579
'&:focus': {
8680
'& .MuiListItemIcon-root, & .MuiListItemText-primary': {
87-
color: theme.palette.common.white
88-
}
89-
}
90-
}
81+
color: theme.palette.common.white,
82+
},
83+
},
84+
},
9185
}))(MenuItem);
9286

9387
export default function NavBar(props) {
@@ -101,7 +95,7 @@ export default function NavBar(props) {
10195
const [modal, setModal] = useState(null);
10296
const [state, dispatch] = useContext(StateContext);
10397

104-
const handleClick = event => {
98+
const handleClick = (event) => {
10599
setAnchorEl(event.currentTarget);
106100
};
107101

@@ -131,7 +125,7 @@ export default function NavBar(props) {
131125
style={{
132126
border: '1px solid #3f51b5',
133127
marginBottom: '2%',
134-
marginTop: '5%'
128+
marginTop: '5%',
135129
}}
136130
>
137131
<ListItemText
@@ -153,8 +147,8 @@ export default function NavBar(props) {
153147
primBtnAction: null,
154148
secBtnAction: null,
155149
secBtnLabel: null,
156-
open: true
157-
})
150+
open: true,
151+
}),
158152
);
159153
};
160154

@@ -164,16 +158,16 @@ export default function NavBar(props) {
164158
<AppBar position="static">
165159
<Toolbar>
166160
<Avatar src={logo} ></Avatar>
167-
<Typography variant="h6" style={{marginLeft: '1rem'}} className={classes.title}>
161+
<Typography variant="h6" style={{ marginLeft: '1rem' }} className={classes.title}>
168162
ReacType
169163
</Typography>
170164

171165
{/* ==================================Dashboard Button================================================== */}
172-
{state.isLoggedIn ? <Link to='/dashboard' style ={ {textDecoration: 'none'} }>
166+
{state.isLoggedIn ? <Link to='/dashboard' style ={ { textDecoration: 'none' } }>
173167
<Button
174168
variant="contained"
175169
color="primary"
176-
style={{minWidth: '137.69px'}}
170+
style={{ minWidth: '137.69px' }}
177171
className="navbarButton"
178172
>
179173
Dashboard
@@ -184,26 +178,26 @@ export default function NavBar(props) {
184178
<Button
185179
variant="contained"
186180
color="primary"
187-
style={{minWidth: '137.69px'}}
188-
onClick={clearWorkspace}
189-
className="navbarButton"
181+
style={{ minWidth: '137.69px' }}
182+
onClick={clearWorkspace}
183+
className="navbarButton"
190184
id="navbarButton"
191185
>
192186
Clear Canvas
193187
</Button>
194188
{/* ==================================ExportButton================================================== */}
195189
<ExportButton />
196-
197-
190+
191+
198192
<Button
199193
className="navbarButton"
200194
id="navbarButton"
201195
color="primary"
202196
variant="contained"
203-
style={{minWidth: '113.97px'}}
197+
style={{ minWidth: '113.97px' }}
204198
onClick={() => {
205199
!style.backgroundColor
206-
? setStyle({ backgroundColor: '#21262D' }) //dark mode color
200+
? setStyle({ backgroundColor: '#21262D' }) // dark mode color
207201
: setStyle({});
208202
props.isThemeLight ? props.setTheme(false) : props.setTheme(true);
209203
}}
@@ -212,9 +206,9 @@ export default function NavBar(props) {
212206
</Button>
213207

214208
{/* ================================MANAGE PROJECT DROPDOWN====================================== */}
215-
216-
{state.isLoggedIn ? // render Manage Project button/dropdown only if user is logged in
217-
<Button
209+
210+
{state.isLoggedIn // render Manage Project button/dropdown only if user is logged in
211+
? <Button
218212
variant="contained"
219213
color="primary"
220214
onClick={handleClick}
@@ -231,8 +225,8 @@ export default function NavBar(props) {
231225
/>
232226

233227
{/* ================================MANAGE PROJECT DROPDOWN====================================== */}
234-
235-
<StyledMenu // Dropdown menu connected to Manage Project Button
228+
229+
<StyledMenu // Dropdown menu connected to Manage Project Button
236230
id="customized-menu"
237231
anchorEl={anchorEl}
238232
keepMounted

0 commit comments

Comments
 (0)