From 0c71a78b226782bd1c67017c3e5b9be28daec813 Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Wed, 22 Apr 2020 11:18:43 +0200 Subject: [PATCH] Enabled collapsing header in login screen --- src/navigation/MainTabNavigator.js | 17 ++--------------- src/screens/Amicale/LoginScreen.js | 20 ++++++++++++++++---- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/navigation/MainTabNavigator.js b/src/navigation/MainTabNavigator.js index a1cbc20..3887733 100644 --- a/src/navigation/MainTabNavigator.js +++ b/src/navigation/MainTabNavigator.js @@ -126,13 +126,7 @@ function ServicesStackComponent() { {/* AMICALE */} - + {createScreenCollapsibleStack("login", ServicesStack, LoginScreen, i18n.t('screens.login'))} {createScreenCollapsibleStack("profile", ServicesStack, ProfileScreen, i18n.t('screens.profile'))} {createScreenCollapsibleStack("club-list", ServicesStack, ClubListScreen, i18n.t('clubs.clubList'))} {createScreenCollapsibleStack("self-menu", HomeStack, SelfMenuScreen, i18n.t('screens.menuSelf'), true, {...modalTransition})} - - + {createScreenCollapsibleStack("login", HomeStack, LoginScreen, i18n.t('screens.login'))} ); } diff --git a/src/screens/Amicale/LoginScreen.js b/src/screens/Amicale/LoginScreen.js index 77e046e..efe038d 100644 --- a/src/screens/Amicale/LoginScreen.js +++ b/src/screens/Amicale/LoginScreen.js @@ -1,16 +1,20 @@ // @flow import * as React from 'react'; -import {KeyboardAvoidingView, ScrollView, StyleSheet, View} from "react-native"; +import {Animated, KeyboardAvoidingView, StyleSheet, View} from "react-native"; import {Avatar, Button, Card, HelperText, Paragraph, TextInput, withTheme} from 'react-native-paper'; import ConnectionManager from "../../managers/ConnectionManager"; import i18n from 'i18n-js'; import ErrorDialog from "../../components/Dialogs/ErrorDialog"; import {CommonActions} from "@react-navigation/native"; +import {withCollapsible} from "../../utils/withCollapsible"; +import {Collapsible} from "react-navigation-collapsible"; +import CustomTabBar from "../../components/Tabbar/CustomTabBar"; type Props = { navigation: Object, route: Object, + collapsibleStack: Collapsible, } type State = { @@ -248,6 +252,7 @@ class LoginScreen extends React.Component { } render() { + const {containerPaddingTop, scrollIndicatorInsetTop, onScroll} = this.props.collapsibleStack; return ( { enabled keyboardVerticalOffset={100} > - + {this.getMainCard()} {this.getSecondaryCard()} @@ -266,7 +278,7 @@ class LoginScreen extends React.Component { onDismiss={this.hideErrorDialog} errorCode={this.state.dialogError} /> - + ); } @@ -292,4 +304,4 @@ const styles = StyleSheet.create({ } }); -export default withTheme(LoginScreen); +export default withCollapsible(withTheme(LoginScreen));