Add new phone select style

This commit is contained in:
Liam Cardenas 2018-01-21 11:29:48 -08:00
parent a34a61bce8
commit 3ac913a28e
3 changed files with 26 additions and 22 deletions

View file

@ -1,5 +1,6 @@
import React from 'react';
import { Form, FormRow, Submit } from 'component/form.js';
import FormField from 'component/formField';
class UserFieldNew extends React.PureComponent {
constructor(props) {
@ -71,27 +72,21 @@ class UserFieldNew extends React.PureComponent {
)}
</p>
<Form onSubmit={this.handleSubmit.bind(this)}>
<FormRow
type="text"
label="Country Code"
name="country_code"
value={this.state.country_code}
errorMessage={phoneErrorMessage}
onChange={event => {
this.handleChanged(event, 'country_code');
}}
/>
<FormRow
type="text"
label="Phone"
placeholder={this.state.country_code === '+1' ? '(555) 555-5555' : '5555555555'}
name="phone"
value={this.state.phone}
errorMessage={phoneErrorMessage}
onChange={event => {
this.handleChanged(event, 'phone');
}}
/>
<div className="form-row-phone">
<FormField type="select">
<option>(US) +1</option>
</FormField>
<FormRow
type="text"
placeholder={this.state.country_code === '+1' ? '(555) 555-5555' : '5555555555'}
name="phone"
value={this.state.phone}
errorMessage={phoneErrorMessage}
onChange={event => {
this.handleChanged(event, 'phone');
}}
/>
</div>
<div className="form-row-submit">
<Submit label="Submit" disabled={isPending} />
{cancelButton}

View file

@ -79,6 +79,7 @@ $text-color: #000;
/* Select */
--select-bg: var(--color-bg-alt);
--select-color: var(--text-color);
--select-height: 30px;
/* Button */
--button-bg: var(--color-bg-alt);

View file

@ -5,6 +5,14 @@
margin-bottom: $spacing-vertical;
}
.form-row-phone {
display: flex;
select {
margin-right: 5px;
}
}
.form-row__label-row {
margin-top: $spacing-vertical * 5/6;
margin-bottom: 0px;
@ -32,7 +40,7 @@
box-sizing: border-box;
padding-left: 5px;
padding-right: 5px;
height: $spacing-vertical;
height: var(--select-height);
background: var(--select-bg);
color: var(--select-color);
&:focus {