@@ -4,9 +4,6 @@ import Dialog from "@material-ui/core/Dialog";
4
4
import DialogActions from "@material-ui/core/DialogActions" ;
5
5
import DialogContent from "@material-ui/core/DialogContent" ;
6
6
import DialogTitle from "@material-ui/core/DialogTitle" ;
7
- import InputLabel from "@material-ui/core/InputLabel" ;
8
- import MenuItem from "@material-ui/core/MenuItem" ;
9
- import Select from "@material-ui/core/Select" ;
10
7
import { css , StyleSheet } from "aphrodite" ;
11
8
import PropTypes from "prop-types" ;
12
9
import queryString from "query-string" ;
@@ -170,15 +167,6 @@ class UserEdit extends React.Component {
170
167
this . setState ( { changePasswordDialog : false , successDialog : false } ) ;
171
168
} ;
172
169
173
- handleNotificationFrequencyChange = ( event ) => {
174
- const newFrequency = event . target . value ;
175
- const user = {
176
- ...this . state . user ,
177
- notificationFrequency : newFrequency
178
- } ;
179
- this . setState ( { user } ) ;
180
- } ;
181
-
182
170
openSuccessDialog = ( ) => this . setState ( { successDialog : true } ) ;
183
171
184
172
buildFormSchema = ( authType ) => {
@@ -297,27 +285,18 @@ class UserEdit extends React.Component {
297
285
name = "cell"
298
286
{ ...dataTest ( "cell" ) }
299
287
/>
300
- < div style = { { marginTop : 20 } } >
301
- < InputLabel
302
- style = { { marginBottom : 15 } }
303
- id = "notification-frequency-label"
304
- >
305
- Notification Frequency
306
- </ InputLabel >
307
- < Select
308
- id = "notification-frequency"
309
- labelId = "notification-frequency-label"
310
- name = "notificationFrequency"
311
- value = { user . notificationFrequency }
312
- onChange = { this . handleNotificationFrequencyChange }
313
- >
314
- { Object . values ( NotificationFrequencyType ) . map ( ( option ) => (
315
- < MenuItem key = { option } value = { option } >
316
- { titleCase ( option ) }
317
- </ MenuItem >
318
- ) ) }
319
- </ Select >
320
- </ div >
288
+ < SpokeFormField
289
+ label = "Notification Frequency"
290
+ name = "notificationFrequency"
291
+ { ...dataTest ( "notificationFrequency" ) }
292
+ type = "select"
293
+ choices = { Object . values ( NotificationFrequencyType ) . map (
294
+ ( option ) => ( {
295
+ value : option ,
296
+ label : titleCase ( option )
297
+ } )
298
+ ) }
299
+ />
321
300
</ span >
322
301
) }
323
302
{ ( authType === UserEditMode . Login ||
0 commit comments