uses localStorage to show modal

This commit is contained in:
rsandb
2023-01-14 03:08:07 -06:00
parent dbaa3eecf8
commit a57ab054f0
@@ -13,7 +13,7 @@ import {
useColorModeValue,
} from "@chakra-ui/react";
import { useSession } from "next-auth/react";
import { useState } from "react";
import { useState, useEffect } from "react";
export function WelcomeModal() {
const backgroundColor = useColorModeValue("white", "gray.700");
@@ -21,6 +21,15 @@ export function WelcomeModal() {
const [showModal, setShowModal] = useState(true);
// useEffect(() => {
// if (!localStorage.getItem("welcomeModalSeen")) {
// setShowModal(true);
// localStorage.setItem("welcomeModalSeen", "true");
// } else {
// setShowModal(false);
// }
// }, []);
if (!session) {
return <></>;
}
@@ -39,7 +48,7 @@ export function WelcomeModal() {
understand and respond to humans.
</Text>
<Divider my="4" />
<Text>Do tasks to help train the model and earn points based on the amount of tasks you do.</Text>
<Text>Complete tasks to help train the model and earn points!</Text>
</Box>
</ModalBody>
<ModalFooter>