File tree Expand file tree Collapse file tree 3 files changed +43
-19
lines changed Expand file tree Collapse file tree 3 files changed +43
-19
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import Folder from '../images/folder-padded.svg';
24
24
import CircleTerminal from '../images/circle-terminal.svg' ;
25
25
import CircleFolder from '../images/circle-folder.svg' ;
26
26
import CircleInfo from '../images/circle-info.svg' ;
27
+ import Cross from '../images/cross.svg' ;
27
28
28
29
// HOC that adds the right web accessibility props
29
30
// https://www.scottohara.me/blog/2019/05/22/contextual-images-svgs-and-a11y.html
@@ -94,9 +95,8 @@ export const MoreIcon = withLabel(More);
94
95
export const TerminalIcon = withLabel ( Terminal ) ;
95
96
export const CodeIcon = withLabel ( Code ) ;
96
97
export const SaveIcon = withLabel ( Save ) ;
97
-
98
98
export const FolderIcon = withLabel ( Folder ) ;
99
-
99
+ export const crossIcon = withLabel ( Cross ) ;
100
100
export const CircleTerminalIcon = withLabel ( CircleTerminal ) ;
101
101
export const CircleFolderIcon = withLabel ( CircleFolder ) ;
102
102
export const CircleInfoIcon = withLabel ( CircleInfo ) ;
Original file line number Diff line number Diff line change @@ -13,7 +13,14 @@ import NavMenuItem from '../../../../components/Nav/NavMenuItem';
13
13
import { prop , remSize } from '../../../../theme' ;
14
14
import AsteriskIcon from '../../../../images/p5-asterisk.svg' ;
15
15
import IconButton from '../../../../components/mobile/IconButton' ;
16
- import { AccountIcon , EditorIcon , MoreIcon } from '../../../../common/icons' ;
16
+ import {
17
+ AccountIcon ,
18
+ EditorIcon ,
19
+ MoreIcon ,
20
+ CloseIcon ,
21
+ ExitIcon ,
22
+ crossIcon
23
+ } from '../../../../common/icons' ;
17
24
import {
18
25
newFile ,
19
26
newFolder ,
@@ -237,26 +244,40 @@ const MobileNav = () => {
237
244
< h5 > by { project ?. owner ?. username } </ h5 >
238
245
) }
239
246
</ Title >
240
- < Options >
241
- { user . authenticated ? (
242
- < AccountMenu />
243
- ) : (
244
- < div >
245
- < Link to = "/login" >
246
- < IconButton icon = { AccountIcon } />
247
- </ Link >
248
- </ div >
249
- ) }
250
- { title === project . name ? (
251
- < MoreMenu />
252
- ) : (
247
+
248
+ { /* check if the user is in login page */ }
249
+ { pathname === '/login' || pathname === '/signup' ? (
250
+ // showing the login page
251
+ < Options >
253
252
< div >
254
253
< Link to = { editorLink } >
255
- < IconButton icon = { EditorIcon } />
254
+ < IconButton icon = { crossIcon } />
256
255
</ Link >
257
256
</ div >
258
- ) }
259
- </ Options >
257
+ </ Options >
258
+ ) : (
259
+ < Options >
260
+ { /* checking if user is logged in or not */ }
261
+ { user . authenticated ? (
262
+ < AccountMenu />
263
+ ) : (
264
+ < div >
265
+ < Link to = "/login" >
266
+ < IconButton icon = { AccountIcon } />
267
+ </ Link >
268
+ </ div >
269
+ ) }
270
+ { title === project . name ? (
271
+ < MoreMenu />
272
+ ) : (
273
+ < div >
274
+ < Link to = { editorLink } >
275
+ < IconButton icon = { EditorIcon } />
276
+ </ Link >
277
+ </ div >
278
+ ) }
279
+ </ Options >
280
+ ) }
260
281
</ Nav >
261
282
) ;
262
283
} ;
You can’t perform that action at this time.
0 commit comments