Use react-icons

This commit is contained in:
Ken-Håvard Lieng 2020-04-29 03:10:13 +02:00
parent bb66740fd1
commit c704ebb042
13 changed files with 269 additions and 309 deletions

View file

@ -1,12 +1,19 @@
import React from 'react';
import cn from 'classnames';
const Button = ({ children, category, className, ...props }) => (
const Button = ({ children, category, className, icon: Icon, ...props }) => (
<button
className={cn(`button-${category}`, className)}
className={cn(
{
[`button-${category}`]: category,
'icon-button': Icon && !children
},
className
)}
type="button"
{...props}
>
{Icon && <Icon />}
{children}
</button>
);