From ba2ec6e3c61b13fd98a88b5e86679bd6dafa5b9a Mon Sep 17 00:00:00 2001 From: Songyi Huang Date: Tue, 13 Apr 2021 23:01:21 -0700 Subject: [PATCH] refactor --- src/view/GameView/index.js | 4 ---- .../DoudizhuReplayView.js} | 6 ++---- .../LeducHoldemReplayView.js} | 6 ++---- src/view/ReplayView/index.js | 4 ++++ 4 files changed, 8 insertions(+), 12 deletions(-) delete mode 100644 src/view/GameView/index.js rename src/view/{GameView/DoudizhuGameView.js => ReplayView/DoudizhuReplayView.js} (99%) rename src/view/{GameView/LeducHoldemGameView.js => ReplayView/LeducHoldemReplayView.js} (99%) create mode 100644 src/view/ReplayView/index.js diff --git a/src/view/GameView/index.js b/src/view/GameView/index.js deleted file mode 100644 index a64e709..0000000 --- a/src/view/GameView/index.js +++ /dev/null @@ -1,4 +0,0 @@ -import DoudizhuGameView from "./DoudizhuGameView"; -import LeducHoldemGameView from "./LeducHoldemGameView"; - -export {DoudizhuGameView, LeducHoldemGameView}; diff --git a/src/view/GameView/DoudizhuGameView.js b/src/view/ReplayView/DoudizhuReplayView.js similarity index 99% rename from src/view/GameView/DoudizhuGameView.js rename to src/view/ReplayView/DoudizhuReplayView.js index 13b15a6..00ed55c 100644 --- a/src/view/GameView/DoudizhuGameView.js +++ b/src/view/ReplayView/DoudizhuReplayView.js @@ -2,7 +2,6 @@ import React from 'react'; import axios from 'axios'; import '../../assets/gameview.scss'; import { DoudizhuGameBoard } from '../../components/GameBoard'; -import Navbar from "../../components/Navbar"; import {removeCards, doubleRaf, deepCopy, computeHandCardsWidth, translateCardData} from "../../utils"; import { apiUrl } from "../../utils/config"; @@ -25,7 +24,7 @@ import DialogActions from "@material-ui/core/DialogActions"; import Dialog from "@material-ui/core/Dialog"; import qs from "query-string"; -class DoudizhuGameView extends React.Component { +class DoudizhuReplayView extends React.Component { constructor(props) { super(props); @@ -381,7 +380,6 @@ class DoudizhuGameView extends React.Component { -
@@ -493,4 +491,4 @@ class DoudizhuGameView extends React.Component { } } -export default DoudizhuGameView; +export default DoudizhuReplayView; diff --git a/src/view/GameView/LeducHoldemGameView.js b/src/view/ReplayView/LeducHoldemReplayView.js similarity index 99% rename from src/view/GameView/LeducHoldemGameView.js rename to src/view/ReplayView/LeducHoldemReplayView.js index cf77741..fb60116 100644 --- a/src/view/GameView/LeducHoldemGameView.js +++ b/src/view/ReplayView/LeducHoldemReplayView.js @@ -3,7 +3,6 @@ import axios from 'axios'; import qs from 'query-string'; import '../../assets/gameview.scss'; import {LeducHoldemGameBoard} from '../../components/GameBoard'; -import Navbar from '../../components/Navbar'; import {deepCopy} from "../../utils"; import { apiUrl } from "../../utils/config"; @@ -26,7 +25,7 @@ import DialogContent from '@material-ui/core/DialogContent'; import DialogContentText from '@material-ui/core/DialogContentText'; import DialogTitle from '@material-ui/core/DialogTitle'; -class LeducHoldemGameView extends React.Component { +class LeducHoldemReplayView extends React.Component { constructor(props) { super(props); @@ -398,7 +397,6 @@ class LeducHoldemGameView extends React.Component { -
@@ -513,4 +511,4 @@ class LeducHoldemGameView extends React.Component { } } -export default LeducHoldemGameView; +export default LeducHoldemReplayView; diff --git a/src/view/ReplayView/index.js b/src/view/ReplayView/index.js new file mode 100644 index 0000000..0cd02f6 --- /dev/null +++ b/src/view/ReplayView/index.js @@ -0,0 +1,4 @@ +import DoudizhuReplayView from "./DoudizhuReplayView"; +import LeducHoldemReplayView from "./LeducHoldemReplayView"; + +export {DoudizhuReplayView, LeducHoldemReplayView};