import Navbar from 'react-bootstrap/Navbar' import Nav from 'react-bootstrap/Nav' import Link from 'next/link' import styles from './header.module.css' import { useRouter } from 'next/router' import { Button, Container, NavDropdown } from 'react-bootstrap' import Price from './price' import { useMe } from './me' import { useApolloClient } from '@apollo/client' import Head from 'next/head' import { signOut, signIn, useSession } from 'next-auth/client' function WalletSummary ({ me }) { return `[${me.stacked},${me.sats}]` } export default function Header () { const [session, loading] = useSession() const router = useRouter() const path = router.asPath.split('?')[0] const me = useMe() const client = useApolloClient() const Corner = () => { if (loading) { return null } if (session) { return (
{me && me.hasNewNotes && }
profile { // when it's a fresh click evict old notification cache client.cache.evict({ id: 'ROOT_QUERY', fieldName: 'moreFlatComments:{}' }) client.cache.evict({ id: 'ROOT_QUERY', fieldName: 'recentlyStacked' }) }} > notifications {me && me.hasNewNotes &&
{' '}
}
wallet
recent {session ? ( post ) : post} jobs
logout
{me && me.hasNewNotes && {' '} }
{me && }
) } else { return path !== '/login' && } } return ( <> ) } export function HeaderPreview () { return ( <> ) }