diff --git a/packages/web/components/templates/homeFeed/HighlightsLayout.tsx b/packages/web/components/templates/homeFeed/HighlightsLayout.tsx
index 3532149fb..d892ffec7 100644
--- a/packages/web/components/templates/homeFeed/HighlightsLayout.tsx
+++ b/packages/web/components/templates/homeFeed/HighlightsLayout.tsx
@@ -1,4 +1,5 @@
import dayjs from 'dayjs'
+import { useRouter } from 'next/router'
import { DotsThreeVertical, HighlighterCircle } from 'phosphor-react'
import { Fragment, useEffect, useMemo, useState } from 'react'
import { Highlight } from '../../../lib/networking/fragments/highlightFragment'
@@ -265,7 +266,12 @@ function HighlightItemsCard(props: HighlightItemsCardProps): JSX.Element {
{(props.item.node.highlights ?? []).map((highlight) => (
-
+
))}
@@ -284,9 +290,12 @@ const StyledQuote = styled(Blockquote, {
type HighlightItemCardProps = {
highlight: Highlight
+ viewer: UserBasicData | undefined
+ item: LibraryItem
}
function HighlightItemCard(props: HighlightItemCardProps): JSX.Element {
+ const router = useRouter()
const [hover, setHover] = useState(false)
const [isEditing, setIsEditing] = useState(false)
@@ -297,9 +306,16 @@ function HighlightItemCard(props: HighlightItemCardProps): JSX.Element {
return (
setHover(true)}
onMouseLeave={() => setHover(false)}
+ onClick={(event) => {
+ if (router && props.viewer) {
+ const dest = `/${props.viewer}/${props.item.node.slug}#${props.highlight.id}`
+ router.push(dest)
+ }
+ event.preventDefault()
+ }}
>