3
3
withStyles ,
4
4
createStyles ,
5
5
makeStyles ,
6
- Theme
6
+ Theme ,
7
7
} from '@material-ui/core/styles' ;
8
8
import AppBar from '@material-ui/core/AppBar' ;
9
9
import Avatar from '@material-ui/core/Avatar' ;
@@ -13,15 +13,16 @@ import Typography from '@material-ui/core/Typography';
13
13
import Button from '@material-ui/core/Button' ;
14
14
import IconButton from '@material-ui/core/IconButton' ;
15
15
import MenuIcon from '@material-ui/icons/Menu' ;
16
- import { styleContext } from '../../containers/AppContainer' ;
17
16
import Menu from '@material-ui/core/Menu' ;
18
17
import MenuItem from '@material-ui/core/MenuItem' ;
19
18
import List from '@material-ui/core/List' ;
20
19
import ListItem from '@material-ui/core/ListItem' ;
21
20
import ListItemText from '@material-ui/core/ListItemText' ;
22
21
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' ;
25
26
import SaveProjectButton from '../right/SaveProjectButton' ;
26
27
import DeleteProjects from '../right/DeleteProjects' ;
27
28
import ProjectsFolder from '../right/OpenProjects' ;
@@ -30,51 +31,44 @@ import StateContext from '../../context/context';
30
31
import logo from '../../public/icons/win/logo.png' ;
31
32
32
33
33
- // ROUTING TO DASHBOARD
34
- import { Link } from "react-router-dom" ;
34
+ // ROUTING TO DASHBOARD
35
35
36
- < < << << < HEAD
37
-
38
- = === ===
39
- >>> >>> > master
40
36
// 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
+ } ) ) ;
61
55
62
56
// Drop down menu button for export
63
57
const StyledMenu = withStyles ( {
64
58
paper : {
65
- border : '1px solid #d3d4d5'
66
- }
59
+ border : '1px solid #d3d4d5' ,
60
+ } ,
67
61
} ) ( props => (
68
62
< Menu
69
63
elevation = { 0 }
70
64
getContentAnchorEl = { null }
71
65
anchorOrigin = { {
72
66
vertical : 'bottom' ,
73
- horizontal : 'center'
67
+ horizontal : 'center' ,
74
68
} }
75
69
transformOrigin = { {
76
70
vertical : 'top' ,
77
- horizontal : 'center'
71
+ horizontal : 'center' ,
78
72
} }
79
73
{ ...props }
80
74
/>
@@ -84,10 +78,10 @@ const StyledMenuItem = withStyles(theme => ({
84
78
root : {
85
79
'&:focus' : {
86
80
'& .MuiListItemIcon-root, & .MuiListItemText-primary' : {
87
- color : theme . palette . common . white
88
- }
89
- }
90
- }
81
+ color : theme . palette . common . white ,
82
+ } ,
83
+ } ,
84
+ } ,
91
85
} ) ) ( MenuItem ) ;
92
86
93
87
export default function NavBar ( props ) {
@@ -101,7 +95,7 @@ export default function NavBar(props) {
101
95
const [ modal , setModal ] = useState ( null ) ;
102
96
const [ state , dispatch ] = useContext ( StateContext ) ;
103
97
104
- const handleClick = event => {
98
+ const handleClick = ( event ) => {
105
99
setAnchorEl ( event . currentTarget ) ;
106
100
} ;
107
101
@@ -131,7 +125,7 @@ export default function NavBar(props) {
131
125
style = { {
132
126
border : '1px solid #3f51b5' ,
133
127
marginBottom : '2%' ,
134
- marginTop : '5%'
128
+ marginTop : '5%' ,
135
129
} }
136
130
>
137
131
< ListItemText
@@ -153,8 +147,8 @@ export default function NavBar(props) {
153
147
primBtnAction : null ,
154
148
secBtnAction : null ,
155
149
secBtnLabel : null ,
156
- open : true
157
- } )
150
+ open : true ,
151
+ } ) ,
158
152
) ;
159
153
} ;
160
154
@@ -164,16 +158,16 @@ export default function NavBar(props) {
164
158
< AppBar position = "static" >
165
159
< Toolbar >
166
160
< Avatar src = { logo } > </ Avatar >
167
- < Typography variant = "h6" style = { { marginLeft : '1rem' } } className = { classes . title } >
161
+ < Typography variant = "h6" style = { { marginLeft : '1rem' } } className = { classes . title } >
168
162
ReacType
169
163
</ Typography >
170
164
171
165
{ /* ==================================Dashboard Button================================================== */ }
172
- { state . isLoggedIn ? < Link to = '/dashboard' style = { { textDecoration : 'none' } } >
166
+ { state . isLoggedIn ? < Link to = '/dashboard' style = { { textDecoration : 'none' } } >
173
167
< Button
174
168
variant = "contained"
175
169
color = "primary"
176
- style = { { minWidth : '137.69px' } }
170
+ style = { { minWidth : '137.69px' } }
177
171
className = "navbarButton"
178
172
>
179
173
Dashboard
@@ -184,26 +178,26 @@ export default function NavBar(props) {
184
178
< Button
185
179
variant = "contained"
186
180
color = "primary"
187
- style = { { minWidth : '137.69px' } }
188
- onClick = { clearWorkspace }
189
- className = "navbarButton"
181
+ style = { { minWidth : '137.69px' } }
182
+ onClick = { clearWorkspace }
183
+ className = "navbarButton"
190
184
id = "navbarButton"
191
185
>
192
186
Clear Canvas
193
187
</ Button >
194
188
{ /* ==================================ExportButton================================================== */ }
195
189
< ExportButton />
196
-
197
-
190
+
191
+
198
192
< Button
199
193
className = "navbarButton"
200
194
id = "navbarButton"
201
195
color = "primary"
202
196
variant = "contained"
203
- style = { { minWidth : '113.97px' } }
197
+ style = { { minWidth : '113.97px' } }
204
198
onClick = { ( ) => {
205
199
! style . backgroundColor
206
- ? setStyle ( { backgroundColor : '#21262D' } ) //dark mode color
200
+ ? setStyle ( { backgroundColor : '#21262D' } ) // dark mode color
207
201
: setStyle ( { } ) ;
208
202
props . isThemeLight ? props . setTheme ( false ) : props . setTheme ( true ) ;
209
203
} }
@@ -212,9 +206,9 @@ export default function NavBar(props) {
212
206
</ Button >
213
207
214
208
{ /* ================================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
218
212
variant = "contained"
219
213
color = "primary"
220
214
onClick = { handleClick }
@@ -231,8 +225,8 @@ export default function NavBar(props) {
231
225
/>
232
226
233
227
{ /* ================================MANAGE PROJECT DROPDOWN====================================== */ }
234
-
235
- < StyledMenu // Dropdown menu connected to Manage Project Button
228
+
229
+ < StyledMenu // Dropdown menu connected to Manage Project Button
236
230
id = "customized-menu"
237
231
anchorEl = { anchorEl }
238
232
keepMounted
0 commit comments