File tree Expand file tree Collapse file tree 6 files changed +83
-47
lines changed Expand file tree Collapse file tree 6 files changed +83
-47
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,12 @@ 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+ CrossIcon
21+ } from '../../../../common/icons' ;
1722import {
1823 newFile ,
1924 newFolder ,
@@ -237,26 +242,40 @@ const MobileNav = () => {
237242 < h5 > by { project ?. owner ?. username } </ h5 >
238243 ) }
239244 </ 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- ) : (
245+
246+ { /* check if the user is in login page */ }
247+ { pathname === '/login' || pathname === '/signup' ? (
248+ // showing the login page
249+ < Options >
253250 < div >
254251 < Link to = { editorLink } >
255- < IconButton icon = { EditorIcon } />
252+ < IconButton icon = { CrossIcon } />
256253 </ Link >
257254 </ div >
258- ) }
259- </ Options >
255+ </ Options >
256+ ) : (
257+ < Options >
258+ { /* checking if user is logged in or not */ }
259+ { user . authenticated ? (
260+ < AccountMenu />
261+ ) : (
262+ < div >
263+ < Link to = "/login" >
264+ < IconButton icon = { AccountIcon } />
265+ </ Link >
266+ </ div >
267+ ) }
268+ { title === project . name ? (
269+ < MoreMenu />
270+ ) : (
271+ < div >
272+ < Link to = { editorLink } >
273+ < IconButton icon = { EditorIcon } />
274+ </ Link >
275+ </ div >
276+ ) }
277+ </ Options >
278+ ) }
260279 </ Nav >
261280 ) ;
262281} ;
Original file line number Diff line number Diff line change @@ -48,15 +48,15 @@ exports[`Nav renders dashboard version for mobile 1`] = `
4848<DocumentFragment >
4949 <header >
5050 <nav
51- class = " sc-giAqHp deBDHC "
51+ class = " sc-ezzafa bZzfr "
5252 >
5353 <div
54- class = " sc-ezzafa bKgrFx "
54+ class = " sc-bYwzuL bIGdtt "
5555 >
5656 <test-file-stub />
5757 </div >
5858 <div
59- class = " sc-bYwzuL lkVxhY "
59+ class = " sc-kLojOw btKDXx "
6060 >
6161 <h1 >
6262 <span
@@ -89,7 +89,7 @@ exports[`Nav renders dashboard version for mobile 1`] = `
8989 </h1 >
9090 </div >
9191 <div
92- class = " sc-kLojOw casOUg "
92+ class = " sc-iklJeh jupmlX "
9393 >
9494 <div >
9595 <a
@@ -459,15 +459,15 @@ exports[`Nav renders editor version for mobile 1`] = `
459459<DocumentFragment >
460460 <header >
461461 <nav
462- class = " sc-giAqHp deBDHC "
462+ class = " sc-ezzafa bZzfr "
463463 >
464464 <div
465- class = " sc-ezzafa bKgrFx "
465+ class = " sc-bYwzuL bIGdtt "
466466 >
467467 <test-file-stub />
468468 </div >
469469 <div
470- class = " sc-bYwzuL lkVxhY "
470+ class = " sc-kLojOw btKDXx "
471471 >
472472 <h1 >
473473 <span
@@ -500,7 +500,7 @@ exports[`Nav renders editor version for mobile 1`] = `
500500 </h1 >
501501 </div >
502502 <div
503- class = " sc-kLojOw casOUg "
503+ class = " sc-iklJeh jupmlX "
504504 >
505505 <div >
506506 <a
Original file line number Diff line number Diff line change 22 text-align : center ;
33 display : flex ;
44 flex-direction : column ;
5- align-items : center ;
5+ align-items : center ;
66 justify-content : center ;
77 flex : 1 ;
8+
9+ @media (max-width : 550px ) {
10+ text-align : left ;
11+ justify-content : start ;
12+ }
813}
914
1015.form-container--align-left {
11- text-align : left ;
16+ text-align : left ;
1217}
1318
1419.form-container--align-top {
15- height : unset ;
20+ height : unset ;
1621}
1722
1823.form-container__header {
1924 width : 100% ;
2025 padding : #{15 / $base-font-size } rem #{34 / $base-font-size } rem;
2126 display : flex ;
22- justify-content : space-between ;
27+ justify-content : space-between ;
2328}
2429
2530.form-container__content {
3136}
3237
3338.form-container--align-left .form-container__content {
34- align-items : left ;
39+ align-items : left ;
3540}
3641
3742.form-container__title {
3843 font-weight : normal ;
3944 @include themify () {
40- color : getThemifyVariable (' form-title-color' )
41- }
45+ color : getThemifyVariable (" form-title-color" );
46+ }
47+
48+ @media (max-width : 770px ) {
49+ display : none ;
50+ }
4251}
4352
4453.form-container__context {
45- @include themify () {
46- color : getThemifyVariable (' secondary-text-color' )
47- }
54+ @include themify () {
55+ color : getThemifyVariable (" secondary-text-color" );
56+ }
4857}
4958
5059.form-container__divider {
51- padding : #{20 / $base-font-size } rem 0 ;
60+ padding : #{20 / $base-font-size } rem 0 ;
5261}
5362
5463.form-container__logo-button {
55- @include icon ();
64+ @include icon ();
5665}
5766
5867.form-container__exit-button {
Original file line number Diff line number Diff line change 55 font-size : #{12 / $base-font-size } rem;
66 text-align : left ;
77 @include themify () {
8- color : getThemifyVariable (' error-color' );
8+ color : getThemifyVariable (" error-color" );
99 }
1010}
1111
2727 margin-top : #{16 / $base-font-size } rem;
2828 font-size : #{12 / $base-font-size } rem;
2929 @include themify () {
30- color : getThemifyVariable (' form-navigation-options-color' );
30+ color : getThemifyVariable (" form-navigation-options-color" );
31+ }
32+
33+ @media (max-width : 550px ) {
34+ text-align : center ;
35+ margin : #{12 / $base-font-size } rem;
3136 }
3237}
3338
34- .form__legend {
39+ .form__legend {
3540 font-size : #{21 / $base-font-size } rem;
3641 font-weight : bold ;
3742}
4247 margin-bottom : #{7 / $base-font-size } rem;
4348 display : block ;
4449 @include themify () {
45- color : getThemifyVariable (' form-secondary-title-color' );
50+ color : getThemifyVariable (" form-secondary-title-color" );
4651 }
4752}
4853
5661 height : #{40 / $base-font-size } rem;
5762 font-size : #{16 / $base-font-size } rem;
5863 @include themify () {
59- color : getThemifyVariable (' form-input-text-color' );
60- background-color : getThemifyVariable (' input-background-color' );
64+ color : getThemifyVariable (" form-input-text-color" );
65+ background-color : getThemifyVariable (" input-background-color" );
6166 }
6267}
6368
6772
6873.form__input ::placeholder {
6974 @include themify () {
70- color : getThemifyVariable (' form-input-placeholder-text-color' );
75+ color : getThemifyVariable (" form-input-placeholder-text-color" );
7176 }
7277}
7378
7883
7984.form__status {
8085 @include themify () {
81- color : getThemifyVariable (' form-navigation-options-color' );
86+ color : getThemifyVariable (" form-navigation-options-color" );
8287 }
8388}
8489
You can’t perform that action at this time.
0 commit comments