diff --git a/baloot/src/App.js b/baloot/src/App.js index 2d194c9..33f2ea9 100644 --- a/baloot/src/App.js +++ b/baloot/src/App.js @@ -1,19 +1,11 @@ import React, { useState, useCallback, useEffect, useRef } from "react"; import useWebSocket from "react-use-websocket"; -import TakesGroupView from "./components/TakesGroupView"; -import PlayingCardsView from "./components/PlayingCardsView"; +import DeckView from "./components/DeckView"; +import PlayerCardsView from "./components/PlayerCardsView"; import reorderCards from "./utils/reorderCards"; import messageStore from "./utils/messageStore"; import playCard from "./utils/playCard"; -import { - Flex, - Spacer, - Text, - Grid, - GridItem, - VStack, - Box, -} from "@chakra-ui/react"; +import { Grid, GridItem, VStack, Box } from "@chakra-ui/react"; const WS_URL = "ws://127.0.0.1:7777/ws/100"; @@ -83,42 +75,19 @@ function App() { - - - Team a score - - {gametake ? {gametake} : null} - - Team b score - - {deck ? : null} - - - {takes ? ( - - ) : null} - {playingCards ? ( - - ) : null} - {cards ? ( - - ) : null} - + + diff --git a/baloot/src/components/DeckView.js b/baloot/src/components/DeckView.js new file mode 100644 index 0000000..76058f6 --- /dev/null +++ b/baloot/src/components/DeckView.js @@ -0,0 +1,19 @@ +import PlayingCardsView from "./PlayingCardsView"; +import { Box, Flex, Spacer, Text } from "@chakra-ui/react"; + +const DeckView = ({ deck, gametake }) => { + return ( + + + Team a score + + {gametake ? {gametake} : null} + + Team b score + + {deck ? : null} + + ); +}; + +export default DeckView; diff --git a/baloot/src/components/PlayerCardsView.js b/baloot/src/components/PlayerCardsView.js new file mode 100644 index 0000000..19cd5b9 --- /dev/null +++ b/baloot/src/components/PlayerCardsView.js @@ -0,0 +1,47 @@ +import TakesGroupView from "./TakesGroupView"; +import PlayingCardsView from "./PlayingCardsView"; +import { Box } from "@chakra-ui/react"; + +const PlayerCardsView = ({ + takes, + playingCards, + cards, + handleClickSendMessage, + playerID, + orderPlayingCards, + dragEnter, + dragStart, + handleClickPlayMessage, + drop, +}) => { + return ( + + {takes ? ( + + ) : null} + {playingCards ? ( + + ) : null} + {cards ? ( + + ) : null} + + ); +}; + +export default PlayerCardsView;