fix: theme setting in login

This commit is contained in:
jialin
2025-05-14 22:19:27 +08:00
parent 5488a8ea82
commit 8a59025132
4 changed files with 77 additions and 9 deletions
+3 -2
View File
@@ -2,7 +2,7 @@ import LogoIcon from '@/assets/images/gpustack-logo.png';
import { initialPasswordAtom, userAtom } from '@/atoms/user';
import LangSelect from '@/components/lang-select';
import SealInput from '@/components/seal-form/seal-input';
import ThemeToggle from '@/components/theme-toggle';
import ThemeDropActions from '@/components/theme-toggle/theme-drop-actions';
import externalLinks from '@/constants/external-links';
import {
CRYPT_TEXT,
@@ -30,6 +30,7 @@ const useStyles = createStyles(({ token, css }) => ({
position: fixed;
right: 0;
top: 0;
height: 60px;
padding: 20px;
.anticon-global {
color: ${token.colorText};
@@ -153,7 +154,7 @@ const LoginForm = () => {
return (
<div>
<div className={styles.header}>
<ThemeToggle></ThemeToggle>
<ThemeDropActions></ThemeDropActions>
<LangSelect />
</div>
<div>
+1 -5
View File
@@ -2,7 +2,7 @@ import useUserSettings from '@/hooks/use-user-settings';
import { MoonOutlined, SunOutlined } from '@ant-design/icons';
import { useIntl } from '@umijs/max';
import { Select } from 'antd';
import React, { useMemo } from 'react';
import React from 'react';
import styled from 'styled-components';
const Wrapper = styled.div`
@@ -56,10 +56,6 @@ const Appearance: React.FC = () => {
setTheme(value);
};
const theme = useMemo(() => {
return userSettings?.theme || 'auto';
}, [userSettings?.theme]);
return (
<Wrapper>
<div className="theme">