From 5fddf312b64d75d6f4681e1b396cfa365d6c3d56 Mon Sep 17 00:00:00 2001 From: ue Date: Fri, 26 Oct 2018 15:34:45 +0300 Subject: [PATCH] added stack navigation && enhanced profile routing --- .../header/container/headerContainer.js | 2 +- src/components/postCard/view/postCardView.js | 6 ++- .../profileSummary/view/profileSummaryView.js | 2 +- .../sideMenu/view/sideMenuStyles.js | 2 +- src/config/routes.js | 38 +++++++++++++++---- 5 files changed, 39 insertions(+), 11 deletions(-) diff --git a/src/components/header/container/headerContainer.js b/src/components/header/container/headerContainer.js index 63c9acaf5..fe8ce2244 100644 --- a/src/components/header/container/headerContainer.js +++ b/src/components/header/container/headerContainer.js @@ -37,7 +37,7 @@ class HeaderContainer extends Component { _handleOnPressBackButton = () => { const { navigation } = this.props; - navigation.navigate('HomeScreen'); + navigation.goBack(); }; render() { diff --git a/src/components/postCard/view/postCardView.js b/src/components/postCard/view/postCardView.js index a0c889d9e..03cd817f1 100644 --- a/src/components/postCard/view/postCardView.js +++ b/src/components/postCard/view/postCardView.js @@ -145,7 +145,11 @@ class PostCard extends Component { - {content.author} + this._handleOnUserPress()} + > + {content.author} + {content.author_reputation} diff --git a/src/components/profileSummary/view/profileSummaryView.js b/src/components/profileSummary/view/profileSummaryView.js index 06e0bd8d6..5093d69b7 100644 --- a/src/components/profileSummary/view/profileSummaryView.js +++ b/src/components/profileSummary/view/profileSummaryView.js @@ -61,7 +61,7 @@ class ProfileSummaryView extends Component { : null; const isColumn = rowLength && DEVICE_WIDTH / rowLength <= 15; - + return ( diff --git a/src/components/sideMenu/view/sideMenuStyles.js b/src/components/sideMenu/view/sideMenuStyles.js index 0ed67b84b..cee57154d 100644 --- a/src/components/sideMenu/view/sideMenuStyles.js +++ b/src/components/sideMenu/view/sideMenuStyles.js @@ -59,7 +59,7 @@ export default EStyleSheet.create({ }, buttonText: { fontSize: 18, - fontFamily: '$primaryFontFamily', + fontFamily: '$primaryFont', textAlign: 'center', margin: 10, color: '$white', diff --git a/src/config/routes.js b/src/config/routes.js index 67d4266e3..35531e4e9 100644 --- a/src/config/routes.js +++ b/src/config/routes.js @@ -1,4 +1,4 @@ -import { DrawerNavigator, SwitchNavigator } from 'react-navigation'; +import { DrawerNavigator, SwitchNavigator, createStackNavigator } from 'react-navigation'; import { BaseNavigator } from '../navigation'; import { default as ROUTES } from '../constants/routeNames'; @@ -14,9 +14,6 @@ const mainNavigation = DrawerNavigator( { [ROUTES.SCREENS.HOME]: { screen: BaseNavigator, - navigationOptions: { - header: () => null, - }, }, }, { @@ -24,12 +21,39 @@ const mainNavigation = DrawerNavigator( }, ); +const stackNavigatior = createStackNavigator( + { + [ROUTES.DRAWER.MAIN]: { + screen: mainNavigation, + navigationOptions: { + header: () => null, + }, + }, + + [ROUTES.SCREENS.PROFILE]: { + screen: Profile, + navigationOptions: { + header: () => null, + }, + }, + [ROUTES.SCREENS.EDITOR]: { + screen: Editor, + navigationOptions: { + header: () => null, + }, + }, + }, + { + cardStyle: { + backgroundColor: 'white', + }, + }, +); + export default SwitchNavigator({ - [ROUTES.DRAWER.MAIN]: mainNavigation, - [ROUTES.SCREENS.EDITOR]: { screen: Editor }, + stackNavigatior, [ROUTES.SCREENS.LOGIN]: { screen: Login }, [ROUTES.SCREENS.PINCODE]: { screen: PinCode }, - [ROUTES.SCREENS.PROFILE]: { screen: Profile }, [ROUTES.SCREENS.SPLASH]: { screen: Splash }, [ROUTES.SCREENS.STEEM_CONNECT]: { screen: SteemConnect }, });