Skip to content

Commit

Permalink
fix(client): tracker filter size conditional render logic and react k…
Browse files Browse the repository at this point in the history
…ey prop (#702)
  • Loading branch information
hmerritt authored Dec 10, 2023
1 parent 1781ecf commit eaefd4c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,14 @@ const NotificationTopToolbar: FC<NotificationTopToolbarProps> = ({
};

interface NotificationItemProps {
index: number;
notification: Notification;
}

const NotificationItem: FC<NotificationItemProps> = ({index, notification}: NotificationItemProps) => {
const NotificationItem: FC<NotificationItemProps> = ({notification}: NotificationItemProps) => {
const {i18n} = useLingui();

return (
<li className="notifications__list__item" key={index}>
<li className="notifications__list__item">
<div className="notification__heading">
<span className="notification__category">{i18n._(`${notification.id}.heading`)}</span>
{' — '}
Expand Down Expand Up @@ -195,7 +194,7 @@ const NotificationsButton: FC = observer(() => {
style={{minHeight: prevHeight}}
>
{notifications.map((notification, index) => (
<NotificationItem index={index} notification={notification} />
<NotificationItem key={index} notification={notification} />
))}
</ul>
<NotificationBottomToolbar
Expand Down
2 changes: 1 addition & 1 deletion client/src/javascript/components/sidebar/SidebarFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const SidebarFilter: FC<SidebarFilterProps> = ({
{icon}
<span className="name">{name}</span>
<Badge>{count}</Badge>
{size && <Size value={size} className="size" />}
{size != null && <Size value={size} className="size" />}
</button>
</li>
);
Expand Down

0 comments on commit eaefd4c

Please sign in to comment.