From 9acfb146abe3ae62b8d3ef06407ee2b5794dd3c9 Mon Sep 17 00:00:00 2001 From: Wilco Kruijer Date: Wed, 19 Feb 2020 16:51:31 +0100 Subject: [PATCH] Fix card responsiveness, flip beer --- frontend/src/App.tsx | 2 +- frontend/src/Wrapper.tsx | 2 +- frontend/src/components/Lobby.tsx | 11 +++-------- frontend/src/components/NextShot.tsx | 4 +--- frontend/src/css/lobby.sass | 3 +++ 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 626897a..08a8006 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -5,7 +5,7 @@ import Wrapper from "./Wrapper"; const App = () => { return ( - + ); diff --git a/frontend/src/Wrapper.tsx b/frontend/src/Wrapper.tsx index ed52bb9..1f7af76 100644 --- a/frontend/src/Wrapper.tsx +++ b/frontend/src/Wrapper.tsx @@ -21,7 +21,7 @@ const Wrapper = () => { } - const {socket} = useSocket("started", async (obj: any) => { + useSocket("started", async (obj: any) => { console.log("got started"); setStarted(true); diff --git a/frontend/src/components/Lobby.tsx b/frontend/src/components/Lobby.tsx index d6427bb..5c8b217 100644 --- a/frontend/src/components/Lobby.tsx +++ b/frontend/src/components/Lobby.tsx @@ -9,7 +9,6 @@ import {useSocket} from "use-socketio/lib"; const Lobby = (props: any) => { const [lobbyId, setLobbyId] = useQueryParam('lobby', NumberParam); const [isLeader, setIsLeader] = useState(false); - const [isRunning, setIsRunning] = useState(false); const [seekTime, setSeekTime] = useState(0); const [userCount, setUserCount] = useState(0); @@ -34,7 +33,6 @@ const Lobby = (props: any) => { const result: any = await emit(socket,'join_lobby', i); setIsLeader(socket.id === result.lobby.leaderId); setUserCount(result.lobby.users?.length || 0); - setIsRunning(result.lobby.running); } useEffect(() => { @@ -42,9 +40,6 @@ const Lobby = (props: any) => { const result: any = await emit(socketRef.current,'lobby_info'); setIsLeader(socketRef.current.id === result.lobby.leaderId); setUserCount(result.lobby.users?.length || 0); - setIsRunning(result.lobby.running); - - console.log("Got lobby_info"); } wrapper(); @@ -63,7 +58,7 @@ const Lobby = (props: any) => {

- beerCenturion! + beerCenturion! beer

@@ -74,8 +69,8 @@ const Lobby = (props: any) => {
Kun jij het aan?
- - + + { await emit(socket,'request_start', seekTime) diff --git a/frontend/src/components/NextShot.tsx b/frontend/src/components/NextShot.tsx index 367950d..d01c3f3 100644 --- a/frontend/src/components/NextShot.tsx +++ b/frontend/src/components/NextShot.tsx @@ -1,4 +1,4 @@ -import React, {useEffect, useRef, useState} from 'react'; +import React, {useRef, useState} from 'react'; import {Col, Progress} from "antd" import {Tick} from "../types/types"; import {useSocket} from "use-socketio/lib"; @@ -15,8 +15,6 @@ const NextShot = () => { return; } - console.log("Tick event from NextShot"); - if (fullTime.current === 0) { fullTime.current = tick.nextShot.timestamp - tick.current; } diff --git a/frontend/src/css/lobby.sass b/frontend/src/css/lobby.sass index 01ac8f3..4af8f95 100644 --- a/frontend/src/css/lobby.sass +++ b/frontend/src/css/lobby.sass @@ -12,3 +12,6 @@ font-size: 1.3rem margin-top: 10em box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24) + +.beer-flipped + transform: scaleX(-1) \ No newline at end of file