-
Notifications
You must be signed in to change notification settings - Fork 635
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
Wallet Switcher v2 #6318
base: develop
Are you sure you want to change the base?
Wallet Switcher v2 #6318
Conversation
…dropdown component
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.
this is some great work. Noticed a couple things while messing around with it. Some are nitpicks, only one major issue I saw.
if (data !== undefined) { | ||
(onPressMenuItem as (actionKey: T, data: U) => void)(actionKey, data); | ||
} else { | ||
(onPressMenuItem as (actionKey: T) => void)(actionKey); | ||
} |
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.
nice 💯
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.
Great animation! Unrelated to this PR, but just popped into my head. We should come up with a strategy for reducing animations when a user has Accessibility > Reduced Motion toggled to on.
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 believe reanimated handles the reduced motion system setting by default: https://docs.swmansion.com/react-native-reanimated/docs/guides/accessibility/
const MenuItemComponent = menuItemType === 'checkbox' ? DropdownMenuCheckboxItem : DropdownMenuItem; | ||
|
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'm actually not sure we ever need to use the bare DropdownMenuItem
. Can't we optimistically assume it's a DropdownMenuCheckboxItem
and just not show the checkmark by setting value={undefined}
? Unsure, but worth trying if it simplifies this
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.
On Android an empty checkbox gets automatically added when using the DropdownMenuCheckboxItem
. The value prop is required for DropdownMenuCheckboxItem
and can't be set to undefined. I could change it to assume undefined value types should use the other component, but I don't think there is a way tot get around needing to conditionally use the DropdownMenuCheckboxItem
or DropdownMenuItem
return ( | ||
<Animated.ScrollView | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
{...props} | ||
/> | ||
); | ||
}} | ||
viewabilityConfig={{ itemVisiblePercentThreshold: 50 }} | ||
// viewabilityConfig={{ itemVisiblePercentThreshold: 50 }} |
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.
commented out on purpose?
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.
Yeah this component actually isn't used at all, and if you wanted to use it with the viewability exposed properly there would need to be some more work so just commented out to better indicate that
#nitpick but the snapping back to origin seems slow to me and the spring seems spongy. |
|
Fixes APP-2081
Spec: https://www.notion.so/135b001b85b4808cae11f62380e8fc5c
What changed (plus any additional context for devs)
DraggableScrollView
and theuseDraggableScroll
hook that handles auto scrolling when dragging items at the visible edge of the scroll.DraggableGrid
to fix bug related to offsets drifting when interacting too quickly with different draggable items. This fix needs to also be applied to theDraggableScrollView
but it would currently break auto scrollingChangeWalletSheet
,WalletList
, andAddressRow
PinnedWalletsGrid
for the grid of up to 6 pinned wallets.pinnedWalletsStore
DropdownMenu
component to be usable for non checkmark type itemsFeatureHintTooltip
for general feature hints, API loosely based on Radix Tooltip component.Review Notes
ChangeWalletSheet
related to removing, editing, etc. a wallet did not change.Known Issues
Potential follow up improvements
AddressRow
layout transitions can be smoothly animatedDndProvider
currently does some custom handling of the pan gesture starting, which it should not. This is the source of some issues where pressing on the item gives haptic feedback indicating its ready to drag but it cannot be dragged because the gesture actually failed.Screen recordings / screenshots
RPReplay_Final1734630484.MP4
What to test