summaryrefslogtreecommitdiff
path: root/src/components/Button.tsx
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2021-03-14 01:38:55 +0300
committereug-vs <eug-vs@keemail.me>2021-03-14 01:38:55 +0300
commitcfb287490d353166cf0a3db7105d8002cc473f00 (patch)
tree779cdbd01757ac46b565422c32946e52213a4fcc /src/components/Button.tsx
parent05ccf76dbbb54e52ae81a469f91b3660057058dc (diff)
downloadcommercel-ui-cfb287490d353166cf0a3db7105d8002cc473f00.tar.gz
feat: add DataTable component
Diffstat (limited to 'src/components/Button.tsx')
-rw-r--r--src/components/Button.tsx15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/components/Button.tsx b/src/components/Button.tsx
index 5fd69b2..8f2398b 100644
--- a/src/components/Button.tsx
+++ b/src/components/Button.tsx
@@ -1,21 +1,28 @@
import React from 'react';
interface Props {
- variant?: 'contained' | 'outlined'
+ variant?: 'contained' | 'outlined';
+ size?: 'sm' | 'md' | 'lg';
children: string;
}
-const styles = {
+const variants = {
contained: 'bg-black text-white',
outlined: 'border-2 border-black',
};
-const Button: React.FC<Props> = ({ children, variant = 'contained' }) => {
+const sizes = {
+ lg: 'p-5',
+ md: 'p-4',
+ sm: 'p-3',
+};
+
+const Button: React.FC<Props> = ({ variant = 'contained', size = 'md', children }) => {
return (
<button
type="button"
- className={`p-4 m-3 font-bold tracking-wide hover:underline focus:outline-none ${styles[variant]}`}
+ className={`m-3 font-bold tracking-wide hover:underline focus:outline-none ${variants[variant]} ${sizes[size]}`}
>
{children}
</button>