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';
2424import CircleTerminal from '../images/circle-terminal.svg' ;
2525import CircleFolder from '../images/circle-folder.svg' ;
2626import CircleInfo from '../images/circle-info.svg' ;
27+ import Cross from '../images/cross.svg' ;
2728
2829// HOC that adds the right web accessibility props
2930// https://www.scottohara.me/blog/2019/05/22/contextual-images-svgs-and-a11y.html
@@ -94,9 +95,8 @@ export const MoreIcon = withLabel(More);
9495export const TerminalIcon = withLabel ( Terminal ) ;
9596export const CodeIcon = withLabel ( Code ) ;
9697export const SaveIcon = withLabel ( Save ) ;
97-
9898export const FolderIcon = withLabel ( Folder ) ;
99-
99+ export const crossIcon = withLabel ( Cross ) ;
100100export const CircleTerminalIcon = withLabel ( CircleTerminal ) ;
101101export const CircleFolderIcon = withLabel ( CircleFolder ) ;
102102export const CircleInfoIcon = withLabel ( CircleInfo ) ;
Original file line number Diff line number Diff line change @@ -13,7 +13,14 @@ import NavMenuItem from '../../../../components/Nav/NavMenuItem';
1313import { prop , remSize } from '../../../../theme' ;
1414import AsteriskIcon from '../../../../images/p5-asterisk.svg' ;
1515import 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' ;
1724import {
1825 newFile ,
1926 newFolder ,
@@ -237,26 +244,40 @@ const MobileNav = () => {
237244 < h5 > by { project ?. owner ?. username } </ h5 >
238245 ) }
239246 </ 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 >
253252 < div >
254253 < Link to = { editorLink } >
255- < IconButton icon = { EditorIcon } />
254+ < IconButton icon = { crossIcon } />
256255 </ Link >
257256 </ 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+ ) }
260281 </ Nav >
261282 ) ;
262283} ;
You can’t perform that action at this time.
0 commit comments