Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
account-app
Manage
Activity
Members
Labels
Plan
Issues
9
Issue boards
Milestones
Wiki
Code
Merge requests
4
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
rc
account-app
Commits
caf1d22d
You need to sign in or sign up before continuing.
Commit
caf1d22d
authored
3 years ago
by
Bo-Chun Chen
Browse files
Options
Downloads
Patches
Plain Diff
Add Aup checkbox to the form
parent
d7fa8a0a
No related branches found
No related tags found
1 merge request
!16
WIP: Feat React frontend
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 @
caf1d22d
...
@@ -22,6 +22,7 @@ function Main(props) {
...
@@ -22,6 +22,7 @@ function Main(props) {
const
[
validated
,
setValidated
]
=
useState
(
false
);
const
[
validated
,
setValidated
]
=
useState
(
false
);
const
[
modalTitle
,
setModalTitle
]
=
useState
(
"
Your account request has been submitted.
"
);
const
[
modalTitle
,
setModalTitle
]
=
useState
(
"
Your account request has been submitted.
"
);
const
[
modalBody
,
setModalBody
]
=
useState
(<
Spinner
animation
=
"border"
variant
=
"success"
/>);
const
[
modalBody
,
setModalBody
]
=
useState
(<
Spinner
animation
=
"border"
variant
=
"success"
/>);
const
[
aup
,
setAup
]
=
useState
(
false
);
// Setup refs for easy access
// Setup refs for easy access
const
socketRef
=
useRef
(
null
);
const
socketRef
=
useRef
(
null
);
...
@@ -32,6 +33,9 @@ function Main(props) {
...
@@ -32,6 +33,9 @@ function Main(props) {
// Define functions
// Define functions
const
hideModal
=
()
=>
setIsLoading
(
false
);
const
hideModal
=
()
=>
setIsLoading
(
false
);
const
showModal
=
()
=>
setIsLoading
(
true
);
const
showModal
=
()
=>
setIsLoading
(
true
);
const
handleAup
=
(
e
)
=>
{
setAup
(
!
aup
)
}
const
handleSubmit
=
(
e
)
=>
{
const
handleSubmit
=
(
e
)
=>
{
e
.
preventDefault
();
e
.
preventDefault
();
...
@@ -46,7 +50,8 @@ function Main(props) {
...
@@ -46,7 +50,8 @@ function Main(props) {
'
username
'
:
username
,
'
username
'
:
username
,
'
firstName
'
:
firstName
.
current
.
value
,
'
firstName
'
:
firstName
.
current
.
value
,
'
lastName
'
:
lastName
.
current
.
value
,
'
lastName
'
:
lastName
.
current
.
value
,
'
reason
'
:
reason
.
current
.
value
'
reason
'
:
reason
.
current
.
value
,
'
aup
'
:
aup
});
});
}
}
}
}
...
@@ -124,8 +129,14 @@ function Main(props) {
...
@@ -124,8 +129,14 @@ function Main(props) {
<
Form
.
Label
>
Reason
</
Form
.
Label
>
<
Form
.
Label
>
Reason
</
Form
.
Label
>
<
Form
.
Control
ref
=
{
reason
}
type
=
"text"
placeholder
=
"Reason"
/>
<
Form
.
Control
ref
=
{
reason
}
type
=
"text"
placeholder
=
"Reason"
/>
</
Form
.
Group
>
</
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"
>
<
Form
.
Group
controlId
=
"formReason"
>
<
Button
variant
=
"success"
type
=
"submit"
>
<
Button
disabled
=
{
!
aup
}
variant
=
"success"
type
=
"submit"
>
Submit
Submit
</
Button
>
</
Button
>
</
Form
.
Group
>
</
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