fix(guide) : link catalog items correctly
CI / Build immutable images and deploy (push) Has been cancelled
CI / Verify (push) Has been cancelled

This commit is contained in:
2026-09-05 13:45:57 +07:00 Unverified
parent 5314996ef3
commit 912c94c298
4 changed files with 55 additions and 113 deletions
+1 -89
View File
@@ -269,7 +269,6 @@ type TeamValue = {
let clientIdCounter = 0;
const DEFAULT_EXTRA_BACKGROUND_COLOR = "#24232C";
const DEFAULT_EXTRA_TEXT_COLOR = "#FAFAFA";
const RichTextEditor = dynamic(
() => import("@/components/rich-text-editor").then((module) => module.RichTextEditor),
{
@@ -330,7 +329,6 @@ export interface GuideSectionEditorProps {
body: string;
percent: string | null;
backgroundColor: string | null;
textColor: string | null;
catalogItems: ExtraCatalogItem[];
highlights: Array<{ text: string; color: string }>;
imageUrl: string | null;
@@ -3438,7 +3436,6 @@ function ExtraEditor({ guide, initial, characters, weapons, artifacts }: EditorB
? null
: Number(row.percent),
backgroundColor: row.backgroundColor,
textColor: row.textColor,
catalogItems: row.catalogItems,
highlights: [],
})),
@@ -3471,7 +3468,6 @@ function ExtraEditor({ guide, initial, characters, weapons, artifacts }: EditorB
id: row.id || createClientId("extra-row-record"),
body: normalizeExtraRichText(row.body, row.highlights ?? []),
backgroundColor: row.backgroundColor ?? null,
textColor: row.textColor ?? null,
catalogItems: row.catalogItems ?? [],
highlights: [],
clientId: row.clientId || createClientId("extra-row"),
@@ -3867,7 +3863,7 @@ function ExtraEditor({ guide, initial, characters, weapons, artifacts }: EditorB
/>
</Field>
<FieldSet>
<FieldLegend>สีการ์ด (optional)</FieldLegend>
<FieldLegend>สีพื้นหลังการ์ด (optional)</FieldLegend>
<FieldDescription>
สีจะใช้เฉพาะการ์ดนี้บนหน้า Guide
</FieldDescription>
@@ -3954,89 +3950,6 @@ function ExtraEditor({ guide, initial, characters, weapons, artifacts }: EditorB
<RefreshCcwIcon data-icon="inline-start" />
ใช้สีตามธีม
</Button>
<Field
data-invalid={extraIssue(
"sections",
sectionIndex,
"rows",
rowIndex,
"textColor",
) || undefined}
>
<FieldLabel>สีข้อความ</FieldLabel>
<Input
type="color"
value={row.textColor ?? DEFAULT_EXTRA_TEXT_COLOR}
aria-invalid={extraIssue(
"sections",
sectionIndex,
"rows",
rowIndex,
"textColor",
)}
onClick={() => {
if (row.textColor !== null) return;
setSections(
sections.map((item, index) =>
index === sectionIndex
? {
...item,
rows: item.rows.map((candidate, inner) =>
inner === rowIndex
? {
...candidate,
textColor: DEFAULT_EXTRA_TEXT_COLOR,
}
: candidate,
),
}
: item,
),
);
}}
onChange={(event) =>
setSections(
sections.map((item, index) =>
index === sectionIndex
? {
...item,
rows: item.rows.map((candidate, inner) =>
inner === rowIndex
? { ...candidate, textColor: event.target.value }
: candidate,
),
}
: item,
),
)
}
/>
</Field>
<Button
type="button"
variant="outline"
size="sm"
disabled={row.textColor === null}
onClick={() =>
setSections(
sections.map((item, index) =>
index === sectionIndex
? {
...item,
rows: item.rows.map((candidate, inner) =>
inner === rowIndex
? { ...candidate, textColor: null }
: candidate,
),
}
: item,
),
)
}
>
<RefreshCcwIcon data-icon="inline-start" />
ใช้สีข้อความตามธีม
</Button>
</FieldSet>
</FieldGroup>
</CardContent>
@@ -4067,7 +3980,6 @@ function ExtraEditor({ guide, initial, characters, weapons, artifacts }: EditorB
body: "",
percent: null,
backgroundColor: null,
textColor: null,
catalogItems: [],
highlights: [],
clientId: createClientId("extra-row"),