-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
feat: Provide education/confirmation before creating workspaces in New Workspace flows #52164
Open
Krishna2323
wants to merge
18
commits into
Expensify:main
Choose a base branch
from
Krishna2323:krishna2323/issue/51504
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
02d6985
fix: Provide education/confirmation before creating workspaces in New…
Krishna2323 96a77e8
minor updates.
Krishna2323 4945d1d
Merge branch 'Expensify:main' into krishna2323/issue/51504
Krishna2323 f283a18
updated ONYXKEYS file.
Krishna2323 d442d2f
minor updates.
Krishna2323 ecb779c
Merge branch 'main' into krishna2323/issue/51504
Krishna2323 d0f4880
fix lint issues.
Krishna2323 cf5608e
Merge branch 'Expensify:main' into krishna2323/issue/51504
Krishna2323 53d7650
add file and currency parameter.
Krishna2323 57cdb7e
minor update.
Krishna2323 dda2aed
Merge branch 'Expensify:main' into krishna2323/issue/51504
Krishna2323 b471f61
Merge branch 'main' into krishna2323/issue/51504
Krishna2323 7677be8
minor update.
Krishna2323 0249a28
fix: ESLint check.
Krishna2323 5c0405e
fix native crash.
Krishna2323 e426f86
update mask image for avatar picker.
Krishna2323 77d31cd
fix avatar flickering issue.
Krishna2323 5774b63
Merge branch 'main' into krishna2323/issue/51504
Krishna2323 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import React, {forwardRef, useState} from 'react'; | ||
import type {ForwardedRef} from 'react'; | ||
import {View} from 'react-native'; | ||
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 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 ?? 'TEST'} | ||
> | ||
<HeaderWithBackButton | ||
title={label} | ||
onBackButtonPress={hidePickerModal} | ||
/> | ||
<CurrencySelectionListWithOnyx | ||
onSelect={(item) => updateInput({value: item.currencyCode})} | ||
searchInputLabel="Currency" | ||
initiallySelectedCurrencyCode={selectedCurrency} | ||
/> | ||
</ScreenWrapper> | ||
</Modal> | ||
</View> | ||
); | ||
} | ||
|
||
CurrencyPicker.displayName = 'CurrencyPicker'; | ||
|
||
export default forwardRef(CurrencyPicker); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -91,6 +91,7 @@ function RightModalNavigator({navigation, route}: RightModalNavigatorProps) { | |||
name={SCREENS.RIGHT_MODAL.REPORT_DETAILS} | ||||
component={ModalStackNavigators.ReportDetailsModalStackNavigator} | ||||
/> | ||||
|
||||
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
|
||||
<Stack.Screen | ||||
name={SCREENS.RIGHT_MODAL.REPORT_SETTINGS} | ||||
component={ModalStackNavigators.ReportSettingsModalStackNavigator} | ||||
|
@@ -127,6 +128,10 @@ function RightModalNavigator({navigation, route}: RightModalNavigatorProps) { | |||
name={SCREENS.RIGHT_MODAL.MONEY_REQUEST} | ||||
component={ModalStackNavigators.MoneyRequestModalStackNavigator} | ||||
/> | ||||
<Stack.Screen | ||||
name={SCREENS.RIGHT_MODAL.WORKSPACE_CONFIRMATION} | ||||
component={ModalStackNavigators.WorkspaceConfirmationModalStackNavigator} | ||||
/> | ||||
<Stack.Screen | ||||
name={SCREENS.RIGHT_MODAL.NEW_TASK} | ||||
component={ModalStackNavigators.NewTaskModalStackNavigator} | ||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Please make this one optional, you have made this param as optional in the util function or vice versa