Skip to content

Commit f480900

Browse files
committed
Add HEADER_HEIGHT constant
1 parent 61bb46f commit f480900

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

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
}
@@ -46,7 +47,7 @@ const styles = StyleSheet.create({
4647
root: {
4748
justifyContent: 'center',
4849
alignItems: 'center',
49-
height: 250,
50+
height: HEADER_HEIGHT,
5051
},
5152
background: {
5253
position: 'absolute',

0 commit comments

Comments
 (0)