diff --git a/src/components/Button/index.tsx b/src/components/Button/index.tsx index 68f1aac41a5b..b6e20164348b 100644 --- a/src/components/Button/index.tsx +++ b/src/components/Button/index.tsx @@ -115,6 +115,9 @@ type ButtonProps = Partial & { /** Boolean whether to display the right icon */ shouldShowRightIcon?: boolean; + + /** Whether the button should use split style or not */ + isSplitButton?: boolean; }; type KeyboardShortcutComponentProps = Pick; @@ -198,6 +201,7 @@ function Button( id = '', accessibilityLabel = '', + isSplitButton = false, ...rest }: ButtonProps, ref: ForwardedRef, @@ -253,13 +257,22 @@ function Button( {shouldShowRightIcon && ( - + {!isSplitButton ? ( + + ) : ( + + )} )} diff --git a/src/components/ButtonWithDropdownMenu/index.tsx b/src/components/ButtonWithDropdownMenu/index.tsx index a4e6e2c87fec..a28b7ebf0864 100644 --- a/src/components/ButtonWithDropdownMenu/index.tsx +++ b/src/components/ButtonWithDropdownMenu/index.tsx @@ -14,6 +14,7 @@ import type {ButtonWithDropdownMenuProps} from './types'; function ButtonWithDropdownMenu({ success = false, + isSplitButton = true, isLoading = false, isDisabled = false, pressOnEnter = false, @@ -40,7 +41,7 @@ function ButtonWithDropdownMenu({ const [isMenuVisible, setIsMenuVisible] = useState(false); const [popoverAnchorPosition, setPopoverAnchorPosition] = useState(null); const {windowWidth, windowHeight} = useWindowDimensions(); - const caretButton = useRef(null); + const caretButton = useRef(null); const selectedItem = options[selectedItemIndex] || options[0]; const innerStyleDropButton = StyleUtils.getDropDownButtonHeight(buttonSize); const isButtonSizeLarge = buttonSize === CONST.DROPDOWN_BUTTON_SIZE.LARGE; @@ -64,7 +65,6 @@ function ButtonWithDropdownMenu({ }); } }, [windowWidth, windowHeight, isMenuVisible, anchorAlignment.vertical]); - return ( {shouldAlwaysShowDropdownMenu || options.length > 1 ? ( @@ -72,8 +72,10 @@ function ButtonWithDropdownMenu({ + + )} ) : (