@@ -2,14 +2,13 @@ import {Lover} from 'common/love/lover'
22import { CompatibilityScore } from 'common/love/compatibility-score'
33import { LoadingIndicator } from 'web/components/widgets/loading-indicator'
44import { LoadMoreUntilNotVisible } from 'web/components/widgets/visibility-observer'
5- import { useUser } from 'web/hooks/use-user'
65import { track } from 'web/lib/service/analytics'
76import { Col } from './layout/col'
87import clsx from 'clsx'
98import { JSONContent } from "@tiptap/core" ;
109import { Content } from "web/components/widgets/editor" ;
1110import React from "react" ;
12- import Router from "next/router " ;
11+ import Link from "next/link " ;
1312
1413export const ProfileGrid = ( props : {
1514 lovers : Lover [ ]
@@ -75,11 +74,9 @@ function ProfilePreview(props: {
7574 // const currentUser = useUser()
7675
7776 return (
78- < div
79- onClick = { ( ) => {
80- track ( 'click love profile preview' )
81- Router . push ( `/${ user . username } ` )
82- } }
77+ < Link
78+ onClick = { ( ) => track ( 'click love profile preview' ) }
79+ href = { `/${ user . username } ` }
8380 className = "cursor-pointer group block dark:bg-gray-800 rounded-lg overflow-hidden shadow hover:shadow-md transition-shadow duration-200 h-full"
8481 >
8582 < Col
@@ -125,6 +122,7 @@ function ProfilePreview(props: {
125122 { user . name }
126123 </ h3 >
127124 < div className = "text-sm text-gray-500 dark:text-gray-400" >
125+ { /*TODO: fix nested <a> links warning (one from Link above, one from link in bio below)*/ }
128126 < Content className = "w-full line-clamp-4" content = { lover . bio as JSONContent } />
129127 </ div >
130128 { /*{age}*/ }
@@ -135,6 +133,6 @@ function ProfilePreview(props: {
135133 { /*</Row>*/ }
136134 </ Col >
137135 </ Col >
138- </ div >
136+ </ Link >
139137 )
140138}
0 commit comments