fixed url
This commit is contained in:
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@@ -4,11 +4,9 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- mauster
|
- mauster
|
||||||
- developmaunt
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- mauster
|
- mauster
|
||||||
- developmaunt
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
|
|||||||
@@ -5,10 +5,10 @@
|
|||||||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<meta name="theme-color" content="#000000" />
|
<meta name="theme-color" content="#000000" />
|
||||||
<meta name="description" content="Web site created using create-react-app"/>
|
<meta name="description" content="Mau-Mau!"/>
|
||||||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
||||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
||||||
<title>React App</title>
|
<title>Mau-Mau</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ const ROOM_URL = `http://${process.env.REACT_APP_API_URL}/room`;
|
|||||||
|
|
||||||
const MainLobby = () => {
|
const MainLobby = () => {
|
||||||
|
|
||||||
useTitle('MauLobby');
|
useTitle('Mau-Mau Lobby');
|
||||||
|
|
||||||
const handleCreateRoom = () => {
|
const handleCreateRoom = () => {
|
||||||
fetch(ROOM_URL, {
|
fetch(ROOM_URL, {
|
||||||
@@ -17,12 +17,12 @@ const MainLobby = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const gotoRooms = () => {
|
const gotoRooms = () => {
|
||||||
window.location.href = '/rooms';
|
window.location.host = '/rooms';
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={"main-lobby"}>
|
<div className={"main-lobby"}>
|
||||||
<h1 className={"main-lobby__title mau"}>MauMau</h1>
|
<h1 className={"main-lobby__title mau"}>Mau-Mau</h1>
|
||||||
<div className={"main-lobby__container"}>
|
<div className={"main-lobby__container"}>
|
||||||
<div className={"main-lobby__container-button clickable"} onClick={handleCreateRoom}>
|
<div className={"main-lobby__container-button clickable"} onClick={handleCreateRoom}>
|
||||||
<h2 className={"mau"}>Host Game</h2>
|
<h2 className={"mau"}>Host Game</h2>
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import useTitle from "../../utils/hooks/TitleHook";
|
import useTitle from "../../utils/hooks/TitleHook";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import {Link} from "react-router-dom";
|
|
||||||
|
|
||||||
const ROOM_URL = `http://${process.env.REACT_APP_API_URL}/room`;
|
const ROOM_URL = `http://${process.env.REACT_APP_API_URL}/room`;
|
||||||
|
|
||||||
const Rooms = () => {
|
const Rooms = () => {
|
||||||
|
|
||||||
useTitle('Rooms');
|
useTitle('Mau-Mau Rooms');
|
||||||
|
|
||||||
const [rooms, setRooms] = React.useState<string[]>([]);
|
const [rooms, setRooms] = React.useState<string[]>([]);
|
||||||
|
|
||||||
@@ -16,13 +15,18 @@ const Rooms = () => {
|
|||||||
.then(data => setRooms(data));
|
.then(data => setRooms(data));
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const gotoRoom = (room: string) => {
|
||||||
|
window.location.host = `/room/${room}`;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<h1>Rooms</h1>
|
<h1>Rooms</h1>
|
||||||
<ul>
|
<ul>
|
||||||
{
|
{
|
||||||
rooms.map((room, index) => {
|
rooms.map((room, index) => {
|
||||||
return <li key={index}><Link to={`room/${room}`}>{room}</Link></li>
|
return <li key={index} className={"clickable"}
|
||||||
|
onClick={() => gotoRoom(room)}>{room}</li>
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
Reference in New Issue
Block a user