'use strict'

import {createStackNavigator} from 'react-navigation-stack'
import NavigationOptions from '../../components/NavbarOptions'
import MineHome from './Home'
import About from "./About"
import ChangePassword from "./ChangePassword"
import Download from "./Download"
import Privacy from "./Privacy"

const HomeStack = createStackNavigator({
        MineHome: {
            screen: MineHome,
            navigationOptions: {
                title: '首页'
            },
        },
        About: {
            screen: About,
            navigationOptions: {
                title: "关于"
            }
        },
        ChangePassword: {
            screen: ChangePassword,
            navigationOptions: {
                title: "修改密码"
            }
        },
        Download: {
            screen: Download,
            navigationOptions: {
                title: 'APP下载'
            }
        },
        Privacy: {
            screen: Privacy,
            navigationOptions: {
                title: '隐私说明'
            }
        },
    },
    {
        initialRouteName: 'MineHome',
        defaultNavigationOptions: NavigationOptions,
        //mode: 'modal',
        //headerMode: 'none',
    }
)

HomeStack.navigationOptions = ({navigation}) => {  // ~注意~ 如果想实现隐藏Tabbar的功能要调用这个方法
    let tabBarVisible = true
    if (navigation.state.index > 0) {
        tabBarVisible = false
    }
    return {
        tabBarVisible
    }
}


module.exports = HomeStack
