Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitca5f114

Browse files
refactor: update cli auth page design (#17915)
Improve UX of CLI Auth page.**Before:**<img width="1512" alt="Screenshot 2025-05-19 at 09 22 36"src="https://github.com/user-attachments/assets/ffcecebc-a289-4b06-993d-a170f2ba5e49"/>**After:**https://github.com/user-attachments/assets/01dfcd70-d0a6-48bb-9186-77da24001498Fixes#17905
1 parentac7961a commitca5f114

File tree

1 file changed

+33
-53
lines changed

1 file changed

+33
-53
lines changed
Lines changed: 33 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,53 @@
1-
importtype{Interpolation,Theme}from"@emotion/react";
2-
import{visuallyHidden}from"@mui/utils";
3-
import{CodeExample}from"components/CodeExample/CodeExample";
4-
import{Loader}from"components/Loader/Loader";
1+
import{Button}from"components/Button/Button";
52
import{SignInLayout}from"components/SignInLayout/SignInLayout";
3+
import{Spinner}from"components/Spinner/Spinner";
64
import{Welcome}from"components/Welcome/Welcome";
5+
import{useClipboard}from"hooks";
6+
import{CheckIcon,CopyIcon}from"lucide-react";
77
importtype{FC}from"react";
88
import{LinkasRouterLink}from"react-router-dom";
99

1010
exportinterfaceCliAuthPageViewProps{
1111
sessionToken?:string;
1212
}
1313

14-
constVISUALLY_HIDDEN_SPACE=" ";
15-
1614
exportconstCliAuthPageView:FC<CliAuthPageViewProps>=({ sessionToken})=>{
17-
if(!sessionToken){
18-
return<Loaderfullscreen/>;
19-
}
15+
constclipboard=useClipboard({
16+
textToCopy:sessionToken??"",
17+
});
2018

2119
return(
2220
<SignInLayout>
23-
<WelcomeclassName="pb-3">Session token</Welcome>
21+
<Welcome>Session token</Welcome>
2422

25-
<pcss={styles.instructions}>
26-
Copy the session token below and
27-
{/*
28-
* This looks silly, but it's a case where you want to hide the space
29-
* visually because it messes up the centering, but you want the space
30-
* to still be available to screen readers
31-
*/}
32-
<spancss={{ ...visuallyHidden}}>{VISUALLY_HIDDEN_SPACE}</span>
33-
<strongcss={{display:"block"}}>paste it in your terminal.</strong>
23+
<pclassName="m-0 text-center text-sm text-content-secondary leading-normal">
24+
Copy the session token below and{" "}
25+
<strongclassName="block">paste it in your terminal.</strong>
3426
</p>
3527

36-
<CodeExamplecode={sessionToken}secret/>
37-
38-
<divcss={{paddingTop:16}}>
39-
<RouterLinkto="/workspaces"css={styles.backLink}>
40-
Go to workspaces
41-
</RouterLink>
28+
<divclassName="flex flex-col items-center gap-1 w-full mt-4">
29+
<Button
30+
className="w-full"
31+
size="lg"
32+
disabled={!sessionToken}
33+
onClick={clipboard.copyToClipboard}
34+
>
35+
{clipboard.showCopiedSuccess ?(
36+
<CheckIcon/>
37+
) :(
38+
<Spinnerloading={!sessionToken}>
39+
<CopyIcon/>
40+
</Spinner>
41+
)}
42+
{clipboard.showCopiedSuccess
43+
?"Session token copied!"
44+
:"Copy session token"}
45+
</Button>
46+
47+
<ButtonclassName="w-full"variant="subtle"asChild>
48+
<RouterLinkto="/workspaces">Go to workspaces</RouterLink>
49+
</Button>
4250
</div>
4351
</SignInLayout>
4452
);
4553
};
46-
47-
conststyles={
48-
instructions:(theme)=>({
49-
fontSize:16,
50-
color:theme.palette.text.secondary,
51-
paddingBottom:8,
52-
textAlign:"center",
53-
lineHeight:1.4,
54-
55-
// Have to undo styling side effects from <Welcome> component
56-
marginTop:-24,
57-
}),
58-
59-
backLink:(theme)=>({
60-
display:"block",
61-
textAlign:"center",
62-
color:theme.palette.text.primary,
63-
textDecoration:"underline",
64-
textUnderlineOffset:3,
65-
textDecorationColor:"hsla(0deg, 0%, 100%, 0.7)",
66-
paddingTop:16,
67-
paddingBottom:16,
68-
69-
"&:hover":{
70-
textDecoration:"none",
71-
},
72-
}),
73-
}satisfiesRecord<string,Interpolation<Theme>>;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp