File tree Expand file tree Collapse file tree 7 files changed +76
-7
lines changed Expand file tree Collapse file tree 7 files changed +76
-7
lines changed Original file line number Diff line number Diff line change
1
+ @import ' src/design-system/variables/variables.scss' ;
2
+ @import ' src/design-system/variables/colors.scss' ;
3
+ @import ' src/design-system/variables/typography.scss' ;
4
+
5
+ .wrapper {
6
+ display : flex ;
7
+ align-items : center ;
8
+ justify-content : center ;
9
+ gap : 16px ;
10
+ }
11
+
12
+ .badge {
13
+ padding : 4px 16px ;
14
+ border-radius : 4px ;
15
+ background-color : $color-success-100 ;
16
+ color : $color-success-700 ;
17
+ text-align : center ;
18
+ @include label ();
19
+ }
20
+
21
+ .version {
22
+ @include paragraph-x-small ();
23
+ white-space : nowrap ;
24
+ }
Original file line number Diff line number Diff line change
1
+ import { Tooltip } from 'design-system/components/tooltip/tooltip'
2
+ import styles from './beta-info.module.scss'
3
+
4
+ const COPY = {
5
+ LABEL : 'Beta' ,
6
+ INFO : 'All data is considered test data and may be changed or deleted at any time. Use with caution.' ,
7
+ VERSION : `Build ${ __COMMIT_HASH__ } ` ,
8
+ }
9
+
10
+ export const BetaInfo = ( ) => {
11
+ return (
12
+ < div className = { styles . wrapper } >
13
+ < Tooltip content = { COPY . INFO } >
14
+ < div className = { styles . badge } > { COPY . LABEL } </ div >
15
+ </ Tooltip >
16
+ < span className = { styles . version } > { COPY . VERSION } </ span >
17
+ </ div >
18
+ )
19
+ }
Original file line number Diff line number Diff line change 8
8
height : 64px ;
9
9
display : flex ;
10
10
align-items : center ;
11
- justify-content : space-between ;
11
+ justify-content : flex-start ;
12
+ gap : 32px ;
12
13
padding : 0 100px ;
13
14
background-color : $color-generic-white ;
14
15
border-bottom : 1px solid $color-neutral-100 ;
22
23
vertical-align : middle ;
23
24
}
24
25
25
- .infoPages {
26
+ .rightContent {
26
27
display : flex ;
27
28
align-items : center ;
29
+ justify-content : flex-end ;
30
+ flex : 1 ;
28
31
gap : 4px ;
29
32
}
30
33
34
+ .infoPages {
35
+ display : contents ;
36
+ }
37
+
31
38
@media only screen and (max-width : $medium-screen-breakpoint ) {
32
39
.header {
33
40
padding : 0 32px ;
37
44
@media only screen and (max-width : $small-screen-breakpoint ) {
38
45
.header {
39
46
padding : 0 16px ;
47
+ gap : 16px ;
48
+ }
49
+
50
+ .infoPages {
51
+ display : none ;
40
52
}
41
53
}
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { STRING, translate } from 'utils/language'
8
8
import { usePageTitle } from 'utils/usePageTitle'
9
9
import { useUser } from 'utils/user/userContext'
10
10
import ami from './ami.png'
11
+ import { BetaInfo } from './beta-info/beta-info'
11
12
import styles from './header.module.scss'
12
13
import { UserInfoDialog } from './user-info-dialog/user-info-dialog'
13
14
@@ -31,10 +32,13 @@ export const Header = () => {
31
32
className = { styles . logo }
32
33
/>
33
34
</ Link >
34
- < div className = { styles . infoPages } >
35
- { pages . map ( ( page ) => (
36
- < InfoDialog key = { page . id } name = { page . name } slug = { page . slug } />
37
- ) ) }
35
+ < BetaInfo />
36
+ < div className = { styles . rightContent } >
37
+ < div className = { styles . infoPages } >
38
+ { pages . map ( ( page ) => (
39
+ < InfoDialog key = { page . id } name = { page . name } slug = { page . slug } />
40
+ ) ) }
41
+ </ div >
38
42
< Button
39
43
label = { translate ( STRING . SIGN_UP ) }
40
44
theme = { ButtonTheme . Plain }
Original file line number Diff line number Diff line change 18
18
"baseUrl" : " src" ,
19
19
"types" : [" vite/client" , " vite-plugin-svgr/client" ]
20
20
},
21
- "include" : [" src" ]
21
+ "include" : [" src" , " vite-env.d.ts " ]
22
22
}
Original file line number Diff line number Diff line change 1
1
/// <reference types="vite/client" />
2
+
3
+ declare const __COMMIT_HASH__ : string
Original file line number Diff line number Diff line change 1
1
import react from '@vitejs/plugin-react'
2
+ import childProcees from 'child_process'
2
3
import { defineConfig } from 'vite'
3
4
import eslint from 'vite-plugin-eslint'
4
5
import svgr from 'vite-plugin-svgr'
5
6
import viteTsconfigPaths from 'vite-tsconfig-paths'
6
7
8
+ const commitHash = childProcees
9
+ . execSync ( 'git rev-parse --short HEAD' )
10
+ . toString ( )
11
+
7
12
export default defineConfig ( {
8
13
base : '/' ,
9
14
build : {
@@ -15,6 +20,9 @@ export default defineConfig({
15
20
svgr ( { include : '**/*.svg?react' } ) ,
16
21
eslint ( { exclude : [ '/virtual:/**' , 'node_modules/**' ] } ) ,
17
22
] ,
23
+ define : {
24
+ __COMMIT_HASH__ : JSON . stringify ( commitHash ) ,
25
+ } ,
18
26
server : {
19
27
open : true ,
20
28
port : 3000 ,
You can’t perform that action at this time.
0 commit comments