-
Notifications
You must be signed in to change notification settings - Fork 60k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1844 from Yidadaa/bugfix-0607
feat: close #741 add auth page
- Loading branch information
Showing
7 changed files
with
128 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
.auth-page { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100%; | ||
width: 100%; | ||
flex-direction: column; | ||
|
||
.auth-logo { | ||
transform: scale(1.4); | ||
} | ||
|
||
.auth-title { | ||
font-size: 24px; | ||
font-weight: bold; | ||
line-height: 2; | ||
} | ||
|
||
.auth-tips { | ||
font-size: 14px; | ||
} | ||
|
||
.auth-input { | ||
margin: 3vh 0; | ||
} | ||
|
||
.auth-actions { | ||
display: flex; | ||
justify-content: center; | ||
flex-direction: column; | ||
|
||
button:not(:last-child) { | ||
margin-bottom: 10px; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import styles from "./auth.module.scss"; | ||
import { IconButton } from "./button"; | ||
|
||
import { useNavigate } from "react-router-dom"; | ||
import { Path } from "../constant"; | ||
import { useAccessStore } from "../store"; | ||
import Locale from "../locales"; | ||
|
||
import BotIcon from "../icons/bot.svg"; | ||
|
||
export function AuthPage() { | ||
const navigate = useNavigate(); | ||
const access = useAccessStore(); | ||
|
||
const goHome = () => navigate(Path.Home); | ||
|
||
return ( | ||
<div className={styles["auth-page"]}> | ||
<div className={`no-dark ${styles["auth-logo"]}`}> | ||
<BotIcon /> | ||
</div> | ||
|
||
<div className={styles["auth-title"]}>{Locale.Auth.Title}</div> | ||
<div className={styles["auth-tips"]}>{Locale.Auth.Tips}</div> | ||
|
||
<input | ||
className={styles["auth-input"]} | ||
type="text" | ||
placeholder={Locale.Auth.Input} | ||
value={access.accessCode} | ||
onChange={(e) => { | ||
access.updateCode(e.currentTarget.value); | ||
}} | ||
/> | ||
|
||
<div className={styles["auth-actions"]}> | ||
<IconButton | ||
text={Locale.Auth.Confirm} | ||
type="primary" | ||
onClick={goHome} | ||
/> | ||
<IconButton text={Locale.Auth.Later} onClick={goHome} /> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters