Bläddra i källkod

Renaming all the components in the front end to be react style

Kirk Trombley 5 år sedan
förälder
incheckning
3d1994d247
29 ändrade filer med 33 tillägg och 35 borttagningar
  1. 1 1
      client/src/App.js
  2. 9 9
      client/src/components/Game/Game.jsx
  3. 0 0
      client/src/components/Game/GameState.js
  4. 1 1
      client/src/components/Game/HeaderAndFooter.jsx
  5. 1 0
      client/src/components/Game/index.js
  6. 0 3
      client/src/components/game.component/index.js
  7. 0 0
      client/src/components/screens/GamePanel/ClickMarkerMap.jsx
  8. 4 4
      client/src/components/screens/GamePanel/GamePanel.jsx
  9. 2 2
      client/src/components/screens/GamePanel/GuessPane.jsx
  10. 0 0
      client/src/components/screens/GamePanel/PositionedStreetView.jsx
  11. 1 0
      client/src/components/screens/GamePanel/index.js
  12. 0 0
      client/src/components/screens/PlayerScores/PlayerScoreTile.jsx
  13. 4 4
      client/src/components/screens/PlayerScores/PlayerScores.jsx
  14. 1 1
      client/src/components/screens/PlayerScores/PlayerScoresList.jsx
  15. 1 0
      client/src/components/screens/PlayerScores/index.js
  16. 0 0
      client/src/components/screens/PreGame/JoinGameInput.jsx
  17. 0 0
      client/src/components/screens/PreGame/PlayerNameInput.jsx
  18. 4 4
      client/src/components/screens/PreGame/PreGame.jsx
  19. 1 0
      client/src/components/screens/PreGame/index.js
  20. 1 1
      client/src/components/screens/PreRound.jsx
  21. 1 1
      client/src/components/screens/RoundSummary.jsx
  22. 0 1
      client/src/components/screens/game-panel.component/index.js
  23. 0 1
      client/src/components/screens/player-scores.component/index.js
  24. 0 1
      client/src/components/screens/pre-game.component/index.js
  25. 1 1
      client/src/components/util/ApiInfo.jsx
  26. 0 0
      client/src/components/util/ClickToCopy.jsx
  27. 0 0
      client/src/components/util/Loading.jsx
  28. 0 0
      client/src/components/util/Timer.jsx
  29. 0 0
      client/src/domain/GGSHService.js

+ 1 - 1
client/src/App.js

@@ -1,5 +1,5 @@
 import React from 'react';
-import Game from "./components/game.component";
+import Game from "./components/Game";
 import './App.css';
 
 

+ 9 - 9
client/src/components/game.component/game.jsx → client/src/components/Game/Game.jsx

