Skip to content

Commit

Permalink
resolved #22
Browse files Browse the repository at this point in the history
  • Loading branch information
wsdt committed May 22, 2019
1 parent 2f0b519 commit e368b4a
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 78 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
import * as React from "react"
import {Icon} from "react-native-elements"
import {NavigationRouteConfigMap} from "react-navigation"
import p from "../../../controllers/parseScss"
import * as styles from "../../components/system/TabRouter/TabBar.scss"
import {routesStr} from "./DashboardTabScreen.constants"
import {ChallengeTabRoutes} from "./tab_challenges/ChallengeTabRoutes"
import {NewsfeedTabRoutes} from "./tab_newsfeed/NewsfeedTabRoutes"
import {ProfileTabRoutes} from "./tab_profile/ProfileTabRoutes"


export const routesObj: NavigationRouteConfigMap = {
[routesStr.ChallengeStack.Home]: ChallengeTabRoutes,
[routesStr.NewsfeedStack.Home]: NewsfeedTabRoutes,
[routesStr.ProfileStack.Home]: ProfileTabRoutes,
[routesStr.ChallengeStack.Home]: {
navigationOptions: {
tabBarIcon: () => (
<Icon name="lock" type="material" iconStyle={p(styles.tabIcon)}/>
),
tabBarLabel: "Challenges",
},
screen: ChallengeTabRoutes,
},
[routesStr.NewsfeedStack.Home]: {
navigationOptions: {
tabBarIcon: () => (
<Icon name="list" type="material" iconStyle={p(styles.tabIcon)}/>
),
tabBarLabel: "Newsfeed",
},
screen: NewsfeedTabRoutes,
},
[routesStr.ProfileStack.Home]: {
navigationOptions: {
tabBarIcon: () => (
<Icon name="accessibility" type="material" iconStyle={p(styles.tabIcon)}/>
),
tabBarLabel: "Profile",
},
screen: ProfileTabRoutes,
},
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
import * as React from "react"
import {Icon} from "react-native-elements"
import {createStackNavigator} from "react-navigation"
import p from "../../../../controllers/parseScss"
import * as styles from "../../../components/system/TabRouter/TabBar.scss"
import {routesStr} from "../DashboardTabScreen.constants"
import {ChallengeTab} from "./ChallengeTab"

/** Stack Navigator as tabs might have own routes, too */
export const ChallengeTabRoutes = createStackNavigator({
[routesStr.ChallengeStack.Home]: {
navigationOptions: {
tabBarIcon: () => (
<Icon name="lock" type="material" iconStyle={p(styles.tabIcon)}/>
),
tabBarLabel: "Challenges",
},
screen: ChallengeTab,
}
[routesStr.ChallengeStack.Home]: ChallengeTab,
})
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
import * as React from "react"
import {Icon} from "react-native-elements"
import {createStackNavigator} from "react-navigation"
import p from "../../../../controllers/parseScss"
import * as styles from "../../../components/system/TabRouter/TabBar.scss"
import {routesStr} from "../DashboardTabScreen.constants"
import {NewsfeedTab} from "./NewsfeedTab"

/** Stack Navigator as tabs might have own routes, too */
export const NewsfeedTabRoutes = createStackNavigator({
[routesStr.NewsfeedStack.Home]: {
navigationOptions: {
tabBarIcon: () => (
<Icon name="list" type="material" iconStyle={p(styles.tabIcon)}/>
),
tabBarLabel: "Newsfeed",
},
screen: NewsfeedTab,
}
[routesStr.NewsfeedStack.Home]: NewsfeedTab,
})
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
import * as React from "react"
import {Icon} from "react-native-elements"
import {createStackNavigator} from "react-navigation"
import p from "../../../../controllers/parseScss"
import * as styles from "../../../components/system/TabRouter/TabBar.scss"
import {routesStr} from "../DashboardTabScreen.constants"
import {ProfileTab} from "./ProfileTab"

/** Stack Navigator as tabs might have own routes, too */
export const ProfileTabRoutes = createStackNavigator({
[routesStr.ProfileStack]: {
navigationOptions: {
tabBarIcon: () => (
<Icon name="accessibility" type="material" iconStyle={p(styles.tabIcon)}/>
),
tabBarLabel: "Profile",
},
screen: ProfileTab,
}
[routesStr.ProfileStack.Home]: ProfileTab,
})
34 changes: 0 additions & 34 deletions s_frontend/s_mobile/src/mvc/views/pages/TestScreen/TestScreen.jsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import {OAuthFacebook} from "../../../models/oauth/childs/oAuthFacebook"
import {TestFunctionalComponent} from "../../components/functional/TestFunctionalComponent/TestFunctionalComponent"
import {TestComponent} from "../../components/stateful/TestComponent/TestComponent"
import { BaseScreen } from "../BaseScreen/BaseScreen"
import {routesStr} from "../DashboardTabScreen/DashboardTabScreenRoutes"
import {routesStr} from "../DashboardTabScreen/DashboardTabScreen.constants"

export class TestScreen extends React.Component<any, any> {
public render(): React.ReactNode {
return (
<BaseScreen>
<TestComponent/>
<TestFunctionalComponent authCallback={OAuthFacebook.authenticate} socialType="facebook"/>
<Button title="Login" type="outline" onPress={() => this.props.navigation.navigate(routesStr.NewsfeedStack)} />
<Button title="Login" type="outline" onPress={() => this.props.navigation.navigate(routesStr.NewsfeedStack.Home)} />
</BaseScreen>
)
}
Expand Down

0 comments on commit e368b4a

Please sign in to comment.