From b018754e29fbe2a82cbc9465be8d9760cfe0d8aa Mon Sep 17 00:00:00 2001 From: MTG2000 Date: Thu, 5 May 2022 12:38:20 +0300 Subject: [PATCH] fix: wrapping link around button --- src/Components/Button/Button.tsx | 45 +++++++++++++++++++++----------- src/styles/scrollbar.scss | 2 +- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/src/Components/Button/Button.tsx b/src/Components/Button/Button.tsx index 89fe78a..a8c8a05 100644 --- a/src/Components/Button/Button.tsx +++ b/src/Components/Button/Button.tsx @@ -1,6 +1,6 @@ -import { ComponentProps, ReactNode } from 'react'; -import { wrapLink } from 'src/utils/hoc'; +import { ReactNode } from 'react'; import { UnionToObjectKeys } from 'src/utils/types/utils'; +import { Link } from 'react-router-dom' // import Loading from '../Loading/Loading'; interface Props { @@ -86,22 +86,37 @@ export default function Button({ color = 'white', const handleClick = () => { if (isLoading && disableOnLoading) return; if (onClick) onClick(); + } + if (href) + if (newTab) + return + {children} + + else + return + {children} + + return ( - wrapLink( - - , href, { - newTab - }) + ) + } diff --git a/src/styles/scrollbar.scss b/src/styles/scrollbar.scss index ccc4c8d..8b27405 100644 --- a/src/styles/scrollbar.scss +++ b/src/styles/scrollbar.scss @@ -13,7 +13,7 @@ /* Track */ ::-webkit-scrollbar-track { - background: inherit; + background: #e5e5e5; } /* Handle */