-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] show onboarding gudie when first time open
Signed-off-by: Kent Huang <kent@infuseai.io>
- Loading branch information
1 parent
7c3cbe9
commit 5c41559
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { Button, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalOverlay, Image, List, ListItem, Stack, Divider } from "@chakra-ui/react"; | ||
import React from "react"; | ||
import { useEffect, useState } from "react"; | ||
|
||
|
||
const OnboardingGuide = () => { | ||
const [isGuideOpen, setIsGuideOpen] = useState<boolean>(false); | ||
|
||
useEffect(() => { | ||
const hasVisited = localStorage.getItem("hasVisited"); | ||
if (!hasVisited) { | ||
setIsGuideOpen(true); | ||
localStorage.setItem("hasVisited", "true"); | ||
} | ||
}, []); | ||
|
||
const closeGuide = () => { | ||
setIsGuideOpen(false); | ||
} | ||
|
||
return ( | ||
<> | ||
<Modal isOpen={isGuideOpen} onClose={closeGuide}> | ||
<ModalOverlay /> | ||
<ModalContent maxW="80vw" h="80vh"> | ||
<ModalHeader>Welcome to Recce: 3 Steps to Begin</ModalHeader> | ||
<ModalCloseButton /> | ||
<ModalBody> | ||
<Stack spacing={4}> | ||
<List spacing={2}> | ||
<ListItem>Step 1: Click the model you want to check</ListItem> | ||
<ListItem>Step 2: Click "Explore Change"</ListItem> | ||
<ListItem>Step 3: Click "Add to Checklist"</ListItem> | ||
</List> | ||
<Divider /> | ||
<Image | ||
src="https://datarecce.io/assets/images/onboarding/material.svg" | ||
alt="placeholder" | ||
/> | ||
</Stack> | ||
</ModalBody> | ||
<ModalFooter> | ||
<Button colorScheme="blue" onClick={closeGuide}> | ||
Got it! | ||
</Button> | ||
</ModalFooter> | ||
</ModalContent> | ||
</Modal> | ||
</> | ||
); | ||
}; | ||
|
||
|
||
export default OnboardingGuide; | ||
|