43 lines
1.4 KiB
TypeScript
43 lines
1.4 KiB
TypeScript
"use client";
|
|
|
|
import { ChangeEvent, ReactElement, useEffect, useRef, useState } from "react";
|
|
import Image from "next/image";
|
|
import styles from "./page.module.css";
|
|
import ChargedButton from "@/components/ChargedButton";
|
|
import MapView from "@/components/MapView";
|
|
import WelcomeScreen from "@/components/screens/WelcomeScreen";
|
|
import Intro from "@/components/screens/Intro";
|
|
import { useLocalStorage } from "@/hooks/useLocalStorage";
|
|
import { PREF } from "@/utils/const";
|
|
import { Player } from "@/types/player";
|
|
import { formatPlayerData, parsePlayerData } from "@/utils/dataparser";
|
|
import { parse } from "path";
|
|
import Tour from "@/components/screens/Tour";
|
|
import clsx from "clsx";
|
|
import StyledContainer from "@/components/StyledContainer";
|
|
|
|
export default function Main() {
|
|
const [ stepStr, setStep ] = useLocalStorage(PREF.step, "0");
|
|
const [ players, setPlayers ] = useLocalStorage(PREF.players, "");
|
|
const [ tourCode, setTourCode ] = useLocalStorage(PREF.code, "");
|
|
const step = Number.parseInt(stepStr) || 0;
|
|
|
|
/*console.log("STEP", step);
|
|
console.log("PLAYERS", players, parsePlayerData(players));
|
|
console.log("TourCode", tourCode);*/
|
|
|
|
const content = [
|
|
(<WelcomeScreen key={0}/>),
|
|
(<Intro key={1} />),
|
|
(<Tour key={2} />)
|
|
];
|
|
|
|
return (
|
|
<div className={clsx(styles.page, "lancelot-regular")}>
|
|
<main className={styles.main}>
|
|
{content[step]}
|
|
</main>
|
|
</div>
|
|
);
|
|
}
|