-
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
Render banner in Concierge chat #11363
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
755f2f8
add onyxkey and banner
luacmartins 8fc52a5
add shouldShowIcon prop to Banner
luacmartins 6eac3e0
add close button
luacmartins 07da526
add comment
luacmartins dd00d29
add Pressable
luacmartins 977a7e4
add view for styles
luacmartins eb04d82
add styles
luacmartins e8409b7
add callbacks
luacmartins 680ada2
add copy translations
luacmartins 20fd092
add conditional
luacmartins bfef037
rm pressable, add styles
luacmartins 281bd48
update copy
luacmartins 01638f8
add logic to keep drawer closed
luacmartins f953a4c
add comments on navigator changes
luacmartins 07fa556
resolve conflicts
luacmartins 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
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 |
---|---|---|
|
@@ -102,16 +102,23 @@ function pushDrawerRoute(route) { | |
const screenRoute = {type: 'route', name: newScreenName}; | ||
const history = _.map(state.history ? [...state.history] : [screenRoute], () => screenRoute); | ||
|
||
// Force drawer to close | ||
// https://github.com/react-navigation/react-navigation/blob/94ab791cae5061455f036cd3f6bc7fa63167e7c7/packages/routers/src/DrawerRouter.tsx#L142 | ||
const hasDrawerhistory = _.find(state.history || [], h => h.type === 'drawer'); | ||
if (!hasDrawerhistory || currentState.type !== 'drawer') { | ||
const drawerHistoryItem = _.find(state.history || [], h => h.type === 'drawer'); | ||
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. More context about the changes in |
||
const isDrawerClosed = drawerHistoryItem && drawerHistoryItem.status === 'closed'; | ||
if (!drawerHistoryItem || currentState.type !== 'drawer') { | ||
// Add the drawer item to the navigation history to control if the drawer should be in open or closed state | ||
history.push({ | ||
type: 'drawer', | ||
|
||
// If current state is not from drawer navigator then always use closed status to close the drawer | ||
// If current state is not from drawer navigator then always force the drawer to close by using closed status | ||
// https://github.com/react-navigation/react-navigation/blob/94ab791cae5061455f036cd3f6bc7fa63167e7c7/packages/routers/src/DrawerRouter.tsx#L142 | ||
status: currentState.type !== 'drawer' || currentState.default === 'open' ? 'closed' : 'open', | ||
}); | ||
} else if (isDrawerClosed) { | ||
// Keep the drawer closed if it's already closed | ||
history.push({ | ||
type: 'drawer', | ||
status: 'closed', | ||
}); | ||
} | ||
|
||
return CommonActions.reset({ | ||
|
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.
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.
Hey, just noting that we should have used flexWrap to prevent text overflow on native.
#42373 (comment)