-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Feature/35713 bulk actions #37199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/35713 bulk actions #37199
Changes from all commits
bc020b1
f8bcd09
6b01648
aab0b73
8d96108
a1c7b3c
a811d75
7480bc0
ce0a424
7afd58c
9a6be7a
65de55f
9afe006
bdddc57
9bab577
8440181
a4c37a2
335aa49
6440417
4ab2e7a
632b3a5
0a560d5
55ded25
631e8c1
70988c3
6ad10d8
563f835
8d62e93
7ffa14f
435ce36
ea05d00
debb91b
4289987
ea7df2d
6a34a5f
93000ab
7257a0f
cedc07f
91c8f0a
9da8e79
6d11560
b58d23c
212014e
255d895
226270d
ab0d2f4
dffefd6
bcd44e9
2229ce2
dc8b825
1a23c3d
78de600
5552628
7bc882c
a3f70d8
5d4509c
0060083
1ad8d37
c151114
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -315,7 +315,7 @@ function Button( | |
| large ? styles.buttonLarge : undefined, | ||
| success ? styles.buttonSuccess : undefined, | ||
| danger ? styles.buttonDanger : undefined, | ||
| isDisabled && (success || danger) ? styles.buttonOpacityDisabled : undefined, | ||
| isDisabled ? styles.buttonOpacityDisabled : undefined, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As this is general component, let's make sure that this doesn't cause any minor UI regression. Especially for the case of isDisabled = true, danger = true
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was asked by @shawnborton to adjust the buttons styles according to the most recent design (not sure if you have access to it) - to cut the story short no matter in which state is the button (default, success or danger) we should lower its opacity by 50% in case it is disabled. I don't think this change would have huge impact on the App functionality - I've clicked through the app and it seems everything is ok. Do you want something more from me here? |
||
| isDisabled && !danger && !success ? styles.buttonDisabled : undefined, | ||
| shouldRemoveRightBorderRadius ? styles.noRightBorderRadius : undefined, | ||
| shouldRemoveLeftBorderRadius ? styles.noLeftBorderRadius : undefined, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| import type {RefObject} from 'react'; | ||
| import type {GestureResponderEvent, StyleProp, View, ViewStyle} from 'react-native'; | ||
| import type {ValueOf} from 'type-fest'; | ||
| import type CONST from '@src/CONST'; | ||
| import type AnchorAlignment from '@src/types/utils/AnchorAlignment'; | ||
| import type DeepValueOf from '@src/types/utils/DeepValueOf'; | ||
| import type IconAsset from '@src/types/utils/IconAsset'; | ||
|
|
||
| type PaymentType = DeepValueOf<typeof CONST.IOU.PAYMENT_TYPE | typeof CONST.IOU.REPORT_ACTION_TYPE>; | ||
|
|
||
| type WorkspaceMemberBulkActionType = DeepValueOf<typeof CONST.POLICY.MEMBERS_BULK_ACTION_TYPES>; | ||
|
|
||
| type DropdownOption<TValueType> = { | ||
| value: TValueType; | ||
| text: string; | ||
| icon: IconAsset; | ||
| iconWidth?: number; | ||
| iconHeight?: number; | ||
| iconDescription?: string; | ||
| onSelected?: () => void; | ||
| }; | ||
|
|
||
| type ButtonWithDropdownMenuProps<TValueType> = { | ||
| /** The custom text to display on the main button instead of selected option */ | ||
| customText?: string; | ||
|
|
||
| /** Text to display for the menu header */ | ||
| menuHeaderText?: string; | ||
|
|
||
| /** Callback to execute when the main button is pressed */ | ||
| onPress: (event: GestureResponderEvent | KeyboardEvent | undefined, value: TValueType) => void; | ||
|
|
||
| /** Callback to execute when a dropdown option is selected */ | ||
| onOptionSelected?: (option: DropdownOption<TValueType>) => void; | ||
|
|
||
| /** Call the onPress function on main button when Enter key is pressed */ | ||
| pressOnEnter?: boolean; | ||
|
|
||
| /** Whether we should show a loading state for the main button */ | ||
| isLoading?: boolean; | ||
|
|
||
| /** The size of button size */ | ||
| buttonSize: ValueOf<typeof CONST.DROPDOWN_BUTTON_SIZE>; | ||
|
|
||
| /** Should the confirmation button be disabled? */ | ||
| isDisabled?: boolean; | ||
|
|
||
| /** Additional styles to add to the component */ | ||
| style?: StyleProp<ViewStyle>; | ||
|
|
||
| /** Menu options to display */ | ||
| /** e.g. [{text: 'Pay with Expensify', icon: Wallet}] */ | ||
| options: Array<DropdownOption<TValueType>>; | ||
|
|
||
| /** The anchor alignment of the popover menu */ | ||
| anchorAlignment?: AnchorAlignment; | ||
|
|
||
| /* ref for the button */ | ||
| buttonRef: RefObject<View>; | ||
|
|
||
| /** The priority to assign the enter key event listener to buttons. 0 is the highest priority. */ | ||
| enterKeyEventListenerPriority?: number; | ||
|
|
||
| /** Whether the button should use success style or not */ | ||
| success?: boolean; | ||
|
|
||
| /** Whether the dropdown menu should be shown even if it has only one option */ | ||
| shouldAlwaysShowDropdownMenu?: boolean; | ||
| }; | ||
|
|
||
| export type {PaymentType, WorkspaceMemberBulkActionType, DropdownOption, ButtonWithDropdownMenuProps}; |
Uh oh!
There was an error while loading. Please reload this page.