-
Notifications
You must be signed in to change notification settings - Fork 637
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
Merged
Merged
Wallet Switcher v2 #6318
Changes from all commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
778117b
new wallet switcher UI
maxbbb 74b4019
dnd flatlist autoscrolling
maxbbb 71d6b46
fix layout/spacing issues
maxbbb e8fc4f8
pinned wallet grid edit mode jiggle animation
maxbbb 2fa3f66
add long press option and optional callback data to dropdown menu com…
maxbbb 089a164
address context menu on long press, refactor context menu to use new …
maxbbb 4b8b989
add drag handler icon
maxbbb 63d9683
selected wallet shadow, watching & hw wallet badge fixes
maxbbb 54e2911
fix address label abbreviation & truncation
maxbbb 2339bd0
fix total owned wallet balance formatting
maxbbb b85e0c7
fix autoscrolling can scroll logic & add inset behavior
maxbbb 5134fcc
general purpose feature hint tooltip component
maxbbb a8ede2b
edit wallets hint tooltip
maxbbb 10faef3
fix dnd provider gesture disabled toggle logic
maxbbb f69dcdf
add DraggableScrollView based on DraggableFlatList
maxbbb 6455f0b
fix gesture problems by switching to draggable scrollview
maxbbb 6cb4663
fixes for DnD children layout changes & draggable scrollview refactor
maxbbb e1bfada
fix different account emoji in list vs pinned grid
maxbbb e8d706d
dynamically size pinned account avatars
maxbbb b384ec7
copy & settings dropdown menu options, fix account emoji size
maxbbb 8ed6aec
localization
maxbbb 120483c
misc. styling fixes for light mode, android, design spec matching
maxbbb ccbf096
update dropdown menu component to work for checkbox & regular items
maxbbb 8b63d33
tooltip localization
maxbbb 45c4b1a
remove unused wallet item fields
maxbbb 959b774
auto pin addresses
maxbbb 1ec4446
refactor wallet list loading animation transition
maxbbb d137c40
autoscroll easing & scroll to end logic fix
maxbbb 746b79b
fix remove pinned address logic
maxbbb b4c1691
integrate auto-pin wallet feature with backend implementation
maxbbb 41925ed
misc. DnD bug fixes, worklet haptic activation, and styling cleanup
maxbbb 50b5e04
fix dnd onUpdate logic, add onUpdateWorklet for haptic trigger on reo…
maxbbb dd774e2
android button & padding fixes, grid layout jank fix
maxbbb 0b778ef
misc. cleanup
maxbbb aa75d33
Merge develop into @kane/APP-2081
maxbbb b116d1a
dnd: refactor offset update logic
maxbbb 1ffd763
delete unused component
maxbbb 2d582fa
move components to screen/components directory
maxbbb af1e1b6
migrate DraggableFlatList to use useDraggableScroll
maxbbb ff44d3e
update import, change max panel height
maxbbb 174f57d
fix various shadows
maxbbb dbf1131
fix shadow opacity, revert dnd offset drift fix for useDraggableScroll
maxbbb f4017fe
fix tooltip zindex, add shadow
maxbbb 76470ff
improve jiggle animation
maxbbb b713e71
Merge branch 'develop' into @kane/APP-2081
maxbbb 69ca2b4
minor adjustments
maxbbb 69bc587
hide total balance display if user only has watched wallets
maxbbb f445acd
fix total balance NaN by fixing addDisplay utility, add new test for …
maxbbb 3e9572e
custom spring config for wallet draggable return to origin
maxbbb b3a9702
fix navigation param address type error
maxbbb a3b285b
Merge branch 'develop' into @kane/APP-2081
maxbbb c534b4a
prevent auto pin from running multiple times, remove total balance text
maxbbb 90bd1e7
Merge remote-tracking branch 'origin/develop' into @kane/APP-2081
maxbbb e6a8307
add back testID to add wallet button to fix e2e
maxbbb 286b901
remove concept of per item activation delays in dnd, move logic to ge…
maxbbb 9f71e17
make grid wallets & other wallets gesture wait for each other to prev…
maxbbb 3fe3ed8
remove unused code
maxbbb 0bbdd5c
undo changes to dropdown component for data type
maxbbb 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import React, { useEffect } from 'react'; | ||
import Animated, { | ||
useSharedValue, | ||
useAnimatedStyle, | ||
withTiming, | ||
withRepeat, | ||
cancelAnimation, | ||
useAnimatedReaction, | ||
SharedValue, | ||
withSequence, | ||
} from 'react-native-reanimated'; | ||
|
||
type JiggleAnimationProps = { | ||
amplitude?: number; | ||
duration?: number; | ||
children: React.ReactNode; | ||
enabled: boolean | SharedValue<boolean>; | ||
}; | ||
|
||
export function JiggleAnimation({ children, amplitude = 2, duration = 125, enabled }: JiggleAnimationProps) { | ||
const rotation = useSharedValue(0); | ||
const internalEnabled = useSharedValue(typeof enabled === 'boolean' ? enabled : false); | ||
|
||
// Randomize some initial values to avoid sync with other jiggles | ||
// Randomize duration (5% variance) | ||
const instanceDuration = duration * (1 + (Math.random() - 0.5) * 0.1); | ||
|
||
// Randomize initial rotation that's at least 50% of the amplitude | ||
const minInitialRotation = amplitude * 0.5; | ||
const rotationRange = amplitude - minInitialRotation; | ||
const initialRotation = minInitialRotation + Math.random() * rotationRange; | ||
|
||
// Randomize initial direction | ||
const initialDirection = Math.random() < 0.5 ? -1 : 1; | ||
const firstRotation = initialRotation * initialDirection; | ||
|
||
useEffect(() => { | ||
if (typeof enabled === 'boolean') { | ||
internalEnabled.value = enabled; | ||
} | ||
}, [enabled, internalEnabled]); | ||
|
||
useAnimatedReaction( | ||
() => { | ||
return typeof enabled === 'boolean' ? internalEnabled.value : (enabled as SharedValue<boolean>).value; | ||
}, | ||
enabled => { | ||
if (enabled) { | ||
rotation.value = withSequence( | ||
withTiming(firstRotation, { duration: instanceDuration / 2 }), | ||
withRepeat(withTiming(-amplitude * initialDirection, { duration: instanceDuration }), -1, true) | ||
); | ||
} else { | ||
cancelAnimation(rotation); | ||
rotation.value = withTiming(0, { duration: instanceDuration / 2 }); | ||
} | ||
} | ||
); | ||
|
||
const animatedStyle = useAnimatedStyle(() => { | ||
return { | ||
transform: [{ rotate: `${rotation.value}deg` }], | ||
}; | ||
}); | ||
|
||
return <Animated.View style={animatedStyle}>{children}</Animated.View>; | ||
} |
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.
I'm actually not sure we ever need to use the bare
DropdownMenuItem
. Can't we optimistically assume it's aDropdownMenuCheckboxItem
and just not show the checkmark by settingvalue={undefined}
? Unsure, but worth trying if it simplifies thisThere 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 forDropdownMenuCheckboxItem
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 theDropdownMenuCheckboxItem
orDropdownMenuItem