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

Commitc377cd0

Browse files
fix: Move CLI auth screen outside of dashboard (#5755)
1 parentf0eddba commitc377cd0

File tree

5 files changed

+27
-23
lines changed

5 files changed

+27
-23
lines changed

‎site/src/AppRouter.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ export const AppRouter: FC = () => {
142142
<Routeelement={<DashboardLayout/>}>
143143
<Routeindexelement={<IndexPage/>}/>
144144

145-
<Routepath="cli-auth"element={<CliAuthenticationPage/>}/>
146145
<Routepath="gitauth"element={<GitAuthPage/>}/>
147146

148147
<Routepath="workspaces"element={<WorkspacesPage/>}/>
@@ -241,11 +240,12 @@ export const AppRouter: FC = () => {
241240
</Route>
242241
</Route>
243242

244-
{/* Terminalpage don't have the dashboard layout */}
243+
{/* Terminaland CLI auth pages don't have the dashboard layout */}
245244
<Route
246245
path="/@:username/:workspace/terminal"
247246
element={<TerminalPage/>}
248247
/>
248+
<Routepath="cli-auth"element={<CliAuthenticationPage/>}/>
249249
</Route>
250250

251251
{/* Using path="*"" means "match anything", so this route

‎site/src/components/SignInLayout/SignInLayout.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ export const useStyles = makeStyles((theme) => ({
1515
},
1616
container:{
1717
marginTop:theme.spacing(-8),
18-
minWidth:"320px",
19-
maxWidth:"320px",
18+
maxWidth:385,
2019
},
21-
copyright:{
22-
marginTop:theme.spacing(2),
20+
footer:{
21+
fontSize:12,
22+
color:theme.palette.text.secondary,
23+
marginTop:theme.spacing(3),
2324
},
2425
}))
2526

@@ -30,7 +31,7 @@ export const SignInLayout: FC<{ children: ReactNode }> = ({ children }) => {
3031
<divclassName={styles.root}>
3132
<divclassName={styles.layout}>
3233
<divclassName={styles.container}>{children}</div>
33-
<divclassName={styles.copyright}>
34+
<divclassName={styles.footer}>
3435
{`\u00a9${newDate().getFullYear()} Coder Technologies, Inc.`}
3536
</div>
3637
</div>

‎site/src/components/Welcome/Welcome.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,20 @@ const useStyles = makeStyles((theme) => ({
3434
justifyContent:"center",
3535
},
3636
logo:{
37-
width:80,
38-
height:56,
3937
color:theme.palette.text.primary,
38+
fontSize:theme.spacing(8),
4039
},
4140
title:{
42-
fontSize:24,
43-
letterSpacing:-0.3,
44-
marginBottom:theme.spacing(3),
45-
marginTop:theme.spacing(6),
4641
textAlign:"center",
42+
fontSize:theme.spacing(4),
43+
fontWeight:400,
44+
margin:0,
45+
marginBottom:theme.spacing(2),
46+
marginTop:theme.spacing(2),
47+
lineHeight:1,
48+
49+
"& strong":{
50+
fontWeight:600,
51+
},
4752
},
4853
}))

‎site/src/pages/CliAuthPage/CliAuthPage.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
1-
import{useActor}from"@xstate/react"
2-
import{useContext,useEffect,useState,FC,PropsWithChildren}from"react"
1+
import{useEffect,useState,FC,PropsWithChildren}from"react"
32
import{Helmet}from"react-helmet-async"
43
import{getApiKey}from"../../api/api"
54
import{pageTitle}from"../../util/page"
6-
import{XServiceContext}from"../../xServices/StateContext"
75
import{CliAuthPageView}from"./CliAuthPageView"
86

97
exportconstCliAuthenticationPage:FC<PropsWithChildren<unknown>>=()=>{
10-
constxServices=useContext(XServiceContext)
11-
const[authState]=useActor(xServices.authXService)
12-
const{ me}=authState.context
138
const[apiKey,setApiKey]=useState<string|null>(null)
149

1510
useEffect(()=>{
16-
if(me?.id){
17-
voidgetApiKey().then(({ key})=>{
11+
getApiKey()
12+
.then(({ key})=>{
1813
setApiKey(key)
1914
})
20-
}
21-
},[me?.id])
15+
.catch((error)=>{
16+
console.error(error)
17+
})
18+
},[])
2219

2320
return(
2421
<>

‎site/src/pages/CliAuthPage/CliAuthPageView.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export const CliAuthPageView: FC<CliAuthPageViewProps> = ({ sessionToken }) => {
2121
return(
2222
<SignInLayout>
2323
<Welcomemessage="Session token"/>
24+
2425
<pclassName={styles.text}>
2526
Copy the session token below and{" "}
2627
<strongclassName={styles.lineBreak}>paste it in your terminal</strong>.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp