From 423fe84afafaf71fd12d90538ccd71c0f3ad1dfa Mon Sep 17 00:00:00 2001 From: fazil-eigthfold Date: Fri, 19 Aug 2022 17:17:01 +0530 Subject: [PATCH] fix: added fix for split btn icon --- src/components/Button/Button.stories.tsx | 5 +++++ src/components/Button/SplitButton/SplitButton.tsx | 13 ++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/components/Button/Button.stories.tsx b/src/components/Button/Button.stories.tsx index e8c25a30b..ffd97aaa5 100644 --- a/src/components/Button/Button.stories.tsx +++ b/src/components/Button/Button.stories.tsx @@ -347,6 +347,11 @@ Split.args = { split: true, splitButtonChecked: false, text: 'Split Button', + splitButtonProps: { + iconProps: { + path: IconName.mdiClockOutline, + }, + }, }; Split_With_Counter.args = { diff --git a/src/components/Button/SplitButton/SplitButton.tsx b/src/components/Button/SplitButton/SplitButton.tsx index 539878e09..12bd63631 100644 --- a/src/components/Button/SplitButton/SplitButton.tsx +++ b/src/components/Button/SplitButton/SplitButton.tsx @@ -134,15 +134,18 @@ export const SplitButton: FC = React.forwardRef( return iconSize; }; + const getButtonIconPath = (): IconName => + iconProps?.path + ? iconProps.path + : checked + ? IconName.mdiChevronUp + : IconName.mdiChevronDown; + const getButtonIcon = (): JSX.Element => ( );