-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #265 from PedroBern/feat-usecurrenttabscrolly
- Loading branch information
Showing
11 changed files
with
107 additions
and
12 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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// courtesy of https://github.com/wcandillon/react-native-redash/blob/fd0b0ddb3b4c10ae88cf1f8a95890c7c5eb3c475/src/ReText.tsx | ||
|
||
import React from 'react' | ||
import type { TextProps as RNTextProps } from 'react-native' | ||
import { StyleSheet, TextInput } from 'react-native' | ||
import Animated, { useAnimatedProps } from 'react-native-reanimated' | ||
|
||
const styles = StyleSheet.create({ | ||
baseStyle: { | ||
color: 'black', | ||
}, | ||
}) | ||
Animated.addWhitelistedNativeProps({ text: true }) | ||
|
||
interface TextProps { | ||
text: Animated.SharedValue<string> | ||
style?: Animated.AnimateProps<RNTextProps>['style'] | ||
} | ||
|
||
const AnimatedTextInput = Animated.createAnimatedComponent(TextInput) | ||
|
||
const ReText = (props: TextProps) => { | ||
const { text, style } = { style: {}, ...props } | ||
const animatedProps = useAnimatedProps(() => { | ||
return { | ||
text: text.value, | ||
// Here we use any because the text prop is not available in the type | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
} as any | ||
}) | ||
return ( | ||
<AnimatedTextInput | ||
underlineColorAndroid="transparent" | ||
editable={false} | ||
value={text.value} | ||
style={[styles.baseStyle, style]} | ||
{...{ animatedProps }} | ||
/> | ||
) | ||
} | ||
|
||
export default ReText |
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
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
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
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
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