-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved routes path to a separate file
- Loading branch information
Showing
2 changed files
with
34 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React, { lazy } from "react"; | ||
|
||
// Pages | ||
const Home = lazy(() => import("../pages/Home")); | ||
const About = lazy(() => import("../pages/About")); | ||
const Contact = lazy(() => import("../pages/Contact")); | ||
const TopRatedGames = lazy(() => import("../pages/games/top")); | ||
const DisplayGameInfo = lazy(() => import("../pages/games/DisplayGameInfo")); | ||
const TopGamesStreaming = lazy(() => import("../pages/streams")); | ||
const ErrorPage = lazy(() => import("../pages/404")); | ||
|
||
const DisplayMostViewedStreams = | ||
lazy(() => import("../pages/streams/DisplayMostViewedStreams")); | ||
|
||
const DisplayStreamsByGame = | ||
lazy(() => import("../pages/streams/DisplayStreamsByGame")); | ||
|
||
|
||
// Page path | ||
const routes = [ | ||
{ path: "/", component: Home }, | ||
{ path: "/about", component: About }, | ||
{ path: "/Contact", component: Contact }, | ||
{ path: "/games/top", component: TopRatedGames }, | ||
{ path: "/games/:gId", component: DisplayGameInfo }, | ||
{ path: "/streams/", component: TopGamesStreaming }, | ||
{ path: "/streams/most-viewed", component: DisplayMostViewedStreams }, | ||
{ path: "/streams/:gameId", component: DisplayStreamsByGame }, | ||
{ path: "*", component: ErrorPage }, | ||
]; | ||
|
||
export default routes; |