From b5a48f564421a59a035344bb5e713804cfcb6309 Mon Sep 17 00:00:00 2001 From: Michael Arestad Date: Thu, 3 Aug 2023 14:57:31 -0600 Subject: [PATCH] Add chevron to ButtonAction --- src/components/ButtonAction.stories.tsx | 18 ++++++++++++++++++ src/components/ButtonAction.tsx | 17 +++++++++++++++-- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/components/ButtonAction.stories.tsx b/src/components/ButtonAction.stories.tsx index bf0bd7bc..24e4d793 100644 --- a/src/components/ButtonAction.stories.tsx +++ b/src/components/ButtonAction.stories.tsx @@ -43,6 +43,24 @@ export const WithLabelActive: Story = { }, }; +export const IconOnlyIsSelect: Story = { + args: { + children: '', + icon: 'starhollow', + isActive: false, + isSelect: true, + }, +}; + +export const WithLabelIsSelect: Story = { + args: { + children: 'Hello World', + icon: 'starhollow', + isActive: false, + isSelect: true, + }, +}; + export const IconOnlyWithTooltip: Story = { args: { icon: 'starhollow', diff --git a/src/components/ButtonAction.tsx b/src/components/ButtonAction.tsx index 248d698a..ea9cf6e3 100644 --- a/src/components/ButtonAction.tsx +++ b/src/components/ButtonAction.tsx @@ -10,11 +10,13 @@ interface ButtonActionProps { icon: IconType; children?: string; isActive?: boolean; + isSelect?: boolean; tooltip?: string; } interface ButtonStylingProps { isActive?: boolean; + isSelect?: boolean; } const StyledButton = styled.button` @@ -54,10 +56,20 @@ const StyledButton = styled.button` } `; +const Chevron = ( + + + +); + export const ButtonAction = ({ children, icon, isActive = false, + isSelect = false, tooltip, ...rest }: ButtonActionProps) => { @@ -69,16 +81,17 @@ export const ButtonAction = ({ delayShow={600} {...rest} > - + {icon && } {children} ); return ( - + {icon && } {children} + {isSelect ? Chevron : null} ); };