-
Notifications
You must be signed in to change notification settings - Fork 985
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
35f08d5
commit 21871df
Showing
2 changed files
with
14 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
import {useDerivedValue, withTiming} from "react-native-reanimated"; | ||
import { useDerivedValue, withTiming } from 'react-native-reanimated'; | ||
|
||
export function headerContentOpacity(scrollY, threshold) { | ||
return useDerivedValue(function () { | ||
'worklet'; | ||
if (scrollY.value < threshold) { | ||
return withTiming(0); | ||
} else { | ||
return withTiming(1); | ||
} | ||
}); | ||
return useDerivedValue(function () { | ||
'worklet'; | ||
if (scrollY.value < threshold) { | ||
return withTiming(0); | ||
} else { | ||
return withTiming(1); | ||
} | ||
}); | ||
} | ||
|
||
export function headerContentPosition(scrollY, threshold, topBarHeight) { | ||
return useDerivedValue(function () { | ||
'worklet'; | ||
return scrollY.value < threshold ? withTiming(topBarHeight) : withTiming(0); | ||
}); | ||
return useDerivedValue(function () { | ||
'worklet'; | ||
return scrollY.value < threshold ? withTiming(topBarHeight) : withTiming(0); | ||
}); | ||
} |
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