-
Notifications
You must be signed in to change notification settings - Fork 440
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e17a31b
commit 988fb66
Showing
3 changed files
with
65 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
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,61 @@ | ||
"use client" | ||
|
||
import { useDisclosure } from "@/hooks/useDisclosure" | ||
import { useEffect } from "react" | ||
import { useIsClient, useLocalStorage } from "usehooks-ts" | ||
import { Button } from "./ui/Button" | ||
import { | ||
Dialog, | ||
DialogBody, | ||
DialogContent, | ||
DialogFooter, | ||
DialogHeader, | ||
DialogTitle, | ||
} from "./ui/Dialog" | ||
|
||
const ANNOUNCEMENT_LOCALSTORAGE_ID = "announcement-lowered-nft-fees-2024-dec-11" | ||
|
||
export const AnnouncementDialog = () => { | ||
const { isOpen, onOpen, onClose } = useDisclosure() | ||
const isClient = useIsClient() | ||
|
||
const [hasSeenAnnouncement, setHasSeenAnnouncement] = useLocalStorage( | ||
ANNOUNCEMENT_LOCALSTORAGE_ID, | ||
false | ||
) | ||
|
||
useEffect(() => { | ||
if (!isClient || hasSeenAnnouncement) return | ||
onOpen() | ||
}, [isClient, hasSeenAnnouncement, onOpen]) | ||
|
||
return ( | ||
<Dialog open={isOpen}> | ||
<DialogContent size="md"> | ||
<DialogHeader> | ||
<DialogTitle>Minting fees reduced by 60% 🎉</DialogTitle> | ||
</DialogHeader> | ||
|
||
<DialogBody className="prose text-foreground"> | ||
<p> | ||
Building your onchain identity just got easier. Collect Guild Pins and | ||
NFT rewards and show off your favorite communities! | ||
</p> | ||
</DialogBody> | ||
|
||
<DialogFooter> | ||
<Button | ||
onClick={() => { | ||
setHasSeenAnnouncement(true) | ||
onClose() | ||
}} | ||
colorScheme="primary" | ||
className="w-full" | ||
> | ||
LFG 🚀 | ||
</Button> | ||
</DialogFooter> | ||
</DialogContent> | ||
</Dialog> | ||
) | ||
} |