1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

comment form

This commit is contained in:
muerwre 2019-08-27 21:33:46 +07:00
parent 9531edcd19
commit 1990783fa3
9 changed files with 67 additions and 33 deletions

View file

@ -42,6 +42,11 @@
flex: 1;
}
&:global(.disabled) {
touch-action: none;
pointer-events: none;
}
&:hover {
opacity: 1;

View file

@ -6,6 +6,8 @@ import React, {
useLayoutEffect,
useRef,
useState,
HTMLAttributes,
TextareaHTMLAttributes,
} from 'react';
import { getStyle } from '~/utils/dom';
import classNames from 'classnames';
@ -13,7 +15,7 @@ import classNames from 'classnames';
import * as styles from '~/styles/inputs.scss';
import { Icon } from '../Icon';
interface IProps {
type IProps = TextareaHTMLAttributes<HTMLTextAreaElement> & {
value: string;
placeholder?: string;
rows?: number;
@ -24,7 +26,7 @@ interface IProps {
required?: boolean;
status?: 'error' | 'success' | '';
title?: string;
}
};
const Textarea = memo<IProps>(
({
@ -37,6 +39,7 @@ const Textarea = memo<IProps>(
required = false,
title = '',
status = '',
...props
}) => {
const [rows, setRows] = useState(minRows || 1);
const [focused, setFocused] = useState(false);
@ -99,6 +102,7 @@ const Textarea = memo<IProps>(
ref={textarea}
onFocus={onFocus}
onBlur={onBlur}
{...props}
/>
</div>