added stack navigation && enhanced profile routing

This commit is contained in:
ue 2018-10-26 15:34:45 +03:00
parent e845961a49
commit 5fddf312b6
5 changed files with 39 additions and 11 deletions

View File

@ -37,7 +37,7 @@ class HeaderContainer extends Component {
_handleOnPressBackButton = () => { _handleOnPressBackButton = () => {
const { navigation } = this.props; const { navigation } = this.props;
navigation.navigate('HomeScreen'); navigation.goBack();
}; };
render() { render() {

View File

@ -145,7 +145,11 @@ class PostCard extends Component {
</TouchableOpacity> </TouchableOpacity>
<Body style={styles.body}> <Body style={styles.body}>
<View style={styles.author}> <View style={styles.author}>
<TouchableOpacity
onPress={() => this._handleOnUserPress()}
>
<Text style={styles.authorName}>{content.author}</Text> <Text style={styles.authorName}>{content.author}</Text>
</TouchableOpacity>
</View> </View>
<View style={styles.badge}> <View style={styles.badge}>
<Text style={styles.text}>{content.author_reputation}</Text> <Text style={styles.text}>{content.author_reputation}</Text>

View File

@ -59,7 +59,7 @@ export default EStyleSheet.create({
}, },
buttonText: { buttonText: {
fontSize: 18, fontSize: 18,
fontFamily: '$primaryFontFamily', fontFamily: '$primaryFont',
textAlign: 'center', textAlign: 'center',
margin: 10, margin: 10,
color: '$white', color: '$white',

View File

@ -1,4 +1,4 @@
import { DrawerNavigator, SwitchNavigator } from 'react-navigation'; import { DrawerNavigator, SwitchNavigator, createStackNavigator } from 'react-navigation';
import { BaseNavigator } from '../navigation'; import { BaseNavigator } from '../navigation';
import { default as ROUTES } from '../constants/routeNames'; import { default as ROUTES } from '../constants/routeNames';
@ -14,9 +14,6 @@ const mainNavigation = DrawerNavigator(
{ {
[ROUTES.SCREENS.HOME]: { [ROUTES.SCREENS.HOME]: {
screen: BaseNavigator, 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({ export default SwitchNavigator({
[ROUTES.DRAWER.MAIN]: mainNavigation, stackNavigatior,
[ROUTES.SCREENS.EDITOR]: { screen: Editor },
[ROUTES.SCREENS.LOGIN]: { screen: Login }, [ROUTES.SCREENS.LOGIN]: { screen: Login },
[ROUTES.SCREENS.PINCODE]: { screen: PinCode }, [ROUTES.SCREENS.PINCODE]: { screen: PinCode },
[ROUTES.SCREENS.PROFILE]: { screen: Profile },
[ROUTES.SCREENS.SPLASH]: { screen: Splash }, [ROUTES.SCREENS.SPLASH]: { screen: Splash },
[ROUTES.SCREENS.STEEM_CONNECT]: { screen: SteemConnect }, [ROUTES.SCREENS.STEEM_CONNECT]: { screen: SteemConnect },
}); });