From f12029eae98d24f5be07106544f91666afad8e22 Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Sun, 12 Apr 2020 00:34:41 +0200 Subject: [PATCH] Revert "Collapse header when scrolling" This reverts commit f70a289c --- package.json | 1 - src/navigation/MainTabNavigator.js | 28 +++++++++--------------- src/screens/Proximo/ProximoListScreen.js | 16 +++----------- src/utils/withCollapsible.js | 8 ------- 4 files changed, 13 insertions(+), 40 deletions(-) delete mode 100644 src/utils/withCollapsible.js diff --git a/package.json b/package.json index f898812..b8657aa 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,6 @@ "react-native-safe-area-context": "0.7.3", "react-native-screens": "~2.2.0", "react-native-webview": "8.1.1", - "react-navigation-collapsible": "^5.4.0", "react-navigation-header-buttons": "^3.0.5" }, "devDependencies": { diff --git a/src/navigation/MainTabNavigator.js b/src/navigation/MainTabNavigator.js index 6623e15..358e890 100644 --- a/src/navigation/MainTabNavigator.js +++ b/src/navigation/MainTabNavigator.js @@ -13,12 +13,12 @@ import ProximoAboutScreen from "../screens/Proximo/ProximoAboutScreen"; import PlanexScreen from '../screens/Websites/PlanexScreen'; import {MaterialCommunityIcons} from "@expo/vector-icons"; import AsyncStorageManager from "../managers/AsyncStorageManager"; -import {useTheme, withTheme} from 'react-native-paper'; +import {withTheme} from 'react-native-paper'; import i18n from "i18n-js"; import ClubDisplayScreen from "../screens/Amicale/Clubs/ClubDisplayScreen"; import ScannerScreen from "../screens/ScannerScreen"; import MaterialHeaderButtons, {Item} from "../components/Custom/HeaderButton"; -import {createCollapsibleStack} from 'react-navigation-collapsible'; + const TAB_ICONS = { home: 'triangle', @@ -44,9 +44,7 @@ function getDrawerButton(navigation: Object) { const ProximoStack = createStackNavigator(); -function ProximoStackComponent(props: Object) { - - const {colors} = useTheme(); +function ProximoStackComponent() { return ( - {createCollapsibleStack( - , - { - collapsedColor: colors.surface, - useNativeDriver: true /* Optional, default: true */, - } - )} + { itemLayout = (data, index) => ({length: LIST_ITEM_HEIGHT, offset: LIST_ITEM_HEIGHT * index, index}); - render() { - const {containerPaddingTop, scrollIndicatorInsetTop, onScroll} = this.props.collapsibleStack; return ( { {this.state.modalCurrentDisplayItem} {/*$FlowFixMe*/} - { removeClippedSubviews={true} getItemLayout={this.itemLayout} initialNumToRender={10} - // Animations - onScroll={onScroll} - contentContainerStyle={{paddingTop: containerPaddingTop}} - scrollIndicatorInsets={{top: scrollIndicatorInsetTop}} /> ); } } -export default withCollapsible(withTheme(ProximoListScreen)); +export default withTheme(ProximoListScreen); diff --git a/src/utils/withCollapsible.js b/src/utils/withCollapsible.js deleted file mode 100644 index 0cb5cad..0000000 --- a/src/utils/withCollapsible.js +++ /dev/null @@ -1,8 +0,0 @@ -import React from 'react'; -import {useCollapsibleStack} from "react-navigation-collapsible"; - -export const withCollapsible = (Component: any) => { - return (props: any) => { - return ; - }; -};