Skip to content

Commit

Permalink
added dark-mode compatible H1
Browse files Browse the repository at this point in the history
  • Loading branch information
shammy642 committed Oct 23, 2024
1 parent 9a68e6f commit 068b411
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 15 deletions.
7 changes: 7 additions & 0 deletions frontend/src/components/H1.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const H1 = ({ children }) => {
return (
<h1 data-testid="game-name" className="mb-2 text-2xl font-semibold tracking-tight text-gray-900 dark:text-white">
{ children }
</h1>
)
}
21 changes: 15 additions & 6 deletions frontend/src/pages/InGame.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,17 @@ import { CountdownCircleTimer } from "react-countdown-circle-timer";
import { Card } from "../components/Card";
import { Header } from "../components/Header";
import { Footer } from "../components/Footer";
import { H1 } from "../components/H1";

// in game page function
export function InGame({ players, redirect, pokemon, setRedirect, remainingTime }) {

// in game page function
export function InGame({
players,
redirect,
pokemon,
setRedirect,
remainingTime,
}) {
const [input, setInput] = useState("");
//const [buttonText, setButtonText] = useState("Guess");
const [showCheck, setShowCheck] = useState(false);
Expand All @@ -38,17 +45,19 @@ export function InGame({ players, redirect, pokemon, setRedirect, remainingTime

return (
<div className="full-page">
<Header/>
<Header />
<Card>
<h1 data-testid="guess-label">Poké Poké Guess Weight!</h1>
<H1>Poké Poké Guess Weight!</H1>
<div className="players_list m-3">
<ListPlayers players={players} />
</div>
<div className="flex justify-center">
<img src={pokemon.pictureURL} />
</div>
<div className="guess m-3">
<h1 className="text-xl mb-2">Guess <b>{pokemon.name}</b>&apos;s weight!:</h1>
<h1 className="text-xl mb-2">
Guess <b>{pokemon.name}</b>&apos;s weight!:
</h1>

<GuessForm input={input} setInput={setInput}></GuessForm>
<br></br>
Expand All @@ -75,7 +84,7 @@ export function InGame({ players, redirect, pokemon, setRedirect, remainingTime
</CountdownCircleTimer>
</div>
</Card>
<Footer/>
<Footer />
</div>
);
}
5 changes: 2 additions & 3 deletions frontend/src/pages/LandingHost.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { CardText } from "../components/CardText";
import { Card } from "../components/Card";
import { Header } from "../components/Header";
import { Footer } from "../components/Footer";
import { H1 } from "../components/H1";


// page function
Expand Down Expand Up @@ -46,9 +47,7 @@ export function LandingHost() {
<div className="full-page">
<Header/>
<Card>
<h1 data-testid="game-name" className="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white">
Poké Poké Guess Weight!
</h1>
<H1>Poké Poké Guess Weight!</H1>
<CardText>
<p>A quick-fire multiplayer game</p>
<div className="m-6 border-2 rounded-lg px-8 py-5">
Expand Down
5 changes: 2 additions & 3 deletions frontend/src/pages/LandingPlayer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ export function LandingPlayer() {
<div className="full-page">
<Header/>
<Card>
<h1 data-testid="game-name" className="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white">
Poké Poké Guess Weight!
</h1>
<H1>Poké Poké Guess Weight!</H1>

Check failure on line 54 in frontend/src/pages/LandingPlayer.jsx

View workflow job for this annotation

GitHub Actions / build

tests/pages/LandingPlayer.test.jsx > LandingPlayer tests > join room button is visible

ReferenceError: H1 is not defined ❯ LandingPlayer src/pages/LandingPlayer.jsx:54:8 ❯ renderWithHooks node_modules/react-dom/cjs/react-dom.development.js:15486:18 ❯ mountIndeterminateComponent node_modules/react-dom/cjs/react-dom.development.js:20103:13 ❯ beginWork node_modules/react-dom/cjs/react-dom.development.js:21626:16 ❯ beginWork$1 node_modules/react-dom/cjs/react-dom.development.js:27465:14 ❯ performUnitOfWork node_modules/react-dom/cjs/react-dom.development.js:26599:12 ❯ workLoopSync node_modules/react-dom/cjs/react-dom.development.js:26505:5 ❯ renderRootSync node_modules/react-dom/cjs/react-dom.development.js:26473:7 ❯ recoverFromConcurrentError node_modules/react-dom/cjs/react-dom.development.js:25889:20 ❯ performConcurrentWorkOnRoot node_modules/react-dom/cjs/react-dom.development.js:25789:22

Check failure on line 54 in frontend/src/pages/LandingPlayer.jsx

View workflow job for this annotation

GitHub Actions / build

tests/pages/LandingPlayer.test.jsx > LandingPlayer tests > a user can enter their name

ReferenceError: H1 is not defined ❯ LandingPlayer src/pages/LandingPlayer.jsx:54:8 ❯ renderWithHooks node_modules/react-dom/cjs/react-dom.development.js:15486:18 ❯ mountIndeterminateComponent node_modules/react-dom/cjs/react-dom.development.js:20103:13 ❯ beginWork node_modules/react-dom/cjs/react-dom.development.js:21626:16 ❯ beginWork$1 node_modules/react-dom/cjs/react-dom.development.js:27465:14 ❯ performUnitOfWork node_modules/react-dom/cjs/react-dom.development.js:26599:12 ❯ workLoopSync node_modules/react-dom/cjs/react-dom.development.js:26505:5 ❯ renderRootSync node_modules/react-dom/cjs/react-dom.development.js:26473:7 ❯ recoverFromConcurrentError node_modules/react-dom/cjs/react-dom.development.js:25889:20 ❯ performConcurrentWorkOnRoot node_modules/react-dom/cjs/react-dom.development.js:25789:22

Check failure on line 54 in frontend/src/pages/LandingPlayer.jsx

View workflow job for this annotation

GitHub Actions / build

tests/pages/LandingPlayer.test.jsx > LandingPlayer tests > when a user clicks on the button to start the game withour a username, they get an error

ReferenceError: H1 is not defined ❯ LandingPlayer src/pages/LandingPlayer.jsx:54:8 ❯ renderWithHooks node_modules/react-dom/cjs/react-dom.development.js:15486:18 ❯ mountIndeterminateComponent node_modules/react-dom/cjs/react-dom.development.js:20103:13 ❯ beginWork node_modules/react-dom/cjs/react-dom.development.js:21626:16 ❯ beginWork$1 node_modules/react-dom/cjs/react-dom.development.js:27465:14 ❯ performUnitOfWork node_modules/react-dom/cjs/react-dom.development.js:26599:12 ❯ workLoopSync node_modules/react-dom/cjs/react-dom.development.js:26505:5 ❯ renderRootSync node_modules/react-dom/cjs/react-dom.development.js:26473:7 ❯ recoverFromConcurrentError node_modules/react-dom/cjs/react-dom.development.js:25889:20 ❯ performConcurrentWorkOnRoot node_modules/react-dom/cjs/react-dom.development.js:25789:22

Check failure on line 54 in frontend/src/pages/LandingPlayer.jsx

View workflow job for this annotation

GitHub Actions / build

tests/pages/LandingPlayer.test.jsx > LandingPlayer tests > a join room button is visible

ReferenceError: H1 is not defined ❯ LandingPlayer src/pages/LandingPlayer.jsx:54:8 ❯ renderWithHooks node_modules/react-dom/cjs/react-dom.development.js:15486:18 ❯ mountIndeterminateComponent node_modules/react-dom/cjs/react-dom.development.js:20103:13 ❯ beginWork node_modules/react-dom/cjs/react-dom.development.js:21626:16 ❯ beginWork$1 node_modules/react-dom/cjs/react-dom.development.js:27465:14 ❯ performUnitOfWork node_modules/react-dom/cjs/react-dom.development.js:26599:12 ❯ workLoopSync node_modules/react-dom/cjs/react-dom.development.js:26505:5 ❯ renderRootSync node_modules/react-dom/cjs/react-dom.development.js:26473:7 ❯ recoverFromConcurrentError node_modules/react-dom/cjs/react-dom.development.js:25889:20 ❯ performConcurrentWorkOnRoot node_modules/react-dom/cjs/react-dom.development.js:25789:22

Check failure on line 54 in frontend/src/pages/LandingPlayer.jsx

View workflow job for this annotation

GitHub Actions / build

tests/pages/LandingPlayer.test.jsx > LandingPlayer tests > a user can enter a user name and join a game

ReferenceError: H1 is not defined ❯ LandingPlayer src/pages/LandingPlayer.jsx:54:8 ❯ renderWithHooks node_modules/react-dom/cjs/react-dom.development.js:15486:18 ❯ mountIndeterminateComponent node_modules/react-dom/cjs/react-dom.development.js:20103:13 ❯ beginWork node_modules/react-dom/cjs/react-dom.development.js:21626:16 ❯ beginWork$1 node_modules/react-dom/cjs/react-dom.development.js:27465:14 ❯ performUnitOfWork node_modules/react-dom/cjs/react-dom.development.js:26599:12 ❯ workLoopSync node_modules/react-dom/cjs/react-dom.development.js:26505:5 ❯ renderRootSync node_modules/react-dom/cjs/react-dom.development.js:26473:7 ❯ recoverFromConcurrentError node_modules/react-dom/cjs/react-dom.development.js:25889:20 ❯ performConcurrentWorkOnRoot node_modules/react-dom/cjs/react-dom.development.js:25789:22

Check failure on line 54 in frontend/src/pages/LandingPlayer.jsx

View workflow job for this annotation

GitHub Actions / build

tests/pages/LandingPlayer.test.jsx > LandingPlayer tests > when no parameter return to home page

ReferenceError: H1 is not defined ❯ LandingPlayer src/pages/LandingPlayer.jsx:54:8 ❯ renderWithHooks node_modules/react-dom/cjs/react-dom.development.js:15486:18 ❯ mountIndeterminateComponent node_modules/react-dom/cjs/react-dom.development.js:20103:13 ❯ beginWork node_modules/react-dom/cjs/react-dom.development.js:21626:16 ❯ beginWork$1 node_modules/react-dom/cjs/react-dom.development.js:27465:14 ❯ performUnitOfWork node_modules/react-dom/cjs/react-dom.development.js:26599:12 ❯ workLoopSync node_modules/react-dom/cjs/react-dom.development.js:26505:5 ❯ renderRootSync node_modules/react-dom/cjs/react-dom.development.js:26473:7 ❯ recoverFromConcurrentError node_modules/react-dom/cjs/react-dom.development.js:25889:20 ❯ performConcurrentWorkOnRoot node_modules/react-dom/cjs/react-dom.development.js:25789:22

<CardText>
<p>A quick-fire multiplayer game</p>
<div className="m-6 border-2 rounded-lg px-8 py-5">
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/pages/LobbyHost.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Card } from "../components/Card";
import { Header } from "../components/Header";
import { Footer } from "../components/Footer";
import CopyToClipboardButton from "../components/CopyToClipboardButton";
import { H1 } from "../components/H1";

export function LobbyHost({ gameRoom, players }) {
const navigate = useNavigate();
Expand All @@ -22,6 +23,7 @@ export function LobbyHost({ gameRoom, players }) {
<div className="full-page">
<Header/>
<Card>
<H1>Poké Poké Guess Weight!</H1>
<ListPlayers players={players} />
<br />
<Button handleClick={handleClick} buttonText="Start Game" />
Expand Down
5 changes: 2 additions & 3 deletions frontend/src/pages/LobbyPlayer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Footer } from "../components/Footer";
import { CardText } from "../components/CardText";
import CopyToClipboardButton from "../components/CopyToClipboardButton";
import { Card } from "../components/Card";
import { H1 } from "../components/H1";


export function LobbyPlayer({ gameRoom, players, redirect, setRedirect }) {
Expand All @@ -23,9 +24,7 @@ export function LobbyPlayer({ gameRoom, players, redirect, setRedirect }) {
<div className="full-page">
<Header/>
<Card>
<h1 data-testid="game-name" className="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white">
Poké Poké Guess Weight!
</h1>
<H1>Poké Poké Guess Weight!</H1>
<ListPlayers players = {players} />
<br/>
<CardText>
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/pages/RoundEnd.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { Card } from "../components/Card";
import { Table } from "../components/Table";
import { Header } from "../components/Header";
import { Footer } from "../components/Footer";
import { H1 } from "../components/H1";

export function RoundEnd({
gameState,
Expand Down Expand Up @@ -44,6 +45,7 @@ export function RoundEnd({
<div className="full-page">
<Header/>
<Card>
<H1>Poké Poké Guess Weight!</H1>
<div className="m-3">
<h2 className="text-2xl">Scores</h2>
{gameState && gameState.players && (
Expand Down

0 comments on commit 068b411

Please sign in to comment.