Procházet zdrojové kódy

Allow button to be customizable with styled components

jnfrati před 4 roky
rodič
revize
1f6cb4ca68
1 změnil soubory, kde provedl 8 přidání a 2 odebrání
  1. 8 2
      dashboard/src/components/Button.tsx

+ 8 - 2
dashboard/src/components/Button.tsx

@@ -5,11 +5,17 @@ interface Props {
   disabled?: boolean;
   children: React.ReactNode;
   onClick: () => void;
+  className?: string;
 }
 
-const Button: React.FC<Props> = ({ children, disabled, onClick }) => {
+const Button: React.FC<Props> = ({
+  children,
+  disabled,
+  onClick,
+  className,
+}) => {
   return (
-    <ButtonWrapper disabled={disabled} onClick={onClick}>
+    <ButtonWrapper className={className} disabled={disabled} onClick={onClick}>
       {children}
     </ButtonWrapper>
   );