1
1
import Button from "@mui/material/Button" ;
2
- import { useTheme } from "@emotion/react" ;
2
+ import { type Interpolation , type Theme } from "@emotion/react" ;
3
3
import { type FC } from "react" ;
4
4
import { Link as RouterLink } from "react-router-dom" ;
5
5
import { CodeExample } from "components/CodeExample/CodeExample" ;
@@ -8,12 +8,10 @@ import { Welcome } from "components/Welcome/Welcome";
8
8
import { FullScreenLoader } from "components/Loader/FullScreenLoader" ;
9
9
10
10
export interface CliAuthPageViewProps {
11
- sessionToken : string | null ;
11
+ sessionToken ? : string ;
12
12
}
13
13
14
14
export const CliAuthPageView : FC < CliAuthPageViewProps > = ( { sessionToken } ) => {
15
- const theme = useTheme ( ) ;
16
-
17
15
if ( ! sessionToken ) {
18
16
return < FullScreenLoader /> ;
19
17
}
@@ -22,15 +20,7 @@ export const CliAuthPageView: FC<CliAuthPageViewProps> = ({ sessionToken }) => {
22
20
< SignInLayout >
23
21
< Welcome > Session token</ Welcome >
24
22
25
- < p
26
- css = { {
27
- fontSize : 16 ,
28
- color : theme . palette . text . secondary ,
29
- marginBottom : 32 ,
30
- textAlign : "center" ,
31
- lineHeight : "160%" ,
32
- } }
33
- >
23
+ < p css = { styles . instructions } >
34
24
Copy the session token below and{ " " }
35
25
< strong css = { { whiteSpace : "nowrap" } } >
36
26
paste it in your terminal
@@ -40,17 +30,27 @@ export const CliAuthPageView: FC<CliAuthPageViewProps> = ({ sessionToken }) => {
40
30
41
31
< CodeExample code = { sessionToken } secret />
42
32
43
- < div
44
- css = { {
45
- display : "flex" ,
46
- justifyContent : "flex-end" ,
47
- paddingTop : 8 ,
48
- } }
49
- >
33
+ < div css = { styles . backButton } >
50
34
< Button component = { RouterLink } size = "large" to = "/workspaces" fullWidth >
51
35
Go to workspaces
52
36
</ Button >
53
37
</ div >
54
38
</ SignInLayout >
55
39
) ;
56
40
} ;
41
+
42
+ const styles = {
43
+ instructions : ( theme ) => ( {
44
+ fontSize : 16 ,
45
+ color : theme . palette . text . secondary ,
46
+ marginBottom : 32 ,
47
+ textAlign : "center" ,
48
+ lineHeight : "160%" ,
49
+ } ) ,
50
+
51
+ backButton : {
52
+ display : "flex" ,
53
+ justifyContent : "flex-end" ,
54
+ paddingTop : 8 ,
55
+ } ,
56
+ } satisfies Record < string , Interpolation < Theme > > ;
0 commit comments