-
Notifications
You must be signed in to change notification settings - Fork 277
Jon/kav updates #5837
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
Jon/kav updates #5837
Conversation
01c402e to
8e66c8f
Compare
swansontec
left a 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.
A few cleanups, and an optional refactor.
| useEffect(() => { | ||
| const showListener = Keyboard.addListener( | ||
| isIos ? 'keyboardWillShow' : 'keyboardDidShow', | ||
| () => { | ||
| isClosingSv.value = false | ||
| } | ||
| ) | ||
| const hideListener = Keyboard.addListener( | ||
| isIos ? 'keyboardWillHide' : 'keyboardDidHide', | ||
| () => { | ||
| isClosingSv.value = true | ||
| } | ||
| ) | ||
| return () => { | ||
| showListener.remove() | ||
| hideListener.remove() | ||
| } | ||
| }, [isIos, isClosingSv]) |
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.
Seems like one effect could update both the boolean and the shared value?
| const collapsedInsetBottom = useMemo( | ||
| () => | ||
| safeAreaInsets.bottom + | ||
| (hasNotifications ? notificationHeight : 0) + | ||
| (hasTabs ? MAX_TAB_BAR_HEIGHT : 0) + | ||
| footerHeight, | ||
| [ | ||
| footerHeight, | ||
| hasNotifications, | ||
| hasTabs, | ||
| notificationHeight, | ||
| safeAreaInsets.bottom | ||
| ] | ||
| ) |
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.
Optional: The library https://github.com/kirillzyusko/react-native-keyboard-controller has a lot of this stuff baked in, including useKeyboardAnimation which gives a shared value linked to the height, and the good news is that we already use this library in our app. They also have keyboard-avoiding views, but I don't know if we can use those as-is because of the scene wrapper integration needs. Worth looking in to.
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.
These lines compute app insets (safe area bottom + notifications + tab bar + footer) which the react-native-keyboard-controller doesn't know about
|
Re: #5837 (comment) According to the |
Quote: I don't know if is an awesome name. I would call it or something like that.\nURL: #5837 (comment)
Quote: Seems like one effect could update both the boolean and the shared value?\nURL: #5837 (comment)
6d3ba6d to
0afff89
Compare
d262852 to
ebe58d5
Compare
f5d7adb to
31412c1
Compare
31412c1 to
5df37d9
Compare
- Avoids duplicate inset logic and having to set a sibling component at the callsite. - Also make it more generic in preparation for other button layouts.
5df37d9 to
4b97df8
Compare
CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
noneRequirements
If you have made any visual changes to the GUI. Make sure you have:
Note
Introduce a docked action bar via SceneWrapper and KavButtons, replace the old keyboard-accessory button, and update swap/ramp screens to show Cancel/Next during amount entry.
dockPropsto render a docked, keyboard-aware action bar with smooth iOS/Android handling.KavButtonscomponent for primary/tertiary actions; remove legacyKavButtonand dependency onreact-native-keyboard-accessory.SwapCreateScene: Use dockedKavButtons(shows Cancel + Next when editing amounts), addSceneButtonswhen keyboard closed; minor layout/padding adjustments.RampCreateScene,RampKycFormScene,FiatPluginEnterAmountScene: Migrate to dockedKavButtonsfor Next actions.SwapInput: Simplify API (remove returnKey handling; rely ononNext).SwapCreateScenesnapshots for layout changes.SwapCreateSceneduring amount edits.react-native-keyboard-accessory.Written by Cursor Bugbot for commit 4b97df8. This will update automatically on new commits. Configure here.