Skip to content

Commit 4cf97a6

Browse files
committed
Fix
1 parent 75036e3 commit 4cf97a6

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

web/components/profile-grid.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ import {Lover} from 'common/love/lover'
22
import {CompatibilityScore} from 'common/love/compatibility-score'
33
import {LoadingIndicator} from 'web/components/widgets/loading-indicator'
44
import {LoadMoreUntilNotVisible} from 'web/components/widgets/visibility-observer'
5-
import {useUser} from 'web/hooks/use-user'
65
import {track} from 'web/lib/service/analytics'
76
import {Col} from './layout/col'
87
import clsx from 'clsx'
98
import {JSONContent} from "@tiptap/core";
109
import {Content} from "web/components/widgets/editor";
1110
import React from "react";
12-
import Router from "next/router";
11+
import Link from "next/link";
1312

1413
export 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

Comments
 (0)