Skip to content

Commit 31a4001

Browse files
committed
Do not render your own profile in Profiles
1 parent 8106ff6 commit 31a4001

File tree

1 file changed

+25
-17
lines changed

1 file changed

+25
-17
lines changed

web/components/profile-grid.tsx

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ import {JSONContent} from "@tiptap/core";
99
import {Content} from "web/components/widgets/editor";
1010
import React from "react";
1111
import Link from "next/link";
12+
import {Row} from "web/components/layout/row";
13+
import {CompatibleBadge} from "web/components/widgets/compatible-badge";
14+
import {useUser} from "web/hooks/use-user";
1215

1316
export const ProfileGrid = (props: {
1417
lovers: Lover[]
@@ -29,6 +32,8 @@ export const ProfileGrid = (props: {
2932
refreshStars,
3033
} = props
3134

35+
const user = useUser()
36+
3237
return (
3338
<div className="relative">
3439
<div
@@ -37,7 +42,9 @@ export const ProfileGrid = (props: {
3742
isReloading && 'animate-pulse opacity-80'
3843
)}
3944
>
40-
{lovers.map((lover) => (
45+
{lovers
46+
.filter((lover) => lover.user_id !== user?.id)
47+
.map((lover) => (
4148
<ProfilePreview
4249
key={lover.id}
4350
lover={lover}
@@ -97,22 +104,23 @@ function ProfilePreview(props: {
97104
{/* </Col>*/}
98105
{/*)}*/}
99106

100-
{/*<Row className="absolute inset-x-0 right-0 top-0 items-start justify-between bg-gradient-to-b from-black/70 via-black/70 to-transparent px-2 pb-3 pt-2">*/}
101-
{/* {currentUser ? (*/}
102-
{/* <StarButton*/}
103-
{/* className="!pt-0"*/}
104-
{/* isStarred={hasStar}*/}
105-
{/* refresh={refreshStars}*/}
106-
{/* targetLover={lover}*/}
107-
{/* hideTooltip*/}
108-
{/* />*/}
109-
{/* ) : (*/}
110-
{/* <div />*/}
111-
{/* )}*/}
112-
{/* {compatibilityScore && (*/}
113-
{/* <CompatibleBadge compatibility={compatibilityScore} />*/}
114-
{/* )}*/}
115-
{/*</Row>*/}
107+
<Row
108+
className="absolute top-2 right-2 items-start justify-end px-2 pb-3">
109+
{/* {currentUser ? (*/}
110+
{/* <StarButton*/}
111+
{/* className="!pt-0"*/}
112+
{/* isStarred={hasStar}*/}
113+
{/* refresh={refreshStars}*/}
114+
{/* targetLover={lover}*/}
115+
{/* hideTooltip*/}
116+
{/* />*/}
117+
{/* ) : (*/}
118+
{/* <div />*/}
119+
{/* )}*/}
120+
{compatibilityScore && (
121+
<CompatibleBadge compatibility={compatibilityScore}/>
122+
)}
123+
</Row>
116124

117125
<Col className="absolute inset-x-0 bottom-0 bg-gradient-to-t to-transparent px-4 pb-2 pt-6">
118126
<div>

0 commit comments

Comments
 (0)