diff --git a/youtube_collection_web/src/assets/locales/en-US.json b/youtube_collection_web/src/assets/locales/en-US.json index f772742..5d11084 100644 --- a/youtube_collection_web/src/assets/locales/en-US.json +++ b/youtube_collection_web/src/assets/locales/en-US.json @@ -1,3 +1,8 @@ { - "hello":"Hello" + "hello": "Hello", + "login_page": { + "login": "Login", + "username": "Username", + "password": "Password" + } } \ No newline at end of file diff --git a/youtube_collection_web/src/assets/locales/zh-CN.json b/youtube_collection_web/src/assets/locales/zh-CN.json index 0700a35..623fb33 100644 --- a/youtube_collection_web/src/assets/locales/zh-CN.json +++ b/youtube_collection_web/src/assets/locales/zh-CN.json @@ -1,3 +1,8 @@ { - "hello":"你好" + "hello": "你好", + "login_page": { + "login": "登录", + "username": "用户名", + "password": "密码" + } } \ No newline at end of file diff --git a/youtube_collection_web/src/components/Login.js b/youtube_collection_web/src/components/Login.js index 587ce8f..8be364f 100644 --- a/youtube_collection_web/src/components/Login.js +++ b/youtube_collection_web/src/components/Login.js @@ -1,16 +1,103 @@ import React from 'react' -import { useNavigate } from 'react-router-dom'; -import { Button } from 'antd' +// import { useNavigate } from 'react-router-dom'; +import { Card, Button, Flex, Form, Input, Space } from 'antd'; +import { useTranslation } from 'react-i18next'; + + +const boxStyle = { + width: '100%', + height: '100vh', + borderRadius: 6, + border: '1px solid #40a9ff', +}; + +const justify = "center" +const alignItems = "center" + + function Login() { - const navigate = useNavigate(); + // const navigate = useNavigate(); + const [t] = useTranslation() + const [form] = Form.useForm(); function button_onclick() { - navigate('/home') + alert(form.getFieldValue('username')) + // navigate('/home') } + const onReset = () => { + form.resetFields(); + }; return ( +
+ + +
+ + + + + + + + + + + + + + + +
+
- +
) }