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";
|
|
|
|
import ShowPage from "page/showPage";
|
|
|
|
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 ChannelPage from "page/channel";
|
|
|
|
import SearchPage from "page/search";
|
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-06-06 23:19:12 +02: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-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;
|