Skip to content

Commit

Permalink
Add setting to change default screen upon launch
Browse files Browse the repository at this point in the history
  • Loading branch information
yutotakano committed Jun 15, 2019
1 parent 2de4c0c commit 13aea9e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion App.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const AppStack = createMaterialBottomTabNavigator(
SettingsTabs: SettingsStack
},
{
initialRouteName: 'ManagebacTabs',
initialRouteName: store.getState().settings.general.firstScreenManagebac ? 'ManagebacTabs' : 'TasksTabs',
shifting: true,
activeColor: colors.primary,
inactiveColor: colors.inactive,
Expand Down
3 changes: 2 additions & 1 deletion src/reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { combineReducers } from 'redux';

const SETTINGS_INITIAL_STATE = {
general: {
showOverviewAnimation: true
showOverviewAnimation: true,
firstScreenManagebac: false
}
};

Expand Down
7 changes: 7 additions & 0 deletions src/screens/SettingsScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ class SettingsScreen extends React.Component {
type: 'checkbox',
redux: 'general.showOverviewAnimation'
},
{
title: 'Start app on ManageBac',
description:
'Enable to launch the app on the ManageBac page instead of Tasks. (applies from next launch)',
type: 'checkbox',
redux: 'general.firstScreenManagebac'
},
{
title: 'Default tasklist labels',
onPress: () => this._handleNavigateToUserLabels()
Expand Down

0 comments on commit 13aea9e

Please sign in to comment.