diff --git a/src/app/components/Header.tsx b/src/app/components/Header.tsx index f5be7b1..96b055e 100644 --- a/src/app/components/Header.tsx +++ b/src/app/components/Header.tsx @@ -1,3 +1,4 @@ +import { GOAL_AMOUNT } from "@/consts"; import { useLanguage } from "@/LanguageContext"; import { translations } from "@/translations"; @@ -7,7 +8,7 @@ const Header = () => { return (

- {t.appTitle.split(" ")[0]} 100 {t.norwegians} + {t.appTitle.split(" ")[0]} {GOAL_AMOUNT} {t.norwegians}

); diff --git a/src/app/components/Score.tsx b/src/app/components/Score.tsx index 17a7fa7..7bd1230 100644 --- a/src/app/components/Score.tsx +++ b/src/app/components/Score.tsx @@ -1,3 +1,4 @@ +import { GOAL_AMOUNT } from "@/consts"; import React from "react"; interface ScoreProps { @@ -7,7 +8,7 @@ interface ScoreProps { const Score: React.FC = ({ matchesCount }) => { return (

- {matchesCount} / 100 + {matchesCount} / {GOAL_AMOUNT}

); }; diff --git a/src/app/consts.ts b/src/app/consts.ts new file mode 100644 index 0000000..71fdfb7 --- /dev/null +++ b/src/app/consts.ts @@ -0,0 +1 @@ +export const GOAL_AMOUNT = 2; diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 3fa21e8..0abd699 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -2,8 +2,8 @@ import "@/globals.css"; import type { Metadata } from "next"; export const metadata: Metadata = { - title: "Name 100 Norwegians", - description: "How fast can you name 100 Norwegian people?", + title: "Name 2 Norwegians", + description: "How fast can you name 2 Norwegian people?", }; export default function RootLayout({ diff --git a/src/app/page.tsx b/src/app/page.tsx index 4e29b4d..8964cf5 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,5 +1,6 @@ "use client"; +import { GOAL_AMOUNT } from "@/consts"; import { LanguageProvider, useLanguage } from "@/LanguageContext"; import { translations } from "@/translations"; import React, { useMemo, useRef, useState } from "react"; @@ -58,7 +59,7 @@ function Home() { // Stop timer when 100 correct guesses are made React.useEffect(() => { - if (correctMatchesCount === 100) { + if (correctMatchesCount === GOAL_AMOUNT) { stopTimer(); } }, [correctMatchesCount]); @@ -122,7 +123,7 @@ function Home() { setRepeatMessage(""); }} onSubmit={handleSubmit} - disabled={correctMatchesCount === 100} + disabled={correctMatchesCount === GOAL_AMOUNT} /> {repeatMessage &&
{repeatMessage}
} diff --git a/src/app/translations.ts b/src/app/translations.ts index f98021b..1737c3e 100644 --- a/src/app/translations.ts +++ b/src/app/translations.ts @@ -8,8 +8,8 @@ export const translations = { howToPlay1: "Any real Norwegian person listed on Store Norske Leksikon should be accepted.", howToPlay2: "No repeats allowed.", howToPlay3: "The timer starts once you make your first correct guess.", - appTitle: "Name 100 Norwegians", - appDescription: "How fast can you name 100 Norwegian people?", + appTitle: "Name Norwegians", + appDescription: "How fast can you name 2 Norwegian people?", madeBy: "Made by", sourceCode: "Source code", norwegians: "Norwegians", @@ -23,8 +23,8 @@ export const translations = { howToPlay1: "Alle ekte norske personer som har en side om seg på Store Norske Leksikon bør godtas.", howToPlay2: "Du kan ikke gjenta navn.", howToPlay3: "Tiden starter første gang du skriver et godkjent navn.", - appTitle: "Navngi 100 nordmenn", - appDescription: "Hvor raskt kan du navngi 100 nordmenn?", + appTitle: "Navngi nordmenn", + appDescription: "Hvor raskt kan du navngi 2 nordmenn?", madeBy: "Laget av", sourceCode: "Kildekode", norwegians: "Nordmenn",