Skip to content

Commit 28752b8

Browse files
committed
Add HEADER_HEIGHT constant
1 parent c6e07c7 commit 28752b8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

example/src/StretchableHeader.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import ExampleComponent from './Shared/ExampleComponent'
77
import { ExampleComponentType } from './types'
88

99
const title = 'Stretchable Header'
10+
const HEADER_HEIGHT = 250
1011

1112
export const Header = () => {
1213
const { top } = useHeaderMeasurements()
@@ -18,7 +19,7 @@ export const Header = () => {
1819
translateY: Math.min(0, -top.value / 2),
1920
},
2021
{
21-
scale: Math.max(1, (250 + top.value) / 250),
22+
scale: Math.max(1, (HEADER_HEIGHT + top.value) / HEADER_HEIGHT),
2223
},
2324
],
2425
}
@@ -44,7 +45,7 @@ const styles = StyleSheet.create({
4445
root: {
4546
justifyContent: 'center',
4647
alignItems: 'center',
47-
height: 250,
48+
height: HEADER_HEIGHT,
4849
},
4950
background: {
5051
position: 'absolute',

0 commit comments

Comments
 (0)