1
0
Fork 0
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:
Fedor Katurov 2022-01-04 17:36:05 +07:00
parent 6e89271ea9
commit 811e14fd4c
29 changed files with 566 additions and 901 deletions
src/components/input/InputWrapper

View 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 };