This repository was archived by the owner on Mar 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/routes/CreateNewTeam/components/EditRoleForm Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ const Error = ({ name }) => {
30
30
} ;
31
31
32
32
function EditRoleForm ( { onChange, role } ) {
33
- const [ startMonthVisible , setStartMonthVisible ] = useState ( false ) ;
34
33
const onRoleChange = ( state ) => {
35
34
if ( state . hasValidationErrors ) {
36
35
onChange ( false ) ;
@@ -121,9 +120,9 @@ function EditRoleForm({ onChange, role }) {
121
120
< Error name = "durationWeeks" />
122
121
</ td >
123
122
< td >
124
- { startMonthVisible ? (
123
+ { role . startMonth ? (
125
124
< >
126
- < Field name = "startMonth" initialValue = { Date . now ( ) } >
125
+ < Field name = "startMonth" initialValue = { role . startMonth } >
127
126
{ ( props ) => (
128
127
< MonthPicker
129
128
name = { props . input . name }
@@ -143,7 +142,9 @@ function EditRoleForm({ onChange, role }) {
143
142
< div styleName = "flex-container" >
144
143
< button
145
144
styleName = "toggle-button"
146
- onClick = { ( ) => setStartMonthVisible ( true ) }
145
+ onClick = { ( ) =>
146
+ onRoleChange ( { values : { startMonth : Date . now ( ) } } )
147
+ }
147
148
>
148
149
Add Start Month
149
150
</ button >
You can’t perform that action at this time.
0 commit comments