- Created a Diagnostics component;
- Corrected the history code;
This commit is contained in:
@@ -11,6 +11,8 @@ import useStats from "@/hooks/useStats";
|
||||
import {averageScore, formatModuleTotalStats, totalExams} from "@/utils/stats";
|
||||
import {Divider} from "primereact/divider";
|
||||
import useUser from "@/hooks/useUser";
|
||||
import Diagnostic from "@/components/Diagnostic";
|
||||
import {ToastContainer} from "react-toastify";
|
||||
|
||||
export const getServerSideProps = withIronSessionSsr(({req, res}) => {
|
||||
const user = req.session.user;
|
||||
@@ -41,6 +43,25 @@ export default function Home() {
|
||||
useEffect(() => setShowEndExam(window.innerWidth <= 960), []);
|
||||
useEffect(() => setWindowWidth(window.innerWidth), []);
|
||||
|
||||
if (user && user.isFirstLogin) {
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>IELTS GPT | Muscat Training Institute</title>
|
||||
<meta
|
||||
name="description"
|
||||
content="A training platform for the IELTS exam provided by the Muscat Training Institute and developed by eCrop."
|
||||
/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
</Head>
|
||||
<main className="w-full h-full min-h-[100vh] flex flex-col items-center justify-center bg-neutral-100 text-black">
|
||||
<Diagnostic user={user} />
|
||||
</main>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
@@ -52,6 +73,7 @@ export default function Home() {
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
</Head>
|
||||
<ToastContainer />
|
||||
{user && (
|
||||
<main className="w-full h-full min-h-[100vh] flex flex-col items-center bg-neutral-100 text-black">
|
||||
<Navbar userType={user.type} profilePicture={user.profilePicture} showExamEnd={showEndExam} />
|
||||
|
||||
Reference in New Issue
Block a user