From 2f2c4dead5298ee4b35a0853768a4575133bdcec Mon Sep 17 00:00:00 2001 From: andres alcocer Date: Fri, 23 Dec 2022 18:23:17 -0500 Subject: [PATCH] converted mute/un-mute button to use Button component --- src/components/Button/Button.tsx | 17 ++++++++++++++--- src/components/Header.tsx | 20 +++++++------------- src/static/images/mute.svg | 2 +- src/static/images/unmute.svg | 2 +- src/static/sass/layout/_header.scss | 17 +---------------- 5 files changed, 24 insertions(+), 34 deletions(-) diff --git a/src/components/Button/Button.tsx b/src/components/Button/Button.tsx index d37a1d9..40495d3 100644 --- a/src/components/Button/Button.tsx +++ b/src/components/Button/Button.tsx @@ -9,13 +9,20 @@ export enum ButtonType { } interface IButton { + buttonType: ButtonType label?: string onClick?: () => void - buttonType: ButtonType Icon?: JSX.Element + customClassName?: string } -const Button = ({ label, onClick, buttonType, Icon }: IButton) => { +const Button = ({ + label, + onClick, + buttonType, + Icon, + customClassName, +}: IButton) => { const getIconClassName = (): '' | ' with-icon' => { return Icon ? ' with-icon' : '' } @@ -28,9 +35,13 @@ const Button = ({ label, onClick, buttonType, Icon }: IButton) => { return ButtonType[buttonType ? buttonType : ButtonType.Primary] } + const getCustomClassName = (): string => { + return customClassName ? ` ${customClassName}` : '' + } + return (