/
skitchen
/
Portal
Обзор
Документация
Войти
/
skitchen
/
Portal
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/shared/ui/IconButton/IconButton.tsx
28 строк
759 B
Nikita Lavrentev
added react testing lib and tests for Button, SideBar
26 фев 2023, 20:57
26 фев 2023, 20:57
90fda2e
Код
Авторство
О чём код?
import { classNames } from 'shared/lib/classNames/classNames'; import React, { ButtonHTMLAttributes, FC } from 'react'; import cls from './IconButton.module.scss'; import { Size } from './types'; interface IProps extends ButtonHTMLAttributes<HTMLButtonElement> { className?: string size?: Size } export const IconButton: FC<IProps> = (props) => { const { className, children, size = 'small', ...othersProps } = props; return ( <button type="button" className={classNames(cls.root, { [cls.small]: size === 'small', [cls.large]: size === 'large', }, [className])} {...othersProps} > {children} </button> ); };