refactor: reviewer's comment

- use Preact's `FunctionalComponent` instead of React's `FC` to keep the app more lightweight
- remove `@node_modules/` from imports
This commit is contained in:
VardanHakobyan
2021-06-15 12:07:03 +04:00
parent 9092c670c8
commit adfef38bdc
10 changed files with 97 additions and 91 deletions

View File

@@ -14,6 +14,7 @@ import TrashSweepIcon from '../../icons/ic-trash-sweep.svg';
import MoreIcon from '../../icons/ic-more.svg';
import TuneIcon from '../../icons/ic-tune.svg';
import { toDirective } from './utils';
import { FunctionalComponent } from 'preact';
const ICONS = {
'pencil-off': PencilOffIcon,
@@ -38,7 +39,7 @@ type Props = {
className: string;
}
export const Icon: React.FC<Props> = ({ type, className }) => {
export const Icon: FunctionalComponent<Props> = ({ type, className }) => {
const IconComponent = ICONS[type];
return <IconComponent className={`sn-icon ${className}`} />;
};