Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scratch-www
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
scratch-www
Commits
c4d7ba03
Commit
c4d7ba03
authored
Jul 31, 2019
by
Ben Wheeler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed naming of user-provided radio input from other to custom
parent
8725cee6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
15 deletions
+18
-15
src/components/formik-forms/formik-radio-button.jsx
src/components/formik-forms/formik-radio-button.jsx
+8
-8
src/components/join-flow/gender-step.jsx
src/components/join-flow/gender-step.jsx
+10
-7
No files found.
src/components/formik-forms/formik-radio-button.jsx
View file @
c4d7ba03
...
...
@@ -65,9 +65,9 @@ FormikRadioButtonSubComponent.propTypes = {
const
FormikRadioButton
=
({
buttonValue
,
className
,
is
Other
,
is
CustomInput
,
label
,
onSet
Other
,
onSet
Custom
,
...
props
})
=>
(
<
Field
...
...
@@ -76,18 +76,18 @@ const FormikRadioButton = ({
component=
{
FormikRadioButtonSubComponent
}
id=
"radioOption1"
label=
{
label
}
labelClassName=
{
is
Other
?
'
formik-radio-label-other
'
:
''
}
labelClassName=
{
is
CustomInput
?
'
formik-radio-label-other
'
:
''
}
{
...
props
}
>
{
is
Other
&&
(
{
is
CustomInput
&&
(
<
FormikInput
className=
"formik-radio-input"
id=
"other"
name=
"other"
wrapperClassName=
"formik-radio-input-wrapper"
/* eslint-disable react/jsx-no-bind */
onChange=
{
event
=>
onSet
Other
(
event
.
target
.
value
)
}
onFocus=
{
event
=>
onSet
Other
(
event
.
target
.
value
)
}
onChange=
{
event
=>
onSet
Custom
(
event
.
target
.
value
)
}
onFocus=
{
event
=>
onSet
Custom
(
event
.
target
.
value
)
}
/* eslint-enable react/jsx-no-bind */
/>
)
}
...
...
@@ -97,9 +97,9 @@ const FormikRadioButton = ({
FormikRadioButton
.
propTypes
=
{
buttonValue
:
PropTypes
.
string
,
className
:
PropTypes
.
string
,
is
Other
:
PropTypes
.
bool
,
is
CustomInput
:
PropTypes
.
bool
,
label
:
PropTypes
.
string
,
onSet
Other
:
PropTypes
.
func
,
onSet
Custom
:
PropTypes
.
func
,
value
:
PropTypes
.
oneOfType
([
PropTypes
.
number
,
PropTypes
.
string
])
};
...
...
src/components/join-flow/gender-step.jsx
View file @
c4d7ba03
...
...
@@ -58,7 +58,7 @@ class GenderStep extends React.Component {
if
(
!
formData
.
gender
||
formData
.
gender
===
'
null
'
)
{
formData
.
gender
=
'
Prefer not to say
'
;
}
delete
formData
.
other
;
delete
formData
.
custom
;
this
.
props
.
onNextStep
(
formData
);
}
render
()
{
...
...
@@ -66,7 +66,7 @@ class GenderStep extends React.Component {
<
Formik
initialValues=
{
{
gender
:
'
null
'
,
other
:
''
custom
:
''
}
}
onSubmit=
{
this
.
handleValidSubmit
}
>
...
...
@@ -104,22 +104,25 @@ class GenderStep extends React.Component {
'
row
'
,
'
row-inline
'
,
'
gender-radio-row
'
,
{
'
gender-radio-row-selected
'
:
(
values
.
gender
===
values
.
other
)}
{
'
gender-radio-row-selected
'
:
(
values
.
gender
===
values
.
custom
)}
)
}
/* eslint-disable react/jsx-no-bind */
onClick=
{
()
=>
setFieldValue
(
'
gender
'
,
values
.
other
,
false
)
}
onClick=
{
()
=>
setFieldValue
(
'
gender
'
,
values
.
custom
,
false
)
}
/* eslint-enable react/jsx-no-bind */
>
<
FormikRadioButton
is
Other
buttonValue=
{
values
.
other
}
is
CustomInput
buttonValue=
{
values
.
custom
}
className=
{
classNames
(
'
join-flow-radio
'
)
}
label=
{
this
.
props
.
intl
.
formatMessage
({
id
:
'
registration.genderOptionAnother
'
})
}
name=
"gender"
/* eslint-disable react/jsx-no-bind */
onSetOther=
{
newOtherVal
=>
setValues
({
gender
:
newOtherVal
,
other
:
newOtherVal
})
}
onSetCustom=
{
newCustomVal
=>
setValues
({
gender
:
newCustomVal
,
custom
:
newCustomVal
})
}
/* eslint-enable react/jsx-no-bind */
/>
</
div
>
...
...
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