Skip to content

Commit 13d9353

Browse files
authored
Merge pull request #18 from maxidragon/fix-link-to-wca-profile-for-users-without-wca-id
Remove link to WCA profile when user doesn't have WCA ID
2 parents caed965 + 9a8a47e commit 13d9353

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/pages/Competition/Information.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,19 @@ const UserRow = ({ user }: { user: User }) => {
7676
<a
7777
key={user.id}
7878
className="w-full flex"
79-
href={`https://www.worldcubeassociation.org/persons/${user.wca_id}`}
79+
href={user.wca_id && `https://www.worldcubeassociation.org/persons/${user.wca_id}`}
8080
target="_blank"
8181
rel="noreferrer">
8282
<img className="w-16 h-16 rounded-l" src={user.avatar?.thumb_url} alt={user.name} />
8383
<div className="flex flex-1 flex-col px-2">
8484
<span className="text-xl">{user.name}</span>
8585
<span className="text-xs">{user.wca_id}</span>
8686
</div>
87-
<div className="p-2 flex items-center">
88-
<i className="m-0 fa fa-solid fa-arrow-up-right-from-square" />
89-
</div>
87+
{user.wca_id && (
88+
<div className="p-2 flex items-center">
89+
<i className="m-0 fa fa-solid fa-arrow-up-right-from-square" />
90+
</div>
91+
)}
9092
</a>
9193
</li>
9294
);

0 commit comments

Comments
 (0)