Skip to content

Commit

Permalink
Merge pull request #3 from AmberEngine/select-modal
Browse files Browse the repository at this point in the history
Select modal
  • Loading branch information
joellanciaux committed Oct 31, 2017
2 parents a1186dc + 9107f0e commit cb70b0b
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/components/SelectModal/SelectModal.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.formWrapper {
display: flex;
flex-direction: column;
}

.submitButton {
align-self: center;
justify-self: center;
}
52 changes: 52 additions & 0 deletions src/components/SelectModal/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import React, { Component } from 'react';

import { Form, FormGroup, Fields, Submit } from '../Form';
import Modal from '../Modal';
import { required } from '../Form/Validation';

import stylesheet from './SelectModal.scss';

class SelectModal extends Component {
render() {
const {
onSubmit,
options,
toggleModal,
visible,
label,
title,
name
} = this.props;

return (
<Modal
isOpen={visible}
onClose={toggleModal}
label={label}
className={stylesheet.modalContainer}
>
<Form
onSubmit={onSubmit}
className={stylesheet.formWrapper}
>
<FormGroup
title={title}
name={name}
className="form-control"
validate={[required]}
FieldComponent={Fields.ValidatedDropDownField}
options={options}
/>
<Submit
type="submit"
className={stylesheet.submitButton}
>
SUBMIT
</Submit>
</Form>
</Modal>
);
}
}

export default SelectModal;
1 change: 1 addition & 0 deletions src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export IconButton from './IconButton';
export Modal from './Modal';
export Pagination from './Pagination';
export RoundRectangle from './RoundRectangle';
export SelectModal from './SelectModal';
export SquareSelect from './SquareSelect';
export * as Table from './Table';

Expand Down

0 comments on commit cb70b0b

Please sign in to comment.