mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Add key values to items in loop
This commit is contained in:
parent
f49ffab649
commit
0a2bb2d172
2 changed files with 29 additions and 13 deletions
|
|
@ -412,9 +412,16 @@ export default function LabelsPage(): JSX.Element {
|
|||
|
||||
if (editingLabelId == label.id) {
|
||||
if (windowWidth >= breakpoint) {
|
||||
return <DesktopEditCard {...cardProps} />
|
||||
return (
|
||||
<DesktopEditCard
|
||||
key={`edit-${label.id}`}
|
||||
{...cardProps}
|
||||
/>
|
||||
)
|
||||
} else {
|
||||
return <MobileEditCard {...cardProps} />
|
||||
return (
|
||||
<MobileEditCard key={`edit-${label.id}`} {...cardProps} />
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -488,9 +488,19 @@ export default function SavedSearchesPage(): JSX.Element {
|
|||
}
|
||||
if (editingId == savedSearch.id) {
|
||||
if (windowWidth >= breakpoint) {
|
||||
return <DesktopEditCard {...cardProps} />
|
||||
return (
|
||||
<DesktopEditCard
|
||||
key={`edit-${savedSearch.id}`}
|
||||
{...cardProps}
|
||||
/>
|
||||
)
|
||||
} else {
|
||||
return <MobileEditCard {...cardProps} />
|
||||
return (
|
||||
<MobileEditCard
|
||||
key={`edit-${savedSearch.id}`}
|
||||
{...cardProps}
|
||||
/>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -569,15 +579,14 @@ function GenericTableCard(
|
|||
editingId === savedSearch?.id || (isCreateMode && !savedSearch)
|
||||
const iconColor = isDarkTheme() ? '#D8D7D5' : '#5F5E58'
|
||||
const DEFAULT_STYLE = { position: null }
|
||||
const [style, setStyle] =
|
||||
useState<
|
||||
Partial<{
|
||||
position: string | null
|
||||
top: string
|
||||
left: string
|
||||
maxWidth: string
|
||||
}>
|
||||
>(DEFAULT_STYLE)
|
||||
const [style, setStyle] = useState<
|
||||
Partial<{
|
||||
position: string | null
|
||||
top: string
|
||||
left: string
|
||||
maxWidth: string
|
||||
}>
|
||||
>(DEFAULT_STYLE)
|
||||
const handleEdit = () => {
|
||||
editingId && updateSavedSearch(editingId)
|
||||
setEditingId(null)
|
||||
|
|
|
|||
Loading…
Reference in a new issue