From fba0187b2cfc49684ec956ac88df4cc70332c337 Mon Sep 17 00:00:00 2001 From: keyan Date: Tue, 23 Aug 2022 17:34:51 -0500 Subject: [PATCH] add link to recent/comments --- components/header.js | 28 +++++++++++++++------------- components/recent-header.js | 35 +++++++++++++++++++++++++++++++++++ package.json | 4 ++-- pages/recent/comments.js | 2 ++ pages/recent/index.js | 2 ++ 5 files changed, 56 insertions(+), 15 deletions(-) create mode 100644 components/recent-header.js diff --git a/components/header.js b/components/header.js index af513114..66593564 100644 --- a/components/header.js +++ b/components/header.js @@ -27,6 +27,8 @@ export default function Header ({ sub }) { const [fired, setFired] = useState() const me = useMe() const prefix = sub ? `/~${sub}` : '' + // there's always at least 2 on the split, e.g. '/' yields ['',''] + const topNavKey = path.split('/')[sub ? 2 : 1] const { data: subLatestPost } = useQuery(gql` query subLatestPost($name: ID!) { subLatestPost(name: $name) @@ -53,7 +55,7 @@ export default function Header ({ sub }) { - + {me?.hasNewNotes && @@ -65,12 +67,12 @@ export default function Header ({ sub }) { - e.preventDefault()}>{`@${me?.name}`} + e.preventDefault()}>{`@${me?.name}`} } alignRight > - + profile {me && !me.bioId &&
@@ -79,14 +81,14 @@ export default function Header ({ sub }) { - wallet + wallet - satistics + satistics - invites + invites {me && !me.hasInvites &&
{' '} @@ -96,7 +98,7 @@ export default function Header ({ sub }) {
- settings + settings
@@ -110,7 +112,7 @@ export default function Header ({ sub }) { {me && - + }
@@ -132,13 +134,13 @@ export default function Header ({ sub }) { <> - recent + recent {!prefix && - top + top } @@ -157,7 +159,7 @@ export default function Header ({ sub }) { {me && - post + post } @@ -170,7 +172,7 @@ export default function Header ({ sub }) {