This file contains hidden or 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
// Animated Scroll Header Context | |
// imports react and Animated | |
import React, {createContext, useContext} from 'react'; | |
import {clamp} from 'react-native-redash'; | |
import {NativeScrollEvent, NativeSyntheticEvent, ViewStyle} from 'react-native'; | |
import Animated, { | |
Extrapolate, | |
interpolate, | |
useAnimatedScrollHandler, | |
useAnimatedStyle, |
This file contains hidden or 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
import 'react-native-gesture-handler/jestSetup'; | |
import mockAsyncStorage from '@react-native-async-storage/async-storage/jest/async-storage-mock'; | |
require('react-native-reanimated/lib/reanimated2/jestUtils').setUpTests(); | |
jest.useFakeTimers(); | |
jest.mock('react-native-reanimated', () => { | |
const Reanimated = require('react-native-reanimated/mock'); |
This file contains hidden or 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
import { useCallback, useLayoutEffect, useState } from "react"; | |
import { useAsyncStorage } from "@react-native-async-storage/async-storage"; | |
const useGetFirstTime = () => { | |
const [firstTime, setFirstTime] = useState(false); | |
const { getItem, setItem } = useAsyncStorage("FirstTime"); | |
const readItemFromStorage = useCallback(async () => { | |
const item = await getItem(); | |
setFirstTime(!item); | |
}, [getItem]); |
This file contains hidden or 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
import React, { useMemo } from "react"; | |
import { | |
ScrollView, | |
ScrollViewProps, | |
StyleSheet, | |
View, | |
ViewProps, | |
} from "react-native"; | |
type BaseProps<T> = T extends "scroll" |
OlderNewer