mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-05-31 14:11:58 +05:30
Облагорожена вёрстка формы обратной связи.
Часть общих стилей вынесена в компонент Popup Образован базовый (прям ненастоящий) компонент Dropdown
This commit is contained in:
41
src/components/ui/form/Dropdown.jsx
Normal file
41
src/components/ui/form/Dropdown.jsx
Normal file
@@ -0,0 +1,41 @@
|
||||
import React, { PropTypes } from 'react';
|
||||
|
||||
import classNames from 'classnames';
|
||||
|
||||
import styles from 'components/ui/dropdown.scss';
|
||||
|
||||
import FormComponent from './FormComponent';
|
||||
|
||||
export default class Dropdown extends FormComponent {
|
||||
static displayName = 'Dropdown';
|
||||
|
||||
static propTypes = {
|
||||
label: PropTypes.oneOfType([
|
||||
PropTypes.shape({
|
||||
id: PropTypes.string
|
||||
}),
|
||||
PropTypes.string
|
||||
]).isRequired,
|
||||
block: PropTypes.bool,
|
||||
color: PropTypes.oneOf(['green', 'blue', 'red', 'lightViolet', 'darkBlue', 'violet'])
|
||||
};
|
||||
|
||||
render() {
|
||||
const { color = 'green', block } = this.props;
|
||||
|
||||
const props = {
|
||||
...this.props
|
||||
};
|
||||
|
||||
props.label = this.formatMessage(props.label);
|
||||
|
||||
return (
|
||||
<div className={classNames(styles[color], {
|
||||
[styles.block]: block
|
||||
})} {...props}>
|
||||
{props.label}
|
||||
<span className={styles.toggleIcon} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user