Remove RefreshControl logic platform specific

This commit is contained in:
Diego Mello 2022-11-24 10:29:19 -03:00
parent 898a4a398b
commit 0317c4c27a
2 changed files with 19 additions and 19 deletions

View File

@ -19,18 +19,18 @@ interface IRefreshControl extends RefreshControlProps {
const RefreshControl = ({ children, onRefresh, refreshing }: IRefreshControl): React.ReactElement => { const RefreshControl = ({ children, onRefresh, refreshing }: IRefreshControl): React.ReactElement => {
const { colors } = useTheme(); const { colors } = useTheme();
if (isAndroid) { // if (isAndroid) {
return ( // return (
<RNRefreshControl // <RNRefreshControl
onRefresh={onRefresh} // onRefresh={onRefresh}
refreshing={refreshing} // refreshing={refreshing}
tintColor={colors.auxiliaryText} // tintColor={colors.auxiliaryText}
style={[style.container, style.inverted]} // style={[style.container, style.inverted]}
> // >
{children} // {children}
</RNRefreshControl> // </RNRefreshControl>
); // );
} // }
const refreshControl = <RNRefreshControl onRefresh={onRefresh} refreshing={refreshing} tintColor={colors.auxiliaryText} />; const refreshControl = <RNRefreshControl onRefresh={onRefresh} refreshing={refreshing} tintColor={colors.auxiliaryText} />;

View File

@ -23,13 +23,13 @@ import RefreshControl from './RefreshControl';
const QUERY_SIZE = 50; const QUERY_SIZE = 50;
const styles = StyleSheet.create({ const styles = StyleSheet.create({
inverted: { // inverted: {
...Platform.select({ // ...Platform.select({
android: { // android: {
scaleY: -1 // scaleY: -1
} // }
}) // })
} // }
}); });
const onScroll = ({ y }: { y: Value<number> }) => const onScroll = ({ y }: { y: Value<number> }) =>