File tree 6 files changed +83
-47
lines changed
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';
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,12 @@ 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
+ CrossIcon
21
+ } from '../../../../common/icons' ;
17
22
import {
18
23
newFile ,
19
24
newFolder ,
@@ -237,26 +242,40 @@ const MobileNav = () => {
237
242
< h5 > by { project ?. owner ?. username } </ h5 >
238
243
) }
239
244
</ 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 >
253
250
< div >
254
251
< Link to = { editorLink } >
255
- < IconButton icon = { EditorIcon } />
252
+ < IconButton icon = { CrossIcon } />
256
253
</ Link >
257
254
</ 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
+ ) }
260
279
</ Nav >
261
280
) ;
262
281
} ;
Original file line number Diff line number Diff line change @@ -48,15 +48,15 @@ exports[`Nav renders dashboard version for mobile 1`] = `
48
48
<DocumentFragment >
49
49
<header >
50
50
<nav
51
- class = " sc-giAqHp deBDHC "
51
+ class = " sc-ezzafa bZzfr "
52
52
>
53
53
<div
54
- class = " sc-ezzafa bKgrFx "
54
+ class = " sc-bYwzuL bIGdtt "
55
55
>
56
56
<test-file-stub />
57
57
</div >
58
58
<div
59
- class = " sc-bYwzuL lkVxhY "
59
+ class = " sc-kLojOw btKDXx "
60
60
>
61
61
<h1 >
62
62
<span
@@ -89,7 +89,7 @@ exports[`Nav renders dashboard version for mobile 1`] = `
89
89
</h1 >
90
90
</div >
91
91
<div
92
- class = " sc-kLojOw casOUg "
92
+ class = " sc-iklJeh jupmlX "
93
93
>
94
94
<div >
95
95
<a
@@ -459,15 +459,15 @@ exports[`Nav renders editor version for mobile 1`] = `
459
459
<DocumentFragment >
460
460
<header >
461
461
<nav
462
- class = " sc-giAqHp deBDHC "
462
+ class = " sc-ezzafa bZzfr "
463
463
>
464
464
<div
465
- class = " sc-ezzafa bKgrFx "
465
+ class = " sc-bYwzuL bIGdtt "
466
466
>
467
467
<test-file-stub />
468
468
</div >
469
469
<div
470
- class = " sc-bYwzuL lkVxhY "
470
+ class = " sc-kLojOw btKDXx "
471
471
>
472
472
<h1 >
473
473
<span
@@ -500,7 +500,7 @@ exports[`Nav renders editor version for mobile 1`] = `
500
500
</h1 >
501
501
</div >
502
502
<div
503
- class = " sc-kLojOw casOUg "
503
+ class = " sc-iklJeh jupmlX "
504
504
>
505
505
<div >
506
506
<a
Original file line number Diff line number Diff line change 2
2
text-align : center ;
3
3
display : flex ;
4
4
flex-direction : column ;
5
- align-items : center ;
5
+ align-items : center ;
6
6
justify-content : center ;
7
7
flex : 1 ;
8
+
9
+ @media (max-width : 550px ) {
10
+ text-align : left ;
11
+ justify-content : start ;
12
+ }
8
13
}
9
14
10
15
.form-container--align-left {
11
- text-align : left ;
16
+ text-align : left ;
12
17
}
13
18
14
19
.form-container--align-top {
15
- height : unset ;
20
+ height : unset ;
16
21
}
17
22
18
23
.form-container__header {
19
24
width : 100% ;
20
25
padding : #{15 / $base-font-size } rem #{34 / $base-font-size } rem;
21
26
display : flex ;
22
- justify-content : space-between ;
27
+ justify-content : space-between ;
23
28
}
24
29
25
30
.form-container__content {
31
36
}
32
37
33
38
.form-container--align-left .form-container__content {
34
- align-items : left ;
39
+ align-items : left ;
35
40
}
36
41
37
42
.form-container__title {
38
43
font-weight : normal ;
39
44
@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
+ }
42
51
}
43
52
44
53
.form-container__context {
45
- @include themify () {
46
- color : getThemifyVariable (' secondary-text-color' )
47
- }
54
+ @include themify () {
55
+ color : getThemifyVariable (" secondary-text-color" );
56
+ }
48
57
}
49
58
50
59
.form-container__divider {
51
- padding : #{20 / $base-font-size } rem 0 ;
60
+ padding : #{20 / $base-font-size } rem 0 ;
52
61
}
53
62
54
63
.form-container__logo-button {
55
- @include icon ();
64
+ @include icon ();
56
65
}
57
66
58
67
.form-container__exit-button {
Original file line number Diff line number Diff line change 5
5
font-size : #{12 / $base-font-size } rem;
6
6
text-align : left ;
7
7
@include themify () {
8
- color : getThemifyVariable (' error-color' );
8
+ color : getThemifyVariable (" error-color" );
9
9
}
10
10
}
11
11
27
27
margin-top : #{16 / $base-font-size } rem;
28
28
font-size : #{12 / $base-font-size } rem;
29
29
@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;
31
36
}
32
37
}
33
38
34
- .form__legend {
39
+ .form__legend {
35
40
font-size : #{21 / $base-font-size } rem;
36
41
font-weight : bold ;
37
42
}
42
47
margin-bottom : #{7 / $base-font-size } rem;
43
48
display : block ;
44
49
@include themify () {
45
- color : getThemifyVariable (' form-secondary-title-color' );
50
+ color : getThemifyVariable (" form-secondary-title-color" );
46
51
}
47
52
}
48
53
56
61
height : #{40 / $base-font-size } rem;
57
62
font-size : #{16 / $base-font-size } rem;
58
63
@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" );
61
66
}
62
67
}
63
68
67
72
68
73
.form__input ::placeholder {
69
74
@include themify () {
70
- color : getThemifyVariable (' form-input-placeholder-text-color' );
75
+ color : getThemifyVariable (" form-input-placeholder-text-color" );
71
76
}
72
77
}
73
78
78
83
79
84
.form__status {
80
85
@include themify () {
81
- color : getThemifyVariable (' form-navigation-options-color' );
86
+ color : getThemifyVariable (" form-navigation-options-color" );
82
87
}
83
88
}
84
89
You can’t perform that action at this time.
0 commit comments