import { forwardRef, useEffect, useRef, useState } from "react"; import { useClickAway } from "react-use"; import classNames from "classnames"; import Image from "next/image"; import LinkComp from "next/link"; import { ChevronDownIcon, CheckCircleIcon, ArrowCircleLeftIcon, XIcon, ThumbUpIcon, } from "@heroicons/react/solid"; import { login, useUser } from "utils/auth"; import { Link } from "./link"; import { UserMenu } from "./user-menu"; import { FormattedMessage } from "react-intl"; const LINKS = [ { name: "navigation.menus.iconsEditor", link: "/icons-editor", icon: () => , }, { name: "navigation.menus.badgeEditor", link: "/badges-editor", icon: () => , }, { name: "navigation.menus.supportServer", link: "https://discord.gg/RX3QnVY4UA", icon: () => , }, ]; export const Navigation = () => { const { user } = useUser(); const [open, setOpen] = useState(false); const ref = useRef(null); useClickAway(ref, () => setOpen(false)); return ( discotools.xyz {/* */} {LINKS.map((link, i) => ( ))} {/* {user?.id ? ( ) : ( )} */} setOpen(true)} > setOpen(false)} /> ); }; export const NavigationMobile = forwardRef( ( { open, onClose, }: { open: boolean; onClose: () => void; }, ref ) => { const { user, logout } = useUser(); return ( {user?.id ? ( {user.username}#{user.discriminator} ) : ( )} {LINKS.map((link: any) => { const Component = link.comingSoong ? "div" : "a"; return ( {link.icon()} {link.comingSoon && ( )} ); })} {user?.id && ( )} discotools.xyz ); } );
{user.username}#{user.discriminator}