From 2eb05585f10013adaf13c46efab993e873f331d9 Mon Sep 17 00:00:00 2001 From: DTieman Date: Fri, 24 Mar 2023 18:51:14 +0100 Subject: [PATCH] fixed url --- .github/workflows/main.yml | 2 -- public/index.html | 4 ++-- src/layout/pages/MainLobby.tsx | 6 +++--- src/layout/pages/Rooms.tsx | 10 +++++++--- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ac51040..078a243 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,11 +4,9 @@ on: push: branches: - mauster - - developmaunt pull_request: branches: - mauster - - developmaunt workflow_dispatch: concurrency: diff --git a/public/index.html b/public/index.html index 5a82e15..7dbd459 100644 --- a/public/index.html +++ b/public/index.html @@ -5,10 +5,10 @@ - + - React App + Mau-Mau diff --git a/src/layout/pages/MainLobby.tsx b/src/layout/pages/MainLobby.tsx index 75f023a..5d1da54 100644 --- a/src/layout/pages/MainLobby.tsx +++ b/src/layout/pages/MainLobby.tsx @@ -6,7 +6,7 @@ const ROOM_URL = `http://${process.env.REACT_APP_API_URL}/room`; const MainLobby = () => { - useTitle('MauLobby'); + useTitle('Mau-Mau Lobby'); const handleCreateRoom = () => { fetch(ROOM_URL, { @@ -17,12 +17,12 @@ const MainLobby = () => { } const gotoRooms = () => { - window.location.href = '/rooms'; + window.location.host = '/rooms'; } return (
-

MauMau

+

Mau-Mau

Host Game

diff --git a/src/layout/pages/Rooms.tsx b/src/layout/pages/Rooms.tsx index 57412e1..2e11747 100644 --- a/src/layout/pages/Rooms.tsx +++ b/src/layout/pages/Rooms.tsx @@ -1,12 +1,11 @@ import useTitle from "../../utils/hooks/TitleHook"; import React from "react"; -import {Link} from "react-router-dom"; const ROOM_URL = `http://${process.env.REACT_APP_API_URL}/room`; const Rooms = () => { - useTitle('Rooms'); + useTitle('Mau-Mau Rooms'); const [rooms, setRooms] = React.useState([]); @@ -16,13 +15,18 @@ const Rooms = () => { .then(data => setRooms(data)); }, []); + const gotoRoom = (room: string) => { + window.location.host = `/room/${room}`; + } + return (

Rooms

    { rooms.map((room, index) => { - return
  • {room}
  • + return
  • gotoRoom(room)}>{room}
  • }) }