-
Zeitgeist
+
Zeitgeist
{chainProperties.tokenSymbol.toString()}
diff --git a/components/top-bar/Alerts.tsx b/components/top-bar/Alerts.tsx
new file mode 100644
index 000000000..1646e2e71
--- /dev/null
+++ b/components/top-bar/Alerts.tsx
@@ -0,0 +1,232 @@
+import { Menu, Transition, Portal } from "@headlessui/react";
+import Modal from "components/ui/Modal";
+import {
+ ReadyToReportMarketAlertData,
+ RedeemableMarketsAlertData,
+ RelevantMarketDisputeAlertData,
+ useAlerts,
+} from "lib/state/alerts";
+import { useWallet } from "lib/state/wallet";
+import { useRouter } from "next/router";
+import { Fragment, PropsWithChildren, useEffect, useState } from "react";
+import { AiOutlineFileAdd } from "react-icons/ai";
+import { BiMoneyWithdraw } from "react-icons/bi";
+import { IoMdNotificationsOutline } from "react-icons/io";
+
+export const Alerts = () => {
+ const wallet = useWallet();
+ const { alerts, setAsRead } = useAlerts(wallet.realAddress);
+
+ const hasNotifications = alerts.length > 0;
+
+ const [hoveringMenu, setHoveringMenu] = useState(false);
+
+ const mouseEnterMenuHandler = () => {
+ setHoveringMenu(true);
+ };
+ const mouseLeaveMenuHandler = () => {
+ setHoveringMenu(false);
+ };
+
+ return (
+
+ );
+};
+
+const AlertCard: React.FC
void }> = ({
+ children,
+ onClick,
+}) => (
+
+);
+
+const ReadyToReportMarketAlertItem = ({
+ alert,
+}: {
+ alert: ReadyToReportMarketAlertData;
+}) => {
+ const router = useRouter();
+
+ useEffect(() => {
+ router.prefetch(`/markets/${alert.market.marketId}`);
+ }, [alert]);
+
+ return (
+ {
+ router.push(`/markets/${alert.market.marketId}`);
+ }}
+ >
+
+
+
{alert.market.question}
+
+
+ );
+};
+
+const RedeemableMarketAlertItem = ({
+ alert,
+}: {
+ alert: RedeemableMarketsAlertData;
+}) => {
+ const router = useRouter();
+ const wallet = useWallet();
+
+ useEffect(() => {
+ router.prefetch(`/portfolio/${wallet.realAddress}`);
+ }, [alert, wallet.realAddress]);
+
+ return (
+ {
+ router.push(`/portfolio/${wallet.realAddress}`);
+ }}
+ >
+
+
+
+ Redeemable Tokens
+
+
+
+
+ You have {alert.markets.length} redeemable markets.
+
+
+
+ );
+};
+
+const RelevantMarketDisputeItem = ({
+ alert,
+}: {
+ alert: RelevantMarketDisputeAlertData;
+}) => {
+ return ;
+};
+
+/**
+ * @note Since the param here is `never` it prevents us from forgetting to add a case for a new alert type
+ * If a case for a alert type is missing in the rendering of the list, the compiler will complain.
+ */
+const UnknownAlertItem = ({ alert }: { alert: never }) => {
+ return <>>;
+};
diff --git a/components/menu/MenuItem.tsx b/components/top-bar/MenuItem.tsx
similarity index 100%
rename from components/menu/MenuItem.tsx
rename to components/top-bar/MenuItem.tsx
diff --git a/components/menu/MenuLogo.tsx b/components/top-bar/MenuLogo.tsx
similarity index 100%
rename from components/menu/MenuLogo.tsx
rename to components/top-bar/MenuLogo.tsx
diff --git a/components/menu/Navigation.tsx b/components/top-bar/Navigation.tsx
similarity index 100%
rename from components/menu/Navigation.tsx
rename to components/top-bar/Navigation.tsx
diff --git a/components/menu/index.tsx b/components/top-bar/index.tsx
similarity index 98%
rename from components/menu/index.tsx
rename to components/top-bar/index.tsx
index 290fbc9ff..6e5d05e8d 100644
--- a/components/menu/index.tsx
+++ b/components/top-bar/index.tsx
@@ -2,7 +2,7 @@ import { Fragment, useState } from "react";
import { Menu, Transition } from "@headlessui/react";
import { CATEGORIES } from "components/front-page/PopularCategories";
-import MenuLogo from "components/menu/MenuLogo";
+import MenuLogo from "components/top-bar/MenuLogo";
import dynamic from "next/dynamic";
import Image from "next/image";
import Link from "next/link";
@@ -17,6 +17,7 @@ import {
FiList,
} from "react-icons/fi";
import { useCategoryCounts } from "lib/hooks/queries/useCategoryCounts";
+import { Alerts } from "./Alerts";
const AccountButton = dynamic(() => import("../account/AccountButton"), {
ssr: false,
@@ -158,7 +159,10 @@ const TopBar = () => {
Leaderboard