We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c6e07c7 commit 28752b8Copy full SHA for 28752b8
1 file changed
example/src/StretchableHeader.tsx
@@ -7,6 +7,7 @@ import ExampleComponent from './Shared/ExampleComponent'
7
import { ExampleComponentType } from './types'
8
9
const title = 'Stretchable Header'
10
+const HEADER_HEIGHT = 250
11
12
export const Header = () => {
13
const { top } = useHeaderMeasurements()
@@ -18,7 +19,7 @@ export const Header = () => {
18
19
translateY: Math.min(0, -top.value / 2),
20
},
21
{
- scale: Math.max(1, (250 + top.value) / 250),
22
+ scale: Math.max(1, (HEADER_HEIGHT + top.value) / HEADER_HEIGHT),
23
24
],
25
}
@@ -44,7 +45,7 @@ const styles = StyleSheet.create({
44
45
root: {
46
justifyContent: 'center',
47
alignItems: 'center',
- height: 250,
48
+ height: HEADER_HEIGHT,
49
50
background: {
51
position: 'absolute',
0 commit comments