Increase the size and boldness of the timer
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import useExamStore from "@/stores/examStore";
|
||||
import { useEffect, useState } from "react";
|
||||
import { motion } from "framer-motion";
|
||||
import {useEffect, useState} from "react";
|
||||
import {motion} from "framer-motion";
|
||||
import TimerEndedModal from "../TimerEndedModal";
|
||||
import clsx from "clsx";
|
||||
import { BsStopwatch } from "react-icons/bs";
|
||||
import {BsStopwatch} from "react-icons/bs";
|
||||
|
||||
interface Props {
|
||||
minTimer: number;
|
||||
@@ -17,7 +17,7 @@ const Timer: React.FC<Props> = ({minTimer, disableTimer, standalone = false}) =>
|
||||
const [warningMode, setWarningMode] = useState(false);
|
||||
|
||||
const setHasExamEnded = useExamStore((state) => state.setHasExamEnded);
|
||||
const { timeSpent } = useExamStore((state) => state);
|
||||
const {timeSpent} = useExamStore((state) => state);
|
||||
|
||||
useEffect(() => setTimer((prev) => prev - timeSpent), [timeSpent]);
|
||||
|
||||
@@ -54,11 +54,11 @@ const Timer: React.FC<Props> = ({minTimer, disableTimer, standalone = false}) =>
|
||||
standalone ? "top-10" : "top-4",
|
||||
warningMode && !disableTimer && "bg-mti-red-light text-mti-gray-seasalt",
|
||||
)}
|
||||
initial={{ scale: warningMode && !disableTimer ? 0.8 : 1 }}
|
||||
animate={{ scale: warningMode && !disableTimer ? 1.1 : 1 }}
|
||||
transition={{ repeat: Infinity, repeatType: "reverse", duration: 0.5, ease: "easeInOut" }}>
|
||||
initial={{scale: warningMode && !disableTimer ? 0.8 : 1}}
|
||||
animate={{scale: warningMode && !disableTimer ? 1.1 : 1}}
|
||||
transition={{repeat: Infinity, repeatType: "reverse", duration: 0.5, ease: "easeInOut"}}>
|
||||
<BsStopwatch className="w-6 h-6" />
|
||||
<span className="text-base font-semibold w-12">
|
||||
<span className="text-lg font-bold w-12">
|
||||
{timer > 0 && (
|
||||
<>
|
||||
{Math.floor(timer / 60)
|
||||
@@ -75,6 +75,6 @@ const Timer: React.FC<Props> = ({minTimer, disableTimer, standalone = false}) =>
|
||||
</motion.div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export default Timer;
|
||||
|
||||
@@ -437,7 +437,6 @@ export default function MasterCorporateDashboard({ user }: Props) {
|
||||
|
||||
const { data: stats } = useFilterRecordsByUser<Stat[]>();
|
||||
const { users, reload } = useUsers();
|
||||
const { codes } = useCodes(user.id);
|
||||
const { groups } = useGroups({ admin: user.id, userType: user.type });
|
||||
const { balance } = useUserBalance();
|
||||
|
||||
@@ -447,9 +446,9 @@ export default function MasterCorporateDashboard({ user }: Props) {
|
||||
),
|
||||
], [groups, user.id]);
|
||||
|
||||
const corporateUserGroups = [
|
||||
const corporateUserGroups = useMemo(() => [
|
||||
...new Set(groups.flatMap((g) => g.participants)),
|
||||
];
|
||||
], [groups])
|
||||
|
||||
const {
|
||||
assignments,
|
||||
|
||||
Reference in New Issue
Block a user