x
This commit is contained in:
1 parent
ad637fd8b4
commit
fdb731c732
2 files changed
+3
-6
No files matched your search
@@ -5,14 +5,12 @@ interface UspBarFormProps {
|
|||||||
editingSection: Partial<PageSection>;
|
editingSection: Partial<PageSection>;
|
||||||
editingLang: string;
|
editingLang: string;
|
||||||
updatePayloadValue: (field: string, value: any) => void;
|
updatePayloadValue: (field: string, value: any) => void;
|
||||||
getLocalizedValue: (payload: any, field: string) => string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function UspBarForm({
|
export default function UspBarForm({
|
||||||
editingSection,
|
editingSection,
|
||||||
editingLang,
|
editingLang,
|
||||||
updatePayloadValue,
|
updatePayloadValue
|
||||||
getLocalizedValue
|
|
||||||
}: UspBarFormProps) {
|
}: UspBarFormProps) {
|
||||||
|
|
||||||
const items = Array.isArray(editingSection.payload?.items) ? editingSection.payload.items : [];
|
const items = Array.isArray(editingSection.payload?.items) ? editingSection.payload.items : [];
|
||||||
@@ -24,7 +22,7 @@ export default function UspBarForm({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleRemoveItem = (index: number) => {
|
const handleRemoveItem = (index: number) => {
|
||||||
const newItems = items.filter((_, i) => i !== index);
|
const newItems = items.filter((_: any, i: number) => i !== index);
|
||||||
updatePayloadValue('items', newItems);
|
updatePayloadValue('items', newItems);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ export default function PageBuilderPage() {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const updatePayloadValue = (field: string, value: string | number) => {
|
const updatePayloadValue = (field: string, value: any) => {
|
||||||
setEditingSection(prev => {
|
setEditingSection(prev => {
|
||||||
if (!prev) return null;
|
if (!prev) return null;
|
||||||
return {
|
return {
|
||||||
@@ -1024,7 +1024,6 @@ export default function PageBuilderPage() {
|
|||||||
editingSection={editingSection}
|
editingSection={editingSection}
|
||||||
editingLang={editingLang}
|
editingLang={editingLang}
|
||||||
updatePayloadValue={updatePayloadValue}
|
updatePayloadValue={updatePayloadValue}
|
||||||
getLocalizedValue={getLocalizedValue}
|
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user