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

57 lines
2 KiB
React
Raw Normal View History

2017-06-06 23:19:12 +02:00
import React from "react";
import SettingsPage from "page/settings";
import HelpPage from "page/help";
import ReportPage from "page/report.js";
import StartPage from "page/start.js";
import WalletPage from "page/wallet";
2017-08-17 22:19:29 +02:00
import ReceiveCreditsPage from "page/receiveCredits";
import SendCreditsPage from "page/sendCredits";
import ShowPage from "page/show";
2017-06-06 23:19:12 +02:00
import PublishPage from "page/publish";
import DiscoverPage from "page/discover";
import DeveloperPage from "page/developer.js";
2017-06-08 02:56:52 +02:00
import RewardsPage from "page/rewards";
2017-06-06 23:19:12 +02:00
import FileListDownloaded from "page/fileListDownloaded";
import FileListPublished from "page/fileListPublished";
import TransactionHistoryPage from "page/transactionHistory";
2017-06-06 23:19:12 +02:00
import ChannelPage from "page/channel";
import SearchPage from "page/search";
2017-07-19 01:00:13 +02:00
import AuthPage from "page/auth";
2017-08-18 05:31:44 +02:00
import InvitePage from "page/invite";
import BackupPage from "page/backup";
2017-04-07 07:15:22 +02:00
const route = (page, routesMap) => {
2017-06-06 23:19:12 +02:00
const component = routesMap[page];
2017-04-07 07:15:22 +02:00
2017-06-06 23:19:12 +02:00
return component;
2017-04-07 07:15:22 +02:00
};
2017-06-06 06:21:55 +02:00
const Router = props => {
2017-06-06 23:19:12 +02:00
const { currentPage, params } = props;
2017-04-07 07:15:22 +02:00
return route(currentPage, {
2017-07-17 08:06:04 +02:00
auth: <AuthPage params={params} />,
backup: <BackupPage params={params} />,
2017-07-17 08:06:04 +02:00
channel: <ChannelPage params={params} />,
developer: <DeveloperPage params={params} />,
discover: <DiscoverPage params={params} />,
downloaded: <FileListDownloaded params={params} />,
help: <HelpPage params={params} />,
history: <TransactionHistoryPage params={params} />,
2017-08-18 05:31:44 +02:00
invite: <InvitePage params={params} />,
2017-07-17 08:06:04 +02:00
publish: <PublishPage params={params} />,
published: <FileListPublished params={params} />,
2017-08-17 22:19:29 +02:00
receive: <ReceiveCreditsPage params={params} />,
2017-07-17 08:06:04 +02:00
report: <ReportPage params={params} />,
rewards: <RewardsPage params={params} />,
search: <SearchPage params={params} />,
2017-08-17 22:19:29 +02:00
send: <SendCreditsPage params={params} />,
2017-07-17 08:06:04 +02:00
settings: <SettingsPage params={params} />,
show: <ShowPage params={params} />,
start: <StartPage params={params} />,
wallet: <WalletPage params={params} />,
2017-06-06 23:19:12 +02:00
});
2017-06-06 06:21:55 +02:00
};
2017-04-07 07:15:22 +02:00
2017-06-06 06:21:55 +02:00
export default Router;