lbry-desktop/ui/js/component/router/view.jsx

52 lines
1.6 KiB
React
Raw Normal View History

2017-04-07 12:15:22 +07:00
import React from 'react';
import SettingsPage from 'page/settings';
2017-04-07 12:15:22 +07:00
import HelpPage from 'page/help';
import ReportPage from 'page/report.js';
import StartPage from 'page/start.js';
2017-04-22 20:17:01 +07:00
import WalletPage from 'page/wallet';
import ShowPage from 'page/showPage'
2017-05-02 15:39:06 +07:00
import PublishPage from 'page/publish';
2017-04-23 16:56:50 +07:00
import DiscoverPage from 'page/discover';
2017-04-07 12:15:22 +07:00
import SplashScreen from 'component/splash.js';
import DeveloperPage from 'page/developer.js';
2017-05-03 23:44:08 -04:00
import RewardsPage from 'page/rewards.js';
import FileListDownloaded from 'page/fileListDownloaded'
import FileListPublished from 'page/fileListPublished'
2017-05-03 23:44:08 -04:00
import ChannelPage from 'page/channel'
2017-05-05 15:01:16 +07:00
import SearchPage from 'page/search'
2017-04-07 12:15:22 +07:00
const route = (page, routesMap) => {
const component = routesMap[page]
return component
};
const Router = (props) => {
const {
currentPage,
2017-05-14 23:50:59 -04:00
params,
2017-04-07 12:15:22 +07:00
} = props;
return route(currentPage, {
2017-05-14 23:50:59 -04:00
'settings': <SettingsPage {...params} />,
'help': <HelpPage {...params} />,
'report': <ReportPage {...params} />,
'downloaded': <FileListDownloaded {...params} />,
'published': <FileListPublished {...params} />,
'start': <StartPage {...params} />,
'wallet': <WalletPage {...params} />,
'send': <WalletPage {...params} />,
'receive': <WalletPage {...params} />,
'show': <ShowPage {...params} />,
'channel': <ChannelPage {...params} />,
'publish': <PublishPage {...params} />,
'developer': <DeveloperPage {...params} />,
'discover': <DiscoverPage {...params} />,
'rewards': <RewardsPage {...params} />,
'search': <SearchPage {...params} />,
2017-04-07 12:15:22 +07:00
})
}
export default Router