Skip to content

Commit

Permalink
feat: customize title and logo of login page
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Oct 7, 2022
1 parent 47b95a0 commit 3336dd5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/lang/en/login.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"title": "Login to the ALIST",
"login_to": "Login to the",
"username-tips": "Input your username",
"password-tips": "Input your password",
"otp-tips": "Input your OTP Code",
Expand Down
17 changes: 10 additions & 7 deletions src/pages/login/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,23 @@ import {
VStack,
Checkbox,
} from "@hope-ui/solid"
import { createSignal, Show } from "solid-js"
import { createMemo, createSignal, Show } from "solid-js"
import { SwitchColorMode, SwitchLanguageWhite } from "~/components"
import { useFetch, useT, useTitle, useRouter } from "~/hooks"
import { changeToken, r, notify, handleRespWithoutNotify } from "~/utils"
import { Resp } from "~/types"
import LoginBg from "./LoginBg"
import { createStorageSignal } from "@solid-primitives/storage"
import { getSetting } from "~/store"

const Login = () => {
const logos = getSetting("logo").split("\n")
const logo = useColorModeValue(logos[0], logos.pop())
const t = useT()
useTitle(() => t("login.title"))
const title = createMemo(() => {
return `${t("login.login_to")} ${getSetting("site_title")}`
})
useTitle(title)
const bgColor = useColorModeValue("white", "$neutral1")
const [username, setUsername] = createSignal(
localStorage.getItem("username") || ""
Expand Down Expand Up @@ -80,12 +86,9 @@ const Login = () => {
spacing="$4"
>
<Flex alignItems="center" justifyContent="space-around">
<Image
boxSize="$12"
src="https://jsd.nn.ci/gh/alist-org/logo@main/logo.svg"
/>
<Image mr="$2" boxSize="$12" src={logo()} />
<Heading color="$info9" fontSize="$2xl">
{t("login.title")}
{title()}
</Heading>
</Flex>
<Show
Expand Down

0 comments on commit 3336dd5

Please sign in to comment.