mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
refactor main components and IProps
This commit is contained in:
parent
85a182c053
commit
efbaf13151
124 changed files with 235 additions and 256 deletions
|
@ -4,8 +4,8 @@ import classNames from 'classnames';
|
|||
|
||||
import styles from './styles.module.scss';
|
||||
|
||||
type IProps = HTMLAttributes<HTMLDivElement> & {};
|
||||
type Props = HTMLAttributes<HTMLDivElement> & {};
|
||||
|
||||
export const ButtonGroup = ({ children, className }: IProps) => (
|
||||
export const ButtonGroup = ({ children, className }: Props) => (
|
||||
<div className={classNames(styles.wrap, className)}>{children}</div>
|
||||
);
|
||||
|
|
|
@ -16,7 +16,7 @@ import { useForwardRef } from '~/hooks/dom/useForwardRef';
|
|||
|
||||
import styles from './styles.module.scss';
|
||||
|
||||
type IProps = DetailedHTMLProps<
|
||||
type Props = DetailedHTMLProps<
|
||||
TextareaHTMLAttributes<HTMLTextAreaElement>,
|
||||
HTMLTextAreaElement
|
||||
> & {
|
||||
|
@ -29,7 +29,7 @@ type IProps = DetailedHTMLProps<
|
|||
title?: string;
|
||||
};
|
||||
|
||||
const Textarea = forwardRef<HTMLTextAreaElement, IProps>(
|
||||
const Textarea = forwardRef<HTMLTextAreaElement, Props>(
|
||||
(
|
||||
{
|
||||
placeholder,
|
||||
|
|
|
@ -8,13 +8,13 @@ import styles from './styles.module.scss';
|
|||
|
||||
type ToggleColor = 'primary' | 'secondary' | 'lab' | 'danger' | 'white';
|
||||
|
||||
type IProps = Omit<ButtonProps, 'value' | 'color'> & {
|
||||
type Props = Omit<ButtonProps, 'value' | 'color'> & {
|
||||
value?: boolean;
|
||||
handler?: (val: boolean) => void;
|
||||
color?: ToggleColor;
|
||||
};
|
||||
|
||||
const Toggle: FC<IProps> = ({ value, handler, color = 'primary', ...rest }) => {
|
||||
const Toggle: FC<Props> = ({ value, handler, color = 'primary', ...rest }) => {
|
||||
const onClick = useCallback(() => {
|
||||
if (!handler) {
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue