import { useState, useEffect } from "react"; import { Alert, AlertIcon, CloseButton, Text, Link, HStack, } from "@chakra-ui/react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faDiscord } from "@fortawesome/free-brands-svg-icons"; import { ExternalLinkIcon } from "@chakra-ui/icons"; const CLOSED_KEY = "discord-notif-closed"; function NotificationBar() { const isClosed = localStorage.getItem(CLOSED_KEY); const [isVisible, setIsVisible] = useState( isClosed === "true" ? false : true ); useEffect(() => { if (!isVisible) { localStorage.setItem(CLOSED_KEY, "true"); } }, [isVisible]); return isVisible ? ( Share feature requests, report bugs and be the first to{" "} try beta versions by joining us on Discord setIsVisible(false)} /> ) : ( <> ); } export default NotificationBar;