-
Notifications
You must be signed in to change notification settings - Fork 637
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* new wallet switcher UI * dnd flatlist autoscrolling * fix layout/spacing issues * pinned wallet grid edit mode jiggle animation * add long press option and optional callback data to dropdown menu component * address context menu on long press, refactor context menu to use new dropdown component * add drag handler icon * selected wallet shadow, watching & hw wallet badge fixes * fix address label abbreviation & truncation * fix total owned wallet balance formatting * fix autoscrolling can scroll logic & add inset behavior * general purpose feature hint tooltip component * edit wallets hint tooltip * fix dnd provider gesture disabled toggle logic * add DraggableScrollView based on DraggableFlatList * fix gesture problems by switching to draggable scrollview * fixes for DnD children layout changes & draggable scrollview refactor * fix different account emoji in list vs pinned grid * dynamically size pinned account avatars * copy & settings dropdown menu options, fix account emoji size * localization * misc. styling fixes for light mode, android, design spec matching * update dropdown menu component to work for checkbox & regular items * tooltip localization * remove unused wallet item fields * auto pin addresses * refactor wallet list loading animation transition * autoscroll easing & scroll to end logic fix * fix remove pinned address logic * integrate auto-pin wallet feature with backend implementation * misc. DnD bug fixes, worklet haptic activation, and styling cleanup * fix dnd onUpdate logic, add onUpdateWorklet for haptic trigger on reorder * android button & padding fixes, grid layout jank fix * misc. cleanup * dnd: refactor offset update logic * delete unused component * move components to screen/components directory * migrate DraggableFlatList to use useDraggableScroll * update import, change max panel height * fix various shadows * fix shadow opacity, revert dnd offset drift fix for useDraggableScroll * fix tooltip zindex, add shadow * improve jiggle animation * minor adjustments * hide total balance display if user only has watched wallets * fix total balance NaN by fixing addDisplay utility, add new test for utility * custom spring config for wallet draggable return to origin * fix navigation param address type error * prevent auto pin from running multiple times, remove total balance text * add back testID to add wallet button to fix e2e * remove concept of per item activation delays in dnd, move logic to gesture onStart from onBegin * make grid wallets & other wallets gesture wait for each other to prevent ghost activations * remove unused code * undo changes to dropdown component for data type
- Loading branch information
Showing
46 changed files
with
2,789 additions
and
1,413 deletions.
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.