Skip to content

Commit

Permalink
Add HEADER_HEIGHT constant
Browse files Browse the repository at this point in the history
  • Loading branch information
filipengberg committed Nov 14, 2021
1 parent c6e07c7 commit 28752b8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions example/src/StretchableHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import ExampleComponent from './Shared/ExampleComponent'
import { ExampleComponentType } from './types'

const title = 'Stretchable Header'
const HEADER_HEIGHT = 250

export const Header = () => {
const { top } = useHeaderMeasurements()
Expand All @@ -18,7 +19,7 @@ export const Header = () => {
translateY: Math.min(0, -top.value / 2),
},
{
scale: Math.max(1, (250 + top.value) / 250),
scale: Math.max(1, (HEADER_HEIGHT + top.value) / HEADER_HEIGHT),
},
],
}
Expand All @@ -44,7 +45,7 @@ const styles = StyleSheet.create({
root: {
justifyContent: 'center',
alignItems: 'center',
height: 250,
height: HEADER_HEIGHT,
},
background: {
position: 'absolute',
Expand Down

0 comments on commit 28752b8

Please sign in to comment.