Commit f7ff1644 by HoMeTown

feat: 完善登录

parent dab9f5f8
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'
interface LoginModalProps {
......@@ -10,6 +10,8 @@ interface LoginModalProps {
export const LoginModal: React.FC<LoginModalProps> = ({ isOpen, onClose }) => {
const { login } = useAuth()
const [isSelected, setIsSelected] = React.useState(false)
const handleLogin = () => {
login()
}
......@@ -19,7 +21,7 @@ export const LoginModal: React.FC<LoginModalProps> = ({ isOpen, onClose }) => {
{onClose => (
<>
<ModalHeader className="flex flex-col gap-1">欢迎您使用晓得AI助手</ModalHeader>
<ModalBody>
<ModalBody className="text-[#27353C]">
<p>
为帮助您更好了解晓得AI 助手服务内容,保障您的合法权益。
</p>
......@@ -32,12 +34,20 @@ export const LoginModal: React.FC<LoginModalProps> = ({ isOpen, onClose }) => {
<p>
您需在仔细阅读并确认同意相关协议后方可使用本服务。
</p>
<p>
<Checkbox
isSelected={isSelected}
onValueChange={setIsSelected}
>
我已阅读并同意
</Checkbox>
</p>
</ModalBody>
<ModalFooter>
<Button onPress={onClose}>
再想想
</Button>
<Button color="primary" onPress={handleLogin}>
<Button isDisabled={!isSelected} color="primary" onPress={handleLogin}>
同意
</Button>
</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