From 6424ea86694a50a3007fb3bb5c320b88cb16da2e Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Wed, 12 Jun 2024 21:11:30 +0800 Subject: [PATCH] Fix slugs for opening articles --- .../web/components/nav-containers/home.tsx | 34 ++++++++++++++----- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/packages/web/components/nav-containers/home.tsx b/packages/web/components/nav-containers/home.tsx index 2f07ffa5c..3d1029ab8 100644 --- a/packages/web/components/nav-containers/home.tsx +++ b/packages/web/components/nav-containers/home.tsx @@ -26,12 +26,18 @@ import { } from '../../lib/networking/queries/useGetSubscriptionsQuery' import { Box, HStack, SpanBox, VStack } from '../elements/LayoutPrimitives' import { Toaster } from 'react-hot-toast' -import Link from 'next/link' +import { useGetViewerQuery } from '../../lib/networking/queries/useGetViewerQuery' export function HomeContainer(): JSX.Element { const homeData = useGetHomeItems() + const { viewerData } = useGetViewerQuery() + useApplyLocalTheme() + const viewerUsername = useMemo(() => { + return viewerData?.me?.profile.username + }, [viewerData]) + return ( ) case 'top_picks': @@ -72,6 +79,7 @@ export function HomeContainer(): JSX.Element { ) case 'quick_links': @@ -79,6 +87,7 @@ export function HomeContainer(): JSX.Element { ) case 'hidden': @@ -86,6 +95,7 @@ export function HomeContainer(): JSX.Element { ) default: @@ -99,9 +109,11 @@ export function HomeContainer(): JSX.Element { type HomeSectionProps = { homeSection: HomeSection + viewerUsername: string | undefined } const JustAddedHomeSection = (props: HomeSectionProps): JSX.Element => { + const router = useRouter() return ( {