From a3061f8340dd36c33671d500a935da58d65b2597 Mon Sep 17 00:00:00 2001 From: dani Date: Thu, 10 Mar 2022 15:39:34 +0100 Subject: [PATCH] feat: Add transparent button, without hover effect --- src/components/Button/Button.styles.ts | 11 +++++++++-- src/components/Button/Button.tsx | 2 ++ src/components/Button/styles/inititalStyles.ts | 18 ++++++++++++------ src/components/Button/types.ts | 5 +++++ 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/components/Button/Button.styles.ts b/src/components/Button/Button.styles.ts index bd6d3b5b9..fa0d8dd6c 100644 --- a/src/components/Button/Button.styles.ts +++ b/src/components/Button/Button.styles.ts @@ -1,7 +1,11 @@ import styled from 'styled-components'; import type { ButtonProps } from './types'; - -import { initialStyles, isLoadingMode } from './styles/inititalStyles'; +import { + hoverEffect, + initialStyles, + isLoadingMode, + transparent, +} from './styles/inititalStyles'; import { primary, regular, @@ -32,6 +36,7 @@ type TStyleProps = Pick< | 'isFullWidth' | 'isLoading' | 'radius' + | 'isTransparent' >; const getThemeStyles = (theme: string) => { @@ -113,4 +118,6 @@ export const ButtonStyled = styled.button` ${(p) => p.isLoading && isLoadingMode} ${(p) => p.radius && `border-radius: ${p.radius}px`} + + ${(p) => (p.isTransparent ? transparent : hoverEffect)} `; diff --git a/src/components/Button/Button.tsx b/src/components/Button/Button.tsx index 1f25aff64..1d5d0772f 100644 --- a/src/components/Button/Button.tsx +++ b/src/components/Button/Button.tsx @@ -20,9 +20,11 @@ const Button: React.FC = ({ type = 'button', loadingProps, radius, + isTransparent = false, }: ButtonProps) => { return (