Better layout
Some checks failed
Build Mau & Deploy Mau / build (push) Has been cancelled
Build Mau & Deploy Mau / deploy (push) Has been cancelled

This commit is contained in:
DTieman
2024-04-20 00:23:18 +02:00
parent e78d0d46f7
commit d547db430c
8 changed files with 50 additions and 13 deletions

View File

@@ -1,6 +1,10 @@
import React, {ButtonHTMLAttributes, DetailedHTMLProps, FunctionComponent} from "react"; import React, {ButtonHTMLAttributes, DetailedHTMLProps, FunctionComponent} from "react";
export const GHButton: FunctionComponent<DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>> = (props) => { interface ButtonProps extends DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> {
}
export const GHButton: FunctionComponent<ButtonProps> = (props) => {
const {className, ...rest} = props; const {className, ...rest} = props;
@@ -8,3 +12,12 @@ export const GHButton: FunctionComponent<DetailedHTMLProps<ButtonHTMLAttributes<
<button className={`gh-button ${className}`} {...rest}></button> <button className={`gh-button ${className}`} {...rest}></button>
); );
} }
export const NoButton: FunctionComponent<ButtonProps> = (props) => {
const {className, ...rest} = props;
return (
<button className={`no-button ${className}`} {...rest}></button>
);
}

View File

@@ -20,7 +20,7 @@ const Deck: FunctionComponent<Props> = ({currentCard, actionOnClick}) => {
</div> </div>
<div className="deck"> <div className="deck">
<p></p> <p></p>
<Card cardString={"AA BB"} handleClick={handleClick} isHidden={true}/> <Card cardString={"AA BB"} handleClick={handleClick} isHidden isClickable/>
</div> </div>
</div> </div>
); );

View File

@@ -2,6 +2,7 @@ import React from "react";
import useTitle from "../../utils/hooks/TitleHook"; import useTitle from "../../utils/hooks/TitleHook";
import Card from "../components/Card"; import Card from "../components/Card";
import {useNavigate} from "react-router"; import {useNavigate} from "react-router";
import {NoButton} from "../components/Button";
const ROOM_URL = `${process.env.REACT_APP_API_URL}/room`; const ROOM_URL = `${process.env.REACT_APP_API_URL}/room`;
@@ -23,14 +24,14 @@ const MainLobby = () => {
<div className={"main-lobby"}> <div className={"main-lobby"}>
<h1 className={"main-lobby__title mau"}>Mau-Mau</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}> <NoButton className={"main-lobby__container-button"} onClick={handleCreateRoom}>
<h2 className={"mau"}>Host Game</h2> <h2 className={"mau"}>Host Game</h2>
<Card cardString={'SPADES ACE'} isClickable/> <Card cardString={'SPADES ACE'} isClickable/>
</div> </NoButton>
<div className={"main-lobby__container-button clickable"} onClick={() => navigateTo('/rooms')}> <NoButton className={"main-lobby__container-button"} onClick={() => navigateTo('/rooms')}>
<h2 className={"mau"}>Join Game</h2> <h2 className={"mau"}>Join Game</h2>
<Card cardString={'SPADES ACE'} isHidden isClickable/> <Card cardString={'SPADES ACE'} isHidden isClickable/>
</div> </NoButton>
</div> </div>
</div> </div>
); );

View File

@@ -19,11 +19,11 @@ const Rooms = () => {
return ( return (
<div> <div>
<h1>Rooms</h1> <h1 className={"mau"}>Rooms</h1>
<ul> <ul>
{ {
rooms.map((room, index) => { rooms.map((room, index) => {
return <li key={index} className={"clickable"} return <li key={index} className={"mouse-pointer mau"}
onClick={() => navigateTo(`/room/${room}`)}>{room}</li> onClick={() => navigateTo(`/room/${room}`)}>{room}</li>
}) })
} }

View File

@@ -7,9 +7,21 @@
src: local('Mau'), url(../assets/fonts/OrientalCatsLight.otf) format('opentype'); src: local('Mau'), url(../assets/fonts/OrientalCatsLight.otf) format('opentype');
} }
.app { * {
width: 100vw; box-sizing: border-box;
height: 100vh; }
body {
margin: 0;
height: 100dvh;
width: 100dvw;
overflow: hidden;
}
#root, .app {
@extend .dark;
padding: 1rem;
height: 100%;
} }
.mau { .mau {

View File

@@ -54,3 +54,10 @@
display: none; display: none;
} }
} }
.no-button {
background-color: transparent;
border: none;
color: inherit;
cursor: pointer;
}

View File

@@ -1,5 +1,4 @@
.main-lobby { .main-lobby {
width: 100vw;
height: 75vh; height: 75vh;
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@@ -1,4 +1,9 @@
.clickable { .mouse-pointer {
cursor: pointer; cursor: pointer;
user-select: none; user-select: none;
} }
.mouse-default {
cursor: default;
user-select: none;
}