-
Notifications
You must be signed in to change notification settings - Fork 3k
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 #53845
Open
Krishna2323
wants to merge
25
commits into
Expensify:main
Choose a base branch
from
Krishna2323:krishna2323/issue/52164_pr2
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 22 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
7f40593
Provide education/confirmation before creating workspaces in New Work…
Krishna2323 ee98ccd
Provide education/confirmation before creating workspaces in New Work…
Krishna2323 3b47bb6
Merge branch 'Expensify:main' into krishna2323/issue/52164_pr2
Krishna2323 0125372
fix: Selected currecy does not appear selected with a green checkmark.
Krishna2323 50a5a5d
fix: Create workspace - Edit avatar modal is blocking the avatar.
Krishna2323 1863105
fix: Error message does not have left and right padding.
Krishna2323 3748621
add param names.
Krishna2323 59713aa
Merge branch 'Expensify:main' into krishna2323/issue/52164_pr2
Krishna2323 88960da
Merge branch 'Expensify:main' into krishna2323/issue/52164_pr2
Krishna2323 113f37b
Merge branch 'Expensify:main' into krishna2323/issue/52164_pr2
Krishna2323 1757ec8
crash fix.
Krishna2323 f08311b
Merge branch 'main' into krishna2323/issue/52164_pr2
Krishna2323 29dbf37
fix: file not cloned correctly.
Krishna2323 ec414be
fix eslint.
Krishna2323 60529a7
fix eslint.
Krishna2323 85bfaaf
minor fix.
Krishna2323 d9b1f64
Merge branch 'Expensify:main' into krishna2323/issue/52164_pr2
Krishna2323 4aba5aa
Merge branch 'Expensify:main' into krishna2323/issue/52164_pr2
Krishna2323 a7ccb88
fix file upload on native platforms.
Krishna2323 0e3cdef
Merge branch 'Expensify:main' into krishna2323/issue/52164_pr2
Krishna2323 21a213c
add backTo param in WORKSPACE_CONFIRMATION page.
Krishna2323 a322dc8
minor fix.
Krishna2323 4819755
add comments.
Krishna2323 8c78f70
minor update.
Krishna2323 4587fc4
Merge branch 'main' into krishna2323/issue/52164_pr2
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,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); |
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
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
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.
Update the copy as per #53753 (comment)
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.
I think this update can be made in this PR.
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.
Alright, thanks