mirror of
https://github.com/zoriya/flood.git
synced 2026-05-31 10:22:44 +00:00
fix(client): tracker filter size conditional render logic and react key prop (#702)
This commit is contained in:
@@ -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>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user