Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sdream-ai-fe
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
侯明涛
sdream-ai-fe
Commits
f7ff1644
Commit
f7ff1644
authored
Aug 08, 2024
by
HoMeTown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 完善登录
parent
dab9f5f8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
src/components/LoginModal/index.tsx
+13
-3
No files found.
src/components/LoginModal/index.tsx
View file @
f7ff1644
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
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment