Implemented the Reading and Listening initial screens according to the new designs, creating new components as needed

This commit is contained in:
Tiago Ribeiro
2023-06-15 14:43:29 +01:00
parent 65ebdd7dde
commit 2d46bad40f
13 changed files with 272 additions and 85 deletions

View File

@@ -5,7 +5,20 @@ import type {AppProps} from "next/app";
import "primereact/resources/themes/lara-light-indigo/theme.css";
import "primereact/resources/primereact.min.css";
import "primeicons/primeicons.css";
import {useRouter} from "next/router";
import {useEffect} from "react";
import useExamStore from "@/stores/examStore";
export default function App({Component, pageProps}: AppProps) {
const reset = useExamStore((state) => state.reset);
const router = useRouter();
useEffect(() => {
if (router.pathname !== "/exam") {
reset();
}
}, [router.pathname, reset]);
return <Component {...pageProps} />;
}

View File

@@ -209,7 +209,11 @@ export default function Page() {
<link rel="icon" href="/favicon.ico" />
</Head>
<ToastContainer />
{user && <Layout user={user}>{renderScreen()}</Layout>}
{user && (
<Layout user={user} className="justify-between">
{renderScreen()}
</Layout>
)}
</>
);
}

View File

@@ -127,11 +127,11 @@ export default function Page() {
<>
<div className="flex gap-4 items-center">
<span className="text-xs w-9">
{Math.round(recordingDuration / 60)
{Math.floor(recordingDuration / 60)
.toString(10)
.padStart(2, "0")}
:
{Math.round(recordingDuration % 60)
{Math.floor(recordingDuration % 60)
.toString(10)
.padStart(2, "0")}
</span>