Commit f7ff1644 by HoMeTown

feat: 完善登录

parent dab9f5f8
import React from 'react' import React from 'react'
import { Button, Link, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader } from '@nextui-org/react' import { Button, Checkbox, Link, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader } from '@nextui-org/react'
import { useAuth } from '@/auth/AuthContext' import { useAuth } from '@/auth/AuthContext'
interface LoginModalProps { interface LoginModalProps {
...@@ -10,6 +10,8 @@ interface LoginModalProps { ...@@ -10,6 +10,8 @@ interface LoginModalProps {
export const LoginModal: React.FC<LoginModalProps> = ({ isOpen, onClose }) => { export const LoginModal: React.FC<LoginModalProps> = ({ isOpen, onClose }) => {
const { login } = useAuth() const { login } = useAuth()
const [isSelected, setIsSelected] = React.useState(false)
const handleLogin = () => { const handleLogin = () => {
login() login()
} }
...@@ -19,7 +21,7 @@ export const LoginModal: React.FC<LoginModalProps> = ({ isOpen, onClose }) => { ...@@ -19,7 +21,7 @@ export const LoginModal: React.FC<LoginModalProps> = ({ isOpen, onClose }) => {
{onClose => ( {onClose => (
<> <>
<ModalHeader className="flex flex-col gap-1">欢迎您使用晓得AI助手</ModalHeader> <ModalHeader className="flex flex-col gap-1">欢迎您使用晓得AI助手</ModalHeader>
<ModalBody> <ModalBody className="text-[#27353C]">
<p> <p>
为帮助您更好了解晓得AI 助手服务内容,保障您的合法权益。 为帮助您更好了解晓得AI 助手服务内容,保障您的合法权益。
</p> </p>
...@@ -32,12 +34,20 @@ export const LoginModal: React.FC<LoginModalProps> = ({ isOpen, onClose }) => { ...@@ -32,12 +34,20 @@ export const LoginModal: React.FC<LoginModalProps> = ({ isOpen, onClose }) => {
<p> <p>
您需在仔细阅读并确认同意相关协议后方可使用本服务。 您需在仔细阅读并确认同意相关协议后方可使用本服务。
</p> </p>
<p>
<Checkbox
isSelected={isSelected}
onValueChange={setIsSelected}
>
我已阅读并同意
</Checkbox>
</p>
</ModalBody> </ModalBody>
<ModalFooter> <ModalFooter>
<Button onPress={onClose}> <Button onPress={onClose}>
再想想 再想想
</Button> </Button>
<Button color="primary" onPress={handleLogin}> <Button isDisabled={!isSelected} color="primary" onPress={handleLogin}>
同意 同意
</Button> </Button>
</ModalFooter> </ModalFooter>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment