fix(client): tracker filter size conditional render logic and react key prop (#702)

This commit is contained in:
Harry Merritt
2023-12-10 13:33:12 +00:00
committed by GitHub
parent 1781ecf87c
commit eaefd4c1dc
2 changed files with 4 additions and 5 deletions
@@ -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>
{' — '}
@@ -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
@@ -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>
);