修复登录倒计时颜色

This commit is contained in:
hanhh 2021-08-25 18:58:45 +08:00
parent 8ce1a33bd3
commit 79e5b2fb84
2 changed files with 11 additions and 4 deletions

View File

@ -45,11 +45,11 @@ export default function (props: any) {
}, [props.location.pathname]); }, [props.location.pathname]);
useEffect(() => { useEffect(() => {
const theme = localStorage.getItem('qinglong_dark_theme') || 'auto'; const _theme = localStorage.getItem('qinglong_dark_theme') || 'auto';
setFetchMethod(window.fetch); setFetchMethod(window.fetch);
if (theme === 'dark') { if (_theme === 'dark') {
enableDarkMode({}); enableDarkMode({});
} else if (theme === 'light') { } else if (_theme === 'light') {
disableDarkMode(); disableDarkMode();
} else { } else {
followSystemColorScheme({}); followSystemColorScheme({});

View File

@ -12,6 +12,7 @@ import config from '@/utils/config';
import { history, Link } from 'umi'; import { history, Link } from 'umi';
import styles from './index.less'; import styles from './index.less';
import { request } from '@/utils/http'; import { request } from '@/utils/http';
import { useTheme } from '@/utils/hooks';
const FormItem = Form.Item; const FormItem = Form.Item;
const { Countdown } = Statistic; const { Countdown } = Statistic;
@ -19,6 +20,7 @@ const { Countdown } = Statistic;
const Login = () => { const Login = () => {
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [waitTime, setWaitTime] = useState<any>(); const [waitTime, setWaitTime] = useState<any>();
const { theme } = useTheme();
const handleOk = (values: any) => { const handleOk = (values: any) => {
setLoading(true); setLoading(true);
@ -106,7 +108,12 @@ const Login = () => {
<Button type="primary" style={{ width: '100%' }} disabled> <Button type="primary" style={{ width: '100%' }} disabled>
<Countdown <Countdown
valueStyle={{ color: 'rgba(232, 230, 227, 0.25)' }} valueStyle={{
color:
theme === 'vs'
? 'rgba(0,0,0,.25)'
: 'rgba(232, 230, 227, 0.25)',
}}
className="inline-countdown" className="inline-countdown"
onFinish={() => setWaitTime(null)} onFinish={() => setWaitTime(null)}
format="ss" format="ss"