@@ -6,13 +6,13 @@ import {
   POST_ROUND,
   POST_GAME,
   ERROR,
-} from "./game-state.enum";
-import HeaderAndFooter from "./header-and-footer.component";
-import PreGame from '../screens/pre-game.component';
-import PreRound from '../screens/pre-round.component';
-import GamePanelContainer from "../screens/game-panel.component";
-import RoundSummary from '../screens/round-summary.component';
-import PlayerScoresContainer from "../screens/player-scores.component";
+} from "./GameState";
+import HeaderAndFooter from "./HeaderAndFooter";
+import PreGame from '../screens/PreGame';
+import PreRound from '../screens/PreRound';
+import GamePanel from "../screens/GamePanel";
+import RoundSummary from '../screens/RoundSummary';
+import PlayerScores from "../screens/PlayerScores";
 
 const initialState = {
   gameState: PRE_GAME,
@@ -43,7 +43,7 @@ const Game = () => {
         onStart={() => setGameState(IN_ROUND)}
       />
     case IN_ROUND:
-      return <GamePanelContainer
+      return <GamePanel
         gameId={state.gameId}
         playerName={state.playerName}
         onRoundEnd={lastRound => setGameStateAnd(POST_ROUND, { lastRound })}
@@ -57,7 +57,7 @@ const Game = () => {
     case POST_GAME:
       return (
         <HeaderAndFooter>
-          <PlayerScoresContainer
+          <PlayerScores
             gameId={state.gameId}
             onReturnToStart={() => setGameState(PRE_GAME)}
           />

+ 0 - 0
client/src/components/game.component/game-state.enum.js → client/src/components/Game/GameState.js


+ 1 - 1
client/src/components/game.component/header-and-footer.component.jsx → client/src/components/Game/HeaderAndFooter.jsx

@@ -1,5 +1,5 @@
 import React from "react";
-import ApiInfo from "../util/api-info.component";
+import ApiInfo from "../util/ApiInfo";
 
 export default props => (
   <>

+ 1 - 0
client/src/components/Game/index.js

@@ -0,0 +1 @@
+export { default } from "./Game";

+ 0 - 3
client/src/components/game.component/index.js

@@ -1,3 +0,0 @@
-import Game from "./game";
-
-export default Game;

+ 0 - 0
client/src/components/screens/game-panel.component/click-marker-map.component.jsx → client/src/components/screens/GamePanel/ClickMarkerMap.jsx


+ 4 - 4
client/src/components/screens/game-panel.component/game-panel.component.jsx → client/src/components/screens/GamePanel/GamePanel.jsx

@@ -1,8 +1,8 @@
 import React, { useState, useEffect } from 'react';
-import { gameInfo, getGuesses, sendGuess } from "../../../services/ggsh.service";
-import Loading from '../../util/loading.component';
-import GuessPane from "./guess-pane.component";
-import PositionedStreetView from "./positioned-street-view.component";
+import { gameInfo, getGuesses, sendGuess } from "../../../domain/GGSHService";
+import Loading from '../../util/Loading';
+import GuessPane from "./GuessPane";
+import PositionedStreetView from "./PositionedStreetView";
 
 const GamePanelContainer = ({ gameId, playerName, onRoundEnd, onGameEnd }) => {
   const [{ currentRound, targetPoint, roundSeconds }, setRoundInfo] = useState({currentRound: null, targetPoint: null, roundSeconds: null});

+ 2 - 2
client/src/components/screens/game-panel.component/guess-pane.component.jsx → client/src/components/screens/GamePanel/GuessPane.jsx

@@ -1,6 +1,6 @@
 import React from "react";
-import ClickMarkerMap from "./click-marker-map.component";
-import RoundTimer from "../../util/timer.component";
+import ClickMarkerMap from "./ClickMarkerMap";
+import RoundTimer from "../../util/Timer";
 
 export default ({
   roundSeconds,

+ 0 - 0
client/src/components/screens/game-panel.component/positioned-street-view.component.jsx → client/src/components/screens/GamePanel/PositionedStreetView.jsx


+ 1 - 0
client/src/components/screens/GamePanel/index.js

@@ -0,0 +1 @@
+export { default } from './GamePanel';

+ 0 - 0
client/src/components/screens/player-scores.component/player-score-tile.component.jsx → client/src/components/screens/PlayerScores/PlayerScoreTile.jsx


+ 4 - 4
client/src/components/screens/player-scores.component/player-scores.component.jsx → client/src/components/screens/PlayerScores/PlayerScores.jsx

@@ -1,7 +1,7 @@
 import React, { useState, useEffect } from 'react';
-import { gameInfo } from '../../../services/ggsh.service';
-import Loading from '../../util/loading.component';
-import PlayerScores from "./player-score-list.component";
+import { gameInfo } from '../../../domain/GGSHService';
+import Loading from '../../util/Loading';
+import PlayerScoresList from "./PlayerScoresList";
 
 const PlayerScoresContainer = ({ gameId, onReturnToStart }) => {
   const [scores, setScores] = useState(null);
@@ -26,7 +26,7 @@ const PlayerScoresContainer = ({ gameId, onReturnToStart }) => {
 
   return (
     <div className="player-scores">
-      <PlayerScores scores={scores} />
+      <PlayerScoresList scores={scores} />
       <button className="btn player-scores__button" onClick={onReturnToStart} >Return to Start</button>
     </div>
   );

+ 1 - 1
client/src/components/screens/player-scores.component/player-score-list.component.jsx → client/src/components/screens/PlayerScores/PlayerScoresList.jsx

@@ -1,5 +1,5 @@
 import React from "react";
-import PlayerScoreTile from "./player-score-tile.component";
+import PlayerScoreTile from "./PlayerScoreTile";
 
 export default ({ scores }) => (
   <div className="player-scores__score-board">

+ 1 - 0
client/src/components/screens/PlayerScores/index.js

@@ -0,0 +1 @@
+export { default } from './PlayerScores';

+ 0 - 0
client/src/components/screens/pre-game.component/join-game-input.component.jsx → client/src/components/screens/PreGame/JoinGameInput.jsx


+ 0 - 0
client/src/components/screens/pre-game.component/player-name-input.component.jsx → client/src/components/screens/PreGame/PlayerNameInput.jsx


+ 4 - 4
client/src/components/screens/pre-game.component/pre-game.component.jsx → client/src/components/screens/PreGame/PreGame.jsx

@@ -1,8 +1,8 @@
 import React, { useState } from "react";
-import Loading from "../../util/loading.component";
-import PlayerNameInput from "./player-name-input.component";
-import JoinGameInput from "./join-game-input.component";
-import { createGame, joinGame } from "../../../services/ggsh.service";
+import Loading from "../../util/Loading";
+import PlayerNameInput from "./PlayerNameInput";
+import JoinGameInput from "./JoinGameInput";
+import { createGame, joinGame } from "../../../domain/GGSHService";
 
 // TODO set round timer for new game
 

+ 1 - 0
client/src/components/screens/PreGame/index.js

@@ -0,0 +1 @@
+export { default } from './PreGame';

+ 1 - 1
client/src/components/screens/pre-round.component.jsx → client/src/components/screens/PreRound.jsx

@@ -1,5 +1,5 @@
 import React from "react";
-import ClickToCopy from "../util/click-to-copy.component";
+import ClickToCopy from "../util/ClickToCopy";
 
 const PreRound = ({ gameId, playerName, onStart }) => (
   <div className="pre-round">

+ 1 - 1
client/src/components/screens/round-summary.component.jsx → client/src/components/screens/RoundSummary.jsx

@@ -1,5 +1,5 @@
 import React from "react";
-import ClickToCopy from "../util/click-to-copy.component";
+import ClickToCopy from "../util/ClickToCopy";
 
 // TODO eventually we want this to query and show other players
 

+ 0 - 1
client/src/components/screens/game-panel.component/index.js

@@ -1 +0,0 @@
-export { default } from './game-panel.component';

+ 0 - 1
client/src/components/screens/player-scores.component/index.js

@@ -1 +0,0 @@
-export { default } from './player-scores.component';

+ 0 - 1
client/src/components/screens/pre-game.component/index.js

@@ -1 +0,0 @@
-export { default } from './pre-game.component';

+ 1 - 1
client/src/components/util/api-info.component.jsx → client/src/components/util/ApiInfo.jsx

@@ -1,5 +1,5 @@
 import React, { useState, useEffect } from "react";
-import { getStatus } from "../../services/ggsh.service";
+import { getStatus } from "../../domain/GGSHService";
 
 const ApiInfo = () => {
   const [{ loading, version, status }, setState] = useState({ loading: true, version: null, status: null });

+ 0 - 0
client/src/components/util/click-to-copy.component.jsx → client/src/components/util/ClickToCopy.jsx


+ 0 - 0
client/src/components/util/loading.component.jsx → client/src/components/util/Loading.jsx


+ 0 - 0
client/src/components/util/timer.component.jsx → client/src/components/util/Timer.jsx


+ 0 - 0
client/src/services/ggsh.service.js → client/src/domain/GGSHService.js