mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-30 23:26:40 +07:00
fixed inputs
This commit is contained in:
parent
6e89271ea9
commit
811e14fd4c
29 changed files with 566 additions and 901 deletions
src/components/input/InputWrapper
26
src/components/input/InputWrapper/index.tsx
Normal file
26
src/components/input/InputWrapper/index.tsx
Normal file
|
@ -0,0 +1,26 @@
|
|||
import React, { FC } from 'react';
|
||||
import styles from './styles.module.scss';
|
||||
import classNames from 'classnames';
|
||||
|
||||
interface InputWrapperProps {
|
||||
title?: string;
|
||||
error?: string;
|
||||
focused: boolean;
|
||||
notEmpty: boolean;
|
||||
}
|
||||
|
||||
const InputWrapper: FC<InputWrapperProps> = ({ children, notEmpty, title, focused, error }) => (
|
||||
<div
|
||||
className={classNames(styles.content, {
|
||||
[styles.has_error]: !!error,
|
||||
[styles.focused]: focused,
|
||||
[styles.not_empty]: notEmpty,
|
||||
})}
|
||||
>
|
||||
{!!title && <div className={styles.title}>{title}</div>}
|
||||
{children}
|
||||
{!!error && <div className={styles.error}>{error}</div>}
|
||||
</div>
|
||||
);
|
||||
|
||||
export { InputWrapper };
|
Loading…
Add table
Add a link
Reference in a new issue