Better layout
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
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;
|
||||
|
||||
@@ -8,3 +12,12 @@ export const GHButton: FunctionComponent<DetailedHTMLProps<ButtonHTMLAttributes<
|
||||
<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>
|
||||
);
|
||||
}
|
||||
@@ -20,7 +20,7 @@ const Deck: FunctionComponent<Props> = ({currentCard, actionOnClick}) => {
|
||||
</div>
|
||||
<div className="deck">
|
||||
<p></p>
|
||||
<Card cardString={"AA BB"} handleClick={handleClick} isHidden={true}/>
|
||||
<Card cardString={"AA BB"} handleClick={handleClick} isHidden isClickable/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -2,6 +2,7 @@ import React from "react";
|
||||
import useTitle from "../../utils/hooks/TitleHook";
|
||||
import Card from "../components/Card";
|
||||
import {useNavigate} from "react-router";
|
||||
import {NoButton} from "../components/Button";
|
||||
|
||||
const ROOM_URL = `${process.env.REACT_APP_API_URL}/room`;
|
||||
|
||||
@@ -23,14 +24,14 @@ const MainLobby = () => {
|
||||
<div className={"main-lobby"}>
|
||||
<h1 className={"main-lobby__title mau"}>Mau-Mau</h1>
|
||||
<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>
|
||||
<Card cardString={'SPADES ACE'} isClickable/>
|
||||
</div>
|
||||
<div className={"main-lobby__container-button clickable"} onClick={() => navigateTo('/rooms')}>
|
||||
</NoButton>
|
||||
<NoButton className={"main-lobby__container-button"} onClick={() => navigateTo('/rooms')}>
|
||||
<h2 className={"mau"}>Join Game</h2>
|
||||
<Card cardString={'SPADES ACE'} isHidden isClickable/>
|
||||
</div>
|
||||
</NoButton>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -19,11 +19,11 @@ const Rooms = () => {
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h1>Rooms</h1>
|
||||
<h1 className={"mau"}>Rooms</h1>
|
||||
<ul>
|
||||
{
|
||||
rooms.map((room, index) => {
|
||||
return <li key={index} className={"clickable"}
|
||||
return <li key={index} className={"mouse-pointer mau"}
|
||||
onClick={() => navigateTo(`/room/${room}`)}>{room}</li>
|
||||
})
|
||||
}
|
||||
|
||||
@@ -7,9 +7,21 @@
|
||||
src: local('Mau'), url(../assets/fonts/OrientalCatsLight.otf) format('opentype');
|
||||
}
|
||||
|
||||
.app {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
height: 100dvh;
|
||||
width: 100dvw;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#root, .app {
|
||||
@extend .dark;
|
||||
padding: 1rem;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.mau {
|
||||
|
||||
@@ -54,3 +54,10 @@
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.no-button {
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
color: inherit;
|
||||
cursor: pointer;
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
.main-lobby {
|
||||
width: 100vw;
|
||||
height: 75vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
.clickable {
|
||||
.mouse-pointer {
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.mouse-default {
|
||||
cursor: default;
|
||||
user-select: none;
|
||||
}
|
||||
Reference in New Issue
Block a user