From 1251485b2674184b04a4eafb5a414e15746991fe Mon Sep 17 00:00:00 2001 From: "Anton@habdevs" Date: Thu, 7 Sep 2023 21:39:28 +0500 Subject: [PATCH] feat: added custom button #190 --- components/LeftPanel/LeftPanel.tsx | 20 +++++++++---- .../shared/ui/CustomButton/CustomButton.tsx | 28 ++++++++++++++----- public/images/disputeIcon.svg | 5 ++++ 3 files changed, 41 insertions(+), 12 deletions(-) create mode 100644 public/images/disputeIcon.svg diff --git a/components/LeftPanel/LeftPanel.tsx b/components/LeftPanel/LeftPanel.tsx index e4e2399..fba442c 100644 --- a/components/LeftPanel/LeftPanel.tsx +++ b/components/LeftPanel/LeftPanel.tsx @@ -1,8 +1,10 @@ import { useTranslation } from 'react-i18next'; -import { Button, Players } from 'components'; +import { Button, CustomButton, Players } from 'components'; import { LeftPanelPropsI } from './LeftPanelProps'; import styles from './LeftPanel.module.scss'; -import React from "react"; +import React from 'react'; +import disputeIcon from 'public/images/disputeIcon.svg'; + export const LeftPanel: React.FC = ({ players, isDisputAvailable, @@ -21,13 +23,21 @@ export const LeftPanel: React.FC = ({
); diff --git a/components/shared/ui/CustomButton/CustomButton.tsx b/components/shared/ui/CustomButton/CustomButton.tsx index 9aa9bb0..dccc8b3 100644 --- a/components/shared/ui/CustomButton/CustomButton.tsx +++ b/components/shared/ui/CustomButton/CustomButton.tsx @@ -6,9 +6,15 @@ import Link from 'next/link'; export const CustomButton = (props: CustomButtonProps) => { const { size, color, radius, text, image, imagePosition, link, imageSize } = props; - const buttonClasses = cn(styles.button, styles[`size-${size}`], styles[`color-${color}`], styles[`radius-${radius}`], { - [styles['text-center']]: imagePosition === 'left' || imagePosition === 'right', - }); + const buttonClasses = cn( + styles.button, + styles[`size-${size}`], + styles[`color-${color}`], + styles[`radius-${radius}`], + { + [styles['text-center']]: imagePosition === 'left' || imagePosition === 'right', + }, + ); const imageStyles = { width: imageSize ? `${imageSize}px` : undefined, @@ -19,9 +25,13 @@ export const CustomButton = (props: CustomButtonProps) => { return ( - {imagePosition === 'left' && Button Image} + {imagePosition === 'left' && ( + Button Image + )} {text} - {imagePosition === 'right' && Button Image} + {imagePosition === 'right' && ( + Button Image + )} ); @@ -29,9 +39,13 @@ export const CustomButton = (props: CustomButtonProps) => { return ( ); }; diff --git a/public/images/disputeIcon.svg b/public/images/disputeIcon.svg new file mode 100644 index 0000000..30686a8 --- /dev/null +++ b/public/images/disputeIcon.svg @@ -0,0 +1,5 @@ + + + + +