Skip to content

Commit d82eb37

Browse files
committed
Revert medium deletion on DropdownButton to align with batch 9 migration rules
1 parent ca8c4c9 commit d82eb37

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/components/Search/FilterDropdowns/DropdownButton.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ type DropdownButtonProps = WithSentryLabel &
2929
/** The selected value(s) if any */
3030
value: string | string[] | null;
3131

32+
/** Whether to use medium size button instead of small */
33+
medium?: boolean;
34+
3235
/** Button inner styles */
3336
innerStyles?: StyleProp<ViewStyle>;
3437

@@ -40,7 +43,7 @@ type DropdownButtonProps = WithSentryLabel &
4043
onClosePress?: () => void;
4144
};
4245

43-
function DropdownButton({label, value, labelStyle, innerStyles, caretWrapperStyle, sentryLabel, onClosePress, ...props}: DropdownButtonProps) {
46+
function DropdownButton({label, value, medium = false, labelStyle, innerStyles, caretWrapperStyle, sentryLabel, onClosePress, ...props}: DropdownButtonProps) {
4447
const styles = useThemeStyles();
4548
const theme = useTheme();
4649
const icons = useMemoizedLazyExpensifyIcons(['Close']);
@@ -70,7 +73,7 @@ function DropdownButton({label, value, labelStyle, innerStyles, caretWrapperStyl
7073
style={styles.flexShrink1}
7174
innerStyles={[
7275
// Restores the size padding: there is no `Button.Text` child here to contribute its `ph1`.
73-
styles.ph3,
76+
medium ? styles.ph4 : styles.ph3,
7477
isExpanded && styles.buttonHoveredBG,
7578
{maxWidth: variables.filterPillMaxWidth},
7679
styles.flexShrink1,
@@ -80,11 +83,13 @@ function DropdownButton({label, value, labelStyle, innerStyles, caretWrapperStyl
8083
onPress={onPress}
8184
sentryLabel={sentryLabel}
8285
removeBorderRadius={shouldShowCloseButton ? CONST.BUTTON_REMOVE_BORDER_RADIUS.RIGHT : undefined}
83-
size={CONST.BUTTON_SIZE.SMALL}
86+
size={medium ? CONST.BUTTON_SIZE.MEDIUM : CONST.BUTTON_SIZE.SMALL}
8487
>
8588
<CaretWrapper
8689
// flexShrink1 replaces old flex1 is necessary so a long label truncates instead of widening the pill.
8790
style={[styles.flexShrink1, styles.mw100, caretWrapperStyle]}
91+
caretWidth={medium ? variables.iconSizeSmall : variables.iconSizeExtraSmall}
92+
caretHeight={medium ? variables.iconSizeSmall : variables.iconSizeExtraSmall}
8893
isActive={isExpanded}
8994
>
9095
<Text

0 commit comments

Comments
 (0)