Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui/profile: added '+' as input adornment to phone field for contact method #263

Merged
merged 2 commits into from
Dec 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions web/src/app/users/UserContactMethodForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Grid from '@material-ui/core/Grid'
import TextField from '@material-ui/core/TextField'
import { FormContainer, FormField } from '../forms'
import { MenuItem, Typography } from '@material-ui/core'
import InputAdornment from '@material-ui/core/InputAdornment'

export default class UserContactMethodForm extends React.PureComponent {
static propTypes = {
Expand Down Expand Up @@ -40,7 +41,6 @@ export default class UserContactMethodForm extends React.PureComponent {
if (!val) {
return ''
}

return '+' + val
}
return (
Expand All @@ -64,14 +64,22 @@ export default class UserContactMethodForm extends React.PureComponent {
</Grid>
<Grid item xs={12}>
<FormField
placeholder='+11235550123'
placeholder='11235550123'
aria-labelledby='countryCodeIndicator'
fullWidth
name='value'
required
label='Phone Number'
type='tel'
InputProps={{
startAdornment: (
<InputAdornment style={{ marginBottom: '0.1em' }}>
+
</InputAdornment>
),
}}
component={TextField}
mapValue={val => val.replace(/^\+/, '')}
mapOnChangeValue={cleanValue}
disabled={this.props.edit}
/>
Expand Down