mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-09 04:02:40 -05:00
Fix BadgeContainer key on user profile
This commit is contained in:
parent
1d3e7dc02f
commit
0febd67cf9
|
|
@ -2,7 +2,7 @@ import { sql } from "../sql";
|
|||
import type { Badge, User } from "../types";
|
||||
|
||||
const countsByUserIdStm = sql.prepare(`
|
||||
select "Badge"."code", "Badge"."displayName", count("BadgeOwner"."badgeId") as count
|
||||
select "Badge"."code", "Badge"."displayName", "Badge"."id", count("BadgeOwner"."badgeId") as count
|
||||
from "BadgeOwner"
|
||||
join "Badge" on "Badge"."id" = "BadgeOwner"."badgeId"
|
||||
where "BadgeOwner"."userId" = $userId
|
||||
|
|
@ -10,7 +10,7 @@ const countsByUserIdStm = sql.prepare(`
|
|||
`);
|
||||
|
||||
export type CountsByUserId = Array<
|
||||
Pick<Badge, "code" | "displayName"> & {
|
||||
Pick<Badge, "code" | "displayName" | "id"> & {
|
||||
count: number;
|
||||
}
|
||||
>;
|
||||
|
|
|
|||
|
|
@ -145,8 +145,7 @@ function BadgeContainer(props: { badges: UserPageLoaderData["badges"] }) {
|
|||
{smallBadges.length > 0 ? (
|
||||
<div className="u__small-badges">
|
||||
{smallBadges.map((badge) => (
|
||||
// xxx: should use badge.id - code is not necessarily unique
|
||||
<div key={badge.code} className="u__small-badge-container">
|
||||
<div key={badge.id} className="u__small-badge-container">
|
||||
<img
|
||||
src={`/gif/badges/${badge.code}.gif`}
|
||||
alt={badge.displayName}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user