1 Star 0 Fork 2

dogs1024/listen1_mobile

forked from charles-cai/listen1_mobile 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Routes.js 3.01 KB
一键复制 编辑 原始数据 按行查看 历史
Listen 1 提交于 2019-07-31 18:45 . first commit
import React from 'react';
import { connect } from 'react-redux';
import { createStackNavigator, createAppContainer } from 'react-navigation';
import { StatusBar } from 'react-native';
import { fromRight } from 'react-navigation-transitions';
import { withTheme, ThemeProvider } from 'styled-components';
import { animationSetting } from './src/config/settings';
import { blackTheme, whiteTheme } from './src/config/theme';
import { ThemeFlex } from './src/components';
/* screens */
import PlaylistTabs from './src/views/playlist/playlist-tabs.screen';
import Playlist from './src/views/playlist/playlist.screen';
import BackgroundPlayer from './src/views/player/background-player.screen';
import ModalPlayerContainer from './src/views/player/modal-player-container.screen';
import MiniPlayer from './src/views/player/mini-player.screen';
import Setting from './src/views/setting/setting.screen';
import CreatePlaylist from './src/views/myplaylist/create-playlist.screen';
import ReOrder from './src/views/myplaylist/reorder.screen';
import ModalLiteContainer from './src/views/player/modal-lite-container.screen';
import ImportPlaylist from './src/views/myplaylist/import-playlist.screen';
import About from './src/views/setting/about.screen';
import ImportLocal from './src/views/setting/import-local.screen';
import ExportLocal from './src/views/setting/export-local.screen';
const MainStack = createStackNavigator(
{
Home: {
screen: PlaylistTabs,
},
Details: {
screen: Playlist,
},
Setting: {
screen: Setting,
},
CreatePlaylist: {
screen: CreatePlaylist,
},
ImportPlaylist: {
screen: ImportPlaylist,
},
ReOrder: {
screen: ReOrder,
},
About: {
screen: About,
},
ImportLocal: {
screen: ImportLocal,
},
ExportLocal: {
screen: ExportLocal,
},
},
{
initialRouteName: 'Home',
// force navigation animation window from right to left, set animation time in milliseconds
transitionConfig: () => fromRight(animationSetting.transitionTime),
defaultNavigationOptions: {
headerBackTitle: null,
},
}
);
const AppContainer = createAppContainer(MainStack);
const ThemeAppContainer = withTheme(({ theme }) => {
return <AppContainer screenProps={{ theme }} />;
});
const ThemeStatusBar = withTheme(({ theme }) => {
return (
<StatusBar backgroundColor={theme.windowColor} barStyle={theme.barStyle} />
);
});
class App extends React.Component {
props: {
settingState: Object,
};
render() {
return (
<ThemeProvider
theme={
this.props.settingState.theme === 'black' ? blackTheme : whiteTheme
}
>
<ThemeFlex>
<ThemeAppContainer />
<ThemeStatusBar />
<BackgroundPlayer />
<MiniPlayer />
<ModalPlayerContainer />
<ModalLiteContainer />
</ThemeFlex>
</ThemeProvider>
);
}
}
const mapStateToProps = ({ settingState }) => ({
settingState,
});
export default connect(mapStateToProps)(App);
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/dogs1024/listen1_mobile.git
git@gitee.com:dogs1024/listen1_mobile.git
dogs1024
listen1_mobile
listen1_mobile
master

搜索帮助