diff --git a/client/common/icons.jsx b/client/common/icons.jsx index 571dec3a74..9a6435f7a2 100644 --- a/client/common/icons.jsx +++ b/client/common/icons.jsx @@ -24,6 +24,7 @@ import Folder from '../images/folder-padded.svg'; import CircleTerminal from '../images/circle-terminal.svg'; import CircleFolder from '../images/circle-folder.svg'; import CircleInfo from '../images/circle-info.svg'; +import Cross from '../images/cross.svg'; // HOC that adds the right web accessibility props // https://www.scottohara.me/blog/2019/05/22/contextual-images-svgs-and-a11y.html @@ -94,9 +95,8 @@ export const MoreIcon = withLabel(More); export const TerminalIcon = withLabel(Terminal); export const CodeIcon = withLabel(Code); export const SaveIcon = withLabel(Save); - export const FolderIcon = withLabel(Folder); - +export const CrossIcon = withLabel(Cross); export const CircleTerminalIcon = withLabel(CircleTerminal); export const CircleFolderIcon = withLabel(CircleFolder); export const CircleInfoIcon = withLabel(CircleInfo); diff --git a/client/images/cross.svg b/client/images/cross.svg new file mode 100644 index 0000000000..f84379208a --- /dev/null +++ b/client/images/cross.svg @@ -0,0 +1,3 @@ + + + diff --git a/client/modules/IDE/components/Header/MobileNav.jsx b/client/modules/IDE/components/Header/MobileNav.jsx index 00840be084..76897a8d7b 100644 --- a/client/modules/IDE/components/Header/MobileNav.jsx +++ b/client/modules/IDE/components/Header/MobileNav.jsx @@ -13,7 +13,12 @@ import NavMenuItem from '../../../../components/Nav/NavMenuItem'; import { prop, remSize } from '../../../../theme'; import AsteriskIcon from '../../../../images/p5-asterisk.svg'; import IconButton from '../../../../components/mobile/IconButton'; -import { AccountIcon, EditorIcon, MoreIcon } from '../../../../common/icons'; +import { + AccountIcon, + EditorIcon, + MoreIcon, + CrossIcon +} from '../../../../common/icons'; import { newFile, newFolder, @@ -237,26 +242,40 @@ const MobileNav = () => {
by {project?.owner?.username}
)} - - {user.authenticated ? ( - - ) : ( -
- - - -
- )} - {title === project.name ? ( - - ) : ( + + {/* check if the user is in login page */} + {pathname === '/login' || pathname === '/signup' ? ( + // showing the login page +
- +
- )} -
+
+ ) : ( + + {/* checking if user is logged in or not */} + {user.authenticated ? ( + + ) : ( +
+ + + +
+ )} + {title === project.name ? ( + + ) : ( +
+ + + +
+ )} +
+ )} ); }; diff --git a/client/modules/IDE/components/Header/__snapshots__/Nav.unit.test.jsx.snap b/client/modules/IDE/components/Header/__snapshots__/Nav.unit.test.jsx.snap index cea033295f..ccae1b7f13 100644 --- a/client/modules/IDE/components/Header/__snapshots__/Nav.unit.test.jsx.snap +++ b/client/modules/IDE/components/Header/__snapshots__/Nav.unit.test.jsx.snap @@ -48,15 +48,15 @@ exports[`Nav renders dashboard version for mobile 1`] = `