Skip to content

Commit 8112233

Browse files
committed
the header cross
1 parent f0acd48 commit 8112233

File tree

3 files changed

+43
-19
lines changed

3 files changed

+43
-19
lines changed

client/common/icons.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import Folder from '../images/folder-padded.svg';
2424
import CircleTerminal from '../images/circle-terminal.svg';
2525
import CircleFolder from '../images/circle-folder.svg';
2626
import 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);
9495
export const TerminalIcon = withLabel(Terminal);
9596
export const CodeIcon = withLabel(Code);
9697
export const SaveIcon = withLabel(Save);
97-
9898
export const FolderIcon = withLabel(Folder);
99-
99+
export const crossIcon = withLabel(Cross);
100100
export const CircleTerminalIcon = withLabel(CircleTerminal);
101101
export const CircleFolderIcon = withLabel(CircleFolder);
102102
export const CircleInfoIcon = withLabel(CircleInfo);

client/images/cross.svg

Lines changed: 3 additions & 0 deletions
Loading

client/modules/IDE/components/Header/MobileNav.jsx

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@ import NavMenuItem from '../../../../components/Nav/NavMenuItem';
1313
import { prop, remSize } from '../../../../theme';
1414
import AsteriskIcon from '../../../../images/p5-asterisk.svg';
1515
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';
1724
import {
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
};

0 commit comments

Comments
 (0)