fix: add keys on mapped components
This commit is contained in:
@@ -47,7 +47,7 @@ function DynamicComponent({ component, props }: AccountPageContentProps) {
|
||||
}
|
||||
|
||||
export default function Content({ lang, content }: ContentProps) {
|
||||
return content.map((item) => {
|
||||
return content.map((item, idx) => {
|
||||
switch (item.__typename) {
|
||||
case ContentEntries.AccountPageContentDynamicContent:
|
||||
const link = item.dynamic_content.link.linkConnection.edges.length
|
||||
@@ -71,6 +71,7 @@ export default function Content({ lang, content }: ContentProps) {
|
||||
}
|
||||
return (
|
||||
<DynamicComponent
|
||||
key={`${item.dynamic_content.title}-${idx}`}
|
||||
component={item.dynamic_content.component}
|
||||
props={componentProps}
|
||||
/>
|
||||
@@ -78,6 +79,7 @@ export default function Content({ lang, content }: ContentProps) {
|
||||
case ContentEntries.AccountPageContentShortcuts:
|
||||
return (
|
||||
<Shortcuts
|
||||
key={`${item.shortcuts.title}-${idx}`}
|
||||
shortcuts={item.shortcuts.shortcuts}
|
||||
subtitle={item.shortcuts.preamble}
|
||||
title={item.shortcuts.title}
|
||||
@@ -85,7 +87,7 @@ export default function Content({ lang, content }: ContentProps) {
|
||||
)
|
||||
case ContentEntries.AccountPageContentTextContent:
|
||||
return (
|
||||
<section>
|
||||
<section key={`${item.__typename}-${idx}`}>
|
||||
<JsonToHtml
|
||||
embeds={item.text_content.content.embedded_itemsConnection.edges}
|
||||
nodes={item.text_content.content.json.children}
|
||||
|
||||
@@ -48,7 +48,7 @@ function DynamicComponent({ component, props }: AccountPageContentProps) {
|
||||
export default function Content({ lang, content }: ContentProps) {
|
||||
return (
|
||||
<>
|
||||
{content.map((item) => {
|
||||
{content.map((item, idx) => {
|
||||
switch (item.__typename) {
|
||||
case ContentEntries.AccountPageContentDynamicContent:
|
||||
const link = item.dynamic_content.link.linkConnection.edges.length
|
||||
@@ -70,6 +70,7 @@ export default function Content({ lang, content }: ContentProps) {
|
||||
}
|
||||
return (
|
||||
<DynamicComponent
|
||||
key={`${item.dynamic_content.title}-${idx}`}
|
||||
component={item.dynamic_content.component}
|
||||
props={componentProps}
|
||||
/>
|
||||
@@ -83,6 +84,7 @@ export default function Content({ lang, content }: ContentProps) {
|
||||
})
|
||||
return (
|
||||
<Shortcuts
|
||||
key={`${item.shortcuts.title}-${idx}`}
|
||||
shortcuts={shortcuts}
|
||||
subtitle={item.shortcuts.preamble}
|
||||
title={item.shortcuts.title}
|
||||
@@ -90,7 +92,7 @@ export default function Content({ lang, content }: ContentProps) {
|
||||
)
|
||||
case ContentEntries.AccountPageContentTextContent:
|
||||
return (
|
||||
<section>
|
||||
<section key={`${item.__typename}-${idx}`}>
|
||||
<JsonToHtml
|
||||
embeds={
|
||||
item.text_content.content.embedded_itemsConnection.edges
|
||||
|
||||
Reference in New Issue
Block a user