mirror of
				https://github.com/elyby/accounts-frontend.git
				synced 2025-05-31 14:11:58 +05:30 
			
		
		
		
	В Input добавлена поддержка center поля
This commit is contained in:
		| @@ -39,7 +39,7 @@ export default class ActivationBody extends BaseAuthBody { | ||||
|                 <div className={styles.formRow}> | ||||
|                     <Input {...this.bindField('key')} | ||||
|                         color="blue" | ||||
|                         style={{textAlign: 'center'}} | ||||
|                         center | ||||
|                         required | ||||
|                         value={key} | ||||
|                         readOnly={!!key} | ||||
|   | ||||
| @@ -47,7 +47,7 @@ export default class RecoverPasswordBody extends BaseAuthBody { | ||||
|  | ||||
|                 <Input {...this.bindField('key')} | ||||
|                     color="lightViolet" | ||||
|                     style={{textAlign: 'center'}} // ну это уже низко | ||||
|                     center | ||||
|                     required | ||||
|                     value={key} | ||||
|                     readOnly={!!key} | ||||
|   | ||||
| @@ -28,7 +28,8 @@ export default class Input extends FormInputComponent { | ||||
|         error: PropTypes.string, | ||||
|         icon: PropTypes.string, | ||||
|         skin: PropTypes.oneOf(skins), | ||||
|         color: PropTypes.oneOf(colors) | ||||
|         color: PropTypes.oneOf(colors), | ||||
|         center: PropTypes.bool | ||||
|     }; | ||||
|  | ||||
|     static defaultProps = { | ||||
| @@ -37,7 +38,7 @@ export default class Input extends FormInputComponent { | ||||
|     }; | ||||
|  | ||||
|     render() { | ||||
|         const { color, skin } = this.props; | ||||
|         const { color, skin, center } = this.props; | ||||
|         let { icon, label } = this.props; | ||||
|  | ||||
|         const props = { | ||||
| @@ -65,7 +66,7 @@ export default class Input extends FormInputComponent { | ||||
|         if (icon) { | ||||
|             baseClass = styles.formIconRow; | ||||
|             icon = ( | ||||
|                 <div className={classNames(styles.textFieldIcon, icons[icon])} /> | ||||
|                 <span className={classNames(styles.textFieldIcon, icons[icon])} /> | ||||
|             ); | ||||
|         } | ||||
|  | ||||
| @@ -76,7 +77,10 @@ export default class Input extends FormInputComponent { | ||||
|                     <input ref={this.setEl} | ||||
|                         className={classNames( | ||||
|                             styles[`${skin}TextField`], | ||||
|                             styles[`${color}TextField`] | ||||
|                             styles[`${color}TextField`], | ||||
|                             { | ||||
|                                 [styles.textFieldCenter]: center | ||||
|                             } | ||||
|                         )} | ||||
|                         {...props} | ||||
|                     /> | ||||
|   | ||||
| @@ -164,6 +164,10 @@ | ||||
|     position: relative; | ||||
| } | ||||
|  | ||||
| .textFieldCenter { | ||||
|     text-align: center; | ||||
| } | ||||
|  | ||||
| @include input-theme('green', $green); | ||||
| @include input-theme('blue', $blue); | ||||
| @include input-theme('red', $red); | ||||
| @@ -171,7 +175,6 @@ | ||||
| @include input-theme('lightViolet', $light_violet); | ||||
| @include input-theme('violet', $violet); | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Checkbox | ||||
|  */ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user