Removed Semantic UI React
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import React from 'react'
|
||||
import { Container } from 'semantic-ui-react'
|
||||
import { ProfileForm } from './ProfileForm'
|
||||
import { Constants, api } from '../helpers'
|
||||
import { WaitDialog, MessageDialog, ChangePasswordDialog, ProgressDialog, ChangeEmailDialog } from '../Dialog'
|
||||
@@ -147,7 +146,7 @@ export class Profile extends React.Component {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Container>
|
||||
<div>
|
||||
<ProfileForm
|
||||
user={this.state.user}
|
||||
onSaved={this.handleSaved}
|
||||
@@ -171,7 +170,7 @@ export class Profile extends React.Component {
|
||||
message={this.state.progressDialog ? this.state.progressDialog.message : ''}
|
||||
percent={this.state.uploadPercent}
|
||||
onCancel={this.handleUploadCancel} />
|
||||
</Container>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
import React from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import { Grid, Form, Image } from 'semantic-ui-react'
|
||||
import { StackLayout, Button } from '../ui'
|
||||
import { regExpPattern } from 'regexp-pattern'
|
||||
import './ProfileForm.scss'
|
||||
import { Constants } from '../helpers'
|
||||
import { FilePicker } from '../FilePicker'
|
||||
import { Validator, ValidatedInput, ValidatedDropdown, ValidatedButton, ValidatedDatePicker } from '../Validated'
|
||||
import { Validator, ValidatedInput, ValidatedButton } from '../Validated'
|
||||
|
||||
export class ProfileForm extends React.Component {
|
||||
static propTypes = {
|
||||
@@ -13,9 +10,7 @@ export class ProfileForm extends React.Component {
|
||||
onSaved: PropTypes.func.isRequired,
|
||||
onModifiedChanged: PropTypes.func,
|
||||
onChangePassword: PropTypes.func,
|
||||
onChangeEmail: PropTypes.func,
|
||||
onSelectImage: PropTypes.func,
|
||||
userImageUrl: PropTypes.string
|
||||
onChangeEmail: PropTypes.func
|
||||
}
|
||||
|
||||
static validations = {
|
||||
@@ -99,72 +94,32 @@ export class ProfileForm extends React.Component {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Form className='profile-form' onSubmit={this.handleSubmit}>
|
||||
<Grid stackable>
|
||||
<Grid.Column width={3}>
|
||||
<Image id='userImage' shape='circular' size='medium' src={this.props.userImageUrl} centered />
|
||||
<FilePicker validExtensions={['.jpg', '.jpeg', '.png']} content='Select Image' onFileSelect={this.props.onSelectImage} />
|
||||
</Grid.Column>
|
||||
|
||||
<Grid.Column width={13}>
|
||||
<Form.Group>
|
||||
<ValidatedInput label='First Name' name='firstName' width={8}
|
||||
validator={this.state.validator} />
|
||||
<ValidatedInput label='Last Name' name='lastName' width={8}
|
||||
validator={this.state.validator} />
|
||||
</Form.Group>
|
||||
|
||||
<Form.Group>
|
||||
<ValidatedInput label='Email' name='email' width={8} message='Required. Must be a valid email address.'
|
||||
validator={this.state.validator} />
|
||||
<Form.Button fluid content={'Change Email'} label=' '
|
||||
width={4} onClick={this.props.onChangeEmail} />
|
||||
<Form.Button fluid content={'Change Password'} label=' '
|
||||
width={4} onClick={this.props.onChangePassword} />
|
||||
</Form.Group>
|
||||
|
||||
<Form.Group>
|
||||
<ValidatedInput label='Zip' name='zip' width={4}
|
||||
validator={this.state.validator} message='5 Character U.S. Zip Code. Optional.' />
|
||||
<ValidatedDropdown label='State' name='state' width={6} message='Type or select a U.S. State or Province.'
|
||||
placeholder='Select State' options={Constants.stateOptions}
|
||||
validator={this.state.validator} searchable />
|
||||
<ValidatedInput label='City' name='city' width={6}
|
||||
validator={this.state.validator} message='U.S. City. Optional.' />
|
||||
</Form.Group>
|
||||
|
||||
<Form.Group>
|
||||
<ValidatedInput label='Address' name='address1' width={12}
|
||||
validator={this.state.validator} message='Primary Street Address. Optional.' />
|
||||
<ValidatedInput label='Apt. #' name='address2' width={4}
|
||||
validator={this.state.validator} message='Apartment/Unit number. Optional.' />
|
||||
</Form.Group>
|
||||
|
||||
<Form.Group>
|
||||
<ValidatedInput label='Home Phone' name='homePhone' width={8}
|
||||
validator={this.state.validator} message='A valid U.S. phone number. IE: (555)123-4567. Optional.' />
|
||||
<ValidatedInput label='Cell Phone' name='cellPhone' width={8}
|
||||
validator={this.state.validator} message='A valid U.S. phone number. IE: (555)123-4567. Optional.' />
|
||||
</Form.Group>
|
||||
|
||||
<Form.Group>
|
||||
<ValidatedDatePicker label='Date of Birth' name='dateOfBirth' width={5}
|
||||
validator={this.state.validator} message='Select a date.' />
|
||||
<ValidatedInput label='SSN' name='ssn' width={6}
|
||||
validator={this.state.validator} message='U.S. Social Security Number. IE: 123-45-6789' />
|
||||
<ValidatedDatePicker label='Hire Date' name='dateOfHire' width={5}
|
||||
validator={this.state.validator} message='Select a date.' />
|
||||
</Form.Group>
|
||||
|
||||
<Form.Group>
|
||||
<Form.Field width={12} />
|
||||
<ValidatedButton submit primary width={4} size='medium' content='Save' label=' ' name='save'
|
||||
validator={this.state.validator} />
|
||||
</Form.Group>
|
||||
|
||||
</Grid.Column>
|
||||
</Grid>
|
||||
</Form>
|
||||
<form className='profile-form' onSubmit={this.handleSubmit}>
|
||||
<StackLayout stackable>
|
||||
<StackLayout.Item>
|
||||
<ValidatedInput label='First Name' name='firstName' width={8}
|
||||
validator={this.state.validator} />
|
||||
</StackLayout.Item>
|
||||
<StackLayout.Item>
|
||||
<ValidatedInput label='Last Name' name='lastName' width={8}
|
||||
validator={this.state.validator} />
|
||||
</StackLayout.Item>
|
||||
<StackLayout.Item>
|
||||
<ValidatedInput label='Email' name='email' width={8} message='Required. Must be a valid email address.'
|
||||
validator={this.state.validator} />
|
||||
</StackLayout.Item>
|
||||
<StackLayout.Item>
|
||||
<Button fluid content={'Change Email'} label=' '
|
||||
width={4} onClick={this.props.onChangeEmail} />
|
||||
<Button fluid content={'Change Password'} label=' '
|
||||
width={4} onClick={this.props.onChangePassword} />
|
||||
</StackLayout.Item>
|
||||
<StackLayout.Item>
|
||||
<ValidatedButton submit primary width={4} size='medium' content='Save' label=' ' name='save'
|
||||
validator={this.state.validator} />
|
||||
</StackLayout.Item>
|
||||
</StackLayout>
|
||||
</form>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
.profile-form {
|
||||
text-align: left;
|
||||
margin: 3em auto 4em auto;
|
||||
}
|
||||
|
||||
.profile-form > .fields {
|
||||
margin-bottom: 1.5em !important;
|
||||
}
|
||||
|
||||
#userImage {
|
||||
margin-bottom: 2em;
|
||||
}
|
||||
Reference in New Issue
Block a user