-
Notifications
You must be signed in to change notification settings - Fork 3.7k
feat: Provide education/confirmation before creating workspaces in New Workspace flows #53845
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
Changes from all commits
7f40593
ee98ccd
3b47bb6
0125372
50a5a5d
1863105
3748621
59713aa
88960da
113f37b
1757ec8
f08311b
29dbf37
ec414be
60529a7
85bfaaf
d9b1f64
4aba5aa
a7ccb88
0e3cdef
21a213c
a322dc8
4819755
8c78f70
4587fc4
16cdfec
6f404c1
efea90a
79507ab
f8518cb
2756030
0035877
29a5b3f
6465ce1
5a23b84
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 |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| import React, {forwardRef, useState} from 'react'; | ||
| import type {ForwardedRef} from 'react'; | ||
| import {View} from 'react-native'; | ||
| import useLocalize from '@hooks/useLocalize'; | ||
| import useStyleUtils from '@hooks/useStyleUtils'; | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
| import variables from '@styles/variables'; | ||
| import CONST from '@src/CONST'; | ||
| import CurrencySelectionListWithOnyx from './CurrencySelectionList'; | ||
| import HeaderWithBackButton from './HeaderWithBackButton'; | ||
| import MenuItemWithTopDescription from './MenuItemWithTopDescription'; | ||
| import Modal from './Modal'; | ||
| import ScreenWrapper from './ScreenWrapper'; | ||
| import type {ValuePickerItem, ValuePickerProps} from './ValuePicker/types'; | ||
|
|
||
| type CurrencyPickerProps = { | ||
| selectedCurrency?: string; | ||
| }; | ||
| function CurrencyPicker({selectedCurrency, label = '', errorText = '', value, onInputChange, furtherDetails}: ValuePickerProps & CurrencyPickerProps, forwardedRef: ForwardedRef<View>) { | ||
| const StyleUtils = useStyleUtils(); | ||
| const styles = useThemeStyles(); | ||
| const [isPickerVisible, setIsPickerVisible] = useState(false); | ||
| const {translate} = useLocalize(); | ||
|
|
||
| const showPickerModal = () => { | ||
| setIsPickerVisible(true); | ||
| }; | ||
|
|
||
| const hidePickerModal = () => { | ||
| setIsPickerVisible(false); | ||
| }; | ||
|
|
||
| const updateInput = (item: ValuePickerItem) => { | ||
| if (item.value !== selectedCurrency) { | ||
| onInputChange?.(item.value); | ||
| } | ||
| hidePickerModal(); | ||
| }; | ||
|
|
||
| const descStyle = !selectedCurrency || selectedCurrency.length === 0 ? StyleUtils.getFontSizeStyle(variables.fontSizeLabel) : null; | ||
|
|
||
| return ( | ||
| <View> | ||
| <MenuItemWithTopDescription | ||
| ref={forwardedRef} | ||
| shouldShowRightIcon | ||
| // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing | ||
| title={value || ''} | ||
| descriptionTextStyle={descStyle} | ||
| description={label} | ||
| onPress={showPickerModal} | ||
| furtherDetails={furtherDetails} | ||
| brickRoadIndicator={errorText ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined} | ||
| errorText={errorText} | ||
| /> | ||
|
|
||
| <Modal | ||
| type={CONST.MODAL.MODAL_TYPE.RIGHT_DOCKED} | ||
| isVisible={isPickerVisible} | ||
| onClose={() => hidePickerModal} | ||
| onModalHide={hidePickerModal} | ||
| hideModalContentWhileAnimating | ||
| useNativeDriver | ||
| onBackdropPress={hidePickerModal} | ||
| > | ||
| <ScreenWrapper | ||
| style={styles.pb0} | ||
| includePaddingTop={false} | ||
| includeSafeAreaPaddingBottom={false} | ||
| testID={label} | ||
| > | ||
| <HeaderWithBackButton | ||
| title={label} | ||
| onBackButtonPress={hidePickerModal} | ||
| /> | ||
| <CurrencySelectionListWithOnyx | ||
| onSelect={(item) => updateInput({value: item.currencyCode})} | ||
| searchInputLabel={translate('common.currency')} | ||
| initiallySelectedCurrencyCode={selectedCurrency} | ||
| /> | ||
| </ScreenWrapper> | ||
| </Modal> | ||
| </View> | ||
| ); | ||
| } | ||
|
|
||
| CurrencyPicker.displayName = 'CurrencyPicker'; | ||
|
|
||
| export default forwardRef(CurrencyPicker); | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -3804,7 +3804,7 @@ const translations = { | |||||
| }, | ||||||
| emptyWorkspace: { | ||||||
| title: 'Create a workspace', | ||||||
| subtitle: 'Create a workspace to track receipts, reimburse expenses, send invoices, and more -- all at the speed of chat.', | ||||||
| subtitle: 'Create a workspace to track receipts, reimburse expenses, send invoices, and more — all at the speed of chat.', | ||||||
|
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.
Suggested change
Update the copy as per #53753 (comment)
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 think this update can be made in this PR.
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. Alright, thanks
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. @shubham1206agra can you make sure you include this in the above PR |
||||||
| createAWorkspaceCTA: 'Get Started', | ||||||
| features: { | ||||||
| trackAndCollect: 'Track and collect receipts', | ||||||
|
|
@@ -3822,6 +3822,7 @@ const translations = { | |||||
| new: { | ||||||
| newWorkspace: 'New workspace', | ||||||
| getTheExpensifyCardAndMore: 'Get the Expensify Card and more', | ||||||
| confirmWorkspace: 'Confirm Workspace', | ||||||
| }, | ||||||
| people: { | ||||||
| genericFailureMessage: 'An error occurred removing a member from the workspace, please try again.', | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We forgot to add shouldHandleNavigationBack here which caused #57513