refactor: 将 enum key的格式改为 PascalCase

This commit is contained in:
qier222 2022-04-16 22:39:51 +08:00
parent 0061a66124
commit 7e892997bd
No known key found for this signature in database
GPG key ID: 9C85007ED905F14D
36 changed files with 141 additions and 142 deletions

View file

@ -12,9 +12,9 @@ import { setCookies } from '@/renderer/utils/cookie'
import { useInterval } from 'react-use'
enum Method {
QRCODE = 'qrcode',
EMAIL = 'email',
PHONE = 'phone',
QrCode = 'qrcode',
Email = 'email',
Phone = 'phone',
}
// Shared components and methods
@ -152,15 +152,15 @@ const OtherLoginMethods = ({
name: string
}[] = [
{
id: Method.QRCODE,
id: Method.QrCode,
name: '二维码',
},
{
id: Method.EMAIL,
id: Method.Email,
name: '邮箱',
},
{
id: Method.PHONE,
id: Method.Phone,
name: '手机',
},
]
@ -393,14 +393,14 @@ const LoginWithQRCode = () => {
}
export default function Login() {
const [method, setMethod] = useState<Method>(Method.PHONE)
const [method, setMethod] = useState<Method>(Method.Phone)
return (
<div className='grid h-full place-content-center'>
<div className='w-80'>
{method === Method.EMAIL && <LoginWithEmail />}
{method === Method.PHONE && <LoginWithPhone />}
{method === Method.QRCODE && <LoginWithQRCode />}
{method === Method.Email && <LoginWithEmail />}
{method === Method.Phone && <LoginWithPhone />}
{method === Method.QrCode && <LoginWithQRCode />}
<OtherLoginMethods {...{ method, setMethod }} />
</div>
</div>