change default page

This commit is contained in:
Songyi Huang 2021-04-25 16:44:36 -07:00
parent e57e26dc5f
commit 1593b1235a
2 changed files with 11 additions and 15 deletions

View File

@ -1,15 +1,15 @@
import React from 'react';
import { BrowserRouter as Router, Route, Redirect } from "react-router-dom";
import { BrowserRouter as Router, Redirect, Route } from 'react-router-dom';
import Navbar from './components/Navbar';
import LeaderBoard from './view/LeaderBoard';
import { DoudizhuReplayView, LeducHoldemReplayView } from './view/ReplayView';
import { PvEDoudizhuDemoView } from './view/PvEView';
import Navbar from "./components/Navbar";
import { DoudizhuReplayView, LeducHoldemReplayView } from './view/ReplayView';
const navbarSubtitleMap = {
"/leaderboard": "",
"/replay/doudizhu": "Doudizhu",
"/replay/leduc-holdem": "Leduc Hold'em",
"/pve/doudizhu-demo": "Doudizhu PvE Demo"
'/leaderboard': '',
'/replay/doudizhu': 'Doudizhu',
'/replay/leduc-holdem': "Leduc Hold'em",
'/pve/doudizhu-demo': 'Doudizhu PvE Demo',
};
function App() {
@ -20,9 +20,8 @@ function App() {
<Navbar subtitleMap={navbarSubtitleMap} />
<div style={{ marginTop: '75px' }}>
<Route exact path="/">
{/* for test use */}
{/* <Redirect to="/leaderboard?type=game&name=leduc-holdem" /> */}
<Redirect to="/pve/doudizhu-demo" />
<Redirect to="/leaderboard?type=game&name=leduc-holdem" />
{/* <Redirect to="/pve/doudizhu-demo" /> */}
</Route>
<Route path="/leaderboard" component={LeaderBoard} />
<Route path="/replay/doudizhu" component={DoudizhuReplayView} />

View File

@ -77,9 +77,6 @@ function PvEDoudizhuDemoView() {
.join('');
};
// todo: generate inital player / hand states
// for test use
function timeout(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}