Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
account-app
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bo-Chun Chen
account-app
Commits
e159f1d8
Commit
e159f1d8
authored
3 years ago
by
Bo-Chun Chen
Browse files
Options
Downloads
Patches
Plain Diff
Add Aup checkbox to the form
parent
6d403b88
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
react/src/components/Main.jsx
+13
-2
13 additions, 2 deletions
react/src/components/Main.jsx
with
13 additions
and
2 deletions
react/src/components/Main.jsx
+
13
−
2
View file @
e159f1d8
...
...
@@ -22,6 +22,7 @@ function Main(props) {
const
[
validated
,
setValidated
]
=
useState
(
false
);
const
[
modalTitle
,
setModalTitle
]
=
useState
(
"
Your account request has been submitted.
"
);
const
[
modalBody
,
setModalBody
]
=
useState
(<
Spinner
animation
=
"border"
variant
=
"success"
/>);
const
[
aup
,
setAup
]
=
useState
(
false
);
// Setup refs for easy access
const
socketRef
=
useRef
(
null
);
...
...
@@ -32,6 +33,9 @@ function Main(props) {
// Define functions
const
hideModal
=
()
=>
setIsLoading
(
false
);
const
showModal
=
()
=>
setIsLoading
(
true
);
const
handleAup
=
(
e
)
=>
{
setAup
(
!
aup
)
}
const
handleSubmit
=
(
e
)
=>
{
e
.
preventDefault
();
...
...
@@ -46,7 +50,8 @@ function Main(props) {
'
username
'
:
username
,
'
firstName
'
:
firstName
.
current
.
value
,
'
lastName
'
:
lastName
.
current
.
value
,
'
reason
'
:
reason
.
current
.
value
'
reason
'
:
reason
.
current
.
value
,
'
aup
'
:
aup
});
}
}
...
...
@@ -124,8 +129,14 @@ function Main(props) {
<
Form
.
Label
>
Reason
</
Form
.
Label
>
<
Form
.
Control
ref
=
{
reason
}
type
=
"text"
placeholder
=
"Reason"
/>
</
Form
.
Group
>
<
Form
.
Group
controlId
=
"formAUP"
>
<
Form
.
Check
onClick
=
{
handleAup
}
type
=
"checkbox"
label
=
"Agree to proceed"
/>
<
Form
.
Control
.
Feedback
type
=
"invalid"
>
Required
</
Form
.
Control
.
Feedback
>
</
Form
.
Group
>
<
Form
.
Group
controlId
=
"formReason"
>
<
Button
variant
=
"success"
type
=
"submit"
>
<
Button
disabled
=
{
!
aup
}
variant
=
"success"
type
=
"submit"
>
Submit
</
Button
>
</
Form
.
Group
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment