-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: minimize preferences freeze (#31)
* reduce picker scroll animation duration to minimize #29 occurrences * only show main FAB on beers tab
- Loading branch information
Showing
7 changed files
with
46 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react' | ||
import Animated from 'react-native-reanimated' | ||
import { useTimingTransition } from 'react-native-redash/lib/module/v1' | ||
|
||
import { ZoomProps } from './types' | ||
|
||
export const Zoom: React.FC<ZoomProps> = ({ show, maxZoomOut = 0.01, delay = 0, style, ...rest }) => { | ||
const node = useTimingTransition(show ? 1 : maxZoomOut, { duration: 200, delay }) | ||
|
||
return ( | ||
<Animated.View style={[{ transform: [{ scale: node }] }, style]} {...rest} /> | ||
) | ||
} |
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,10 @@ | ||
import { ViewProps } from 'react-native' | ||
|
||
export interface ZoomProps extends ViewProps { | ||
/** show/hide */ | ||
show: boolean, | ||
/** max zoom out value */ | ||
maxZoomOut?: number, | ||
/** animation delay */ | ||
delay?: number, | ||
} |
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