Refactor Dropdown Handlers and Update WordPress Integration
- Updated dropdown onChange handlers across multiple components to use direct value passing instead of event target value for improved clarity and consistency. - Changed `url` to `site_url` in WordPress integration configuration for better semantic clarity. - Enhanced Vite configuration to include `fast-deep-equal` for compatibility with `react-dnd`. - Updated navigation paths in `SiteContentEditor` and `SiteList` for consistency with new routing structure.
This commit is contained in:
@@ -22,7 +22,7 @@ export default function PlatformSelector({ value, onChange, disabled }: Platform
|
||||
<SelectDropdown
|
||||
options={PLATFORMS}
|
||||
value={value}
|
||||
onChange={(e) => onChange(e.target.value)}
|
||||
onChange={(optionValue) => onChange(optionValue)}
|
||||
disabled={disabled}
|
||||
placeholder="Select platform"
|
||||
/>
|
||||
|
||||
@@ -142,8 +142,8 @@ export default function PublishingRules({ rules, onChange }: PublishingRulesProp
|
||||
<SelectDropdown
|
||||
options={CONTENT_TYPES}
|
||||
value={rule.content_type}
|
||||
onChange={(e) =>
|
||||
handleUpdateRule(rule.id, 'content_type', e.target.value)
|
||||
onChange={(value) =>
|
||||
handleUpdateRule(rule.id, 'content_type', value)
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
@@ -153,8 +153,8 @@ export default function PublishingRules({ rules, onChange }: PublishingRulesProp
|
||||
<SelectDropdown
|
||||
options={TRIGGERS}
|
||||
value={rule.trigger}
|
||||
onChange={(e) =>
|
||||
handleUpdateRule(rule.id, 'trigger', e.target.value)
|
||||
onChange={(value) =>
|
||||
handleUpdateRule(rule.id, 'trigger', value)
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -133,7 +133,7 @@ export default function TemplateCustomizer({
|
||||
{ value: 'fullwidth', label: 'Full Width' },
|
||||
]}
|
||||
value={customization.layout}
|
||||
onChange={(e) => updateCustomization({ layout: e.target.value })}
|
||||
onChange={(value) => updateCustomization({ layout: value })}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -147,7 +147,7 @@ export default function TemplateCustomizer({
|
||||
{ value: 'minimal', label: 'Minimal' },
|
||||
]}
|
||||
value={customization.headerStyle}
|
||||
onChange={(e) => updateCustomization({ headerStyle: e.target.value })}
|
||||
onChange={(value) => updateCustomization({ headerStyle: value })}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -161,7 +161,7 @@ export default function TemplateCustomizer({
|
||||
{ value: 'none', label: 'No Footer' },
|
||||
]}
|
||||
value={customization.footerStyle}
|
||||
onChange={(e) => updateCustomization({ footerStyle: e.target.value })}
|
||||
onChange={(value) => updateCustomization({ footerStyle: value })}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -175,7 +175,7 @@ export default function TemplateCustomizer({
|
||||
{ value: 'none', label: 'No Sidebar' },
|
||||
]}
|
||||
value={customization.sidebarPosition}
|
||||
onChange={(e) => updateCustomization({ sidebarPosition: e.target.value as 'left' | 'right' | 'none' })}
|
||||
onChange={(value) => updateCustomization({ sidebarPosition: value as 'left' | 'right' | 'none' })}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
@@ -196,7 +196,7 @@ export default function TemplateCustomizer({
|
||||
{ value: 'auto', label: 'Auto (System)' },
|
||||
]}
|
||||
value={customization.colorScheme}
|
||||
onChange={(e) => updateCustomization({ colorScheme: e.target.value })}
|
||||
onChange={(value) => updateCustomization({ colorScheme: value })}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -271,7 +271,7 @@ export default function TemplateCustomizer({
|
||||
{ value: 'custom', label: 'Custom' },
|
||||
]}
|
||||
value={customization.typography}
|
||||
onChange={(e) => updateCustomization({ typography: e.target.value })}
|
||||
onChange={(value) => updateCustomization({ typography: value })}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -285,9 +285,9 @@ export default function TemplateCustomizer({
|
||||
{ value: 'xlarge', label: 'Extra Large' },
|
||||
]}
|
||||
value={customization.customStyles?.headingSize || 'medium'}
|
||||
onChange={(e) =>
|
||||
onChange={(value) =>
|
||||
updateCustomization({
|
||||
customStyles: { ...customization.customStyles, headingSize: e.target.value },
|
||||
customStyles: { ...customization.customStyles, headingSize: value },
|
||||
})
|
||||
}
|
||||
/>
|
||||
@@ -302,9 +302,9 @@ export default function TemplateCustomizer({
|
||||
{ value: 'large', label: 'Large (18px)' },
|
||||
]}
|
||||
value={customization.customStyles?.bodySize || 'medium'}
|
||||
onChange={(e) =>
|
||||
onChange={(value) =>
|
||||
updateCustomization({
|
||||
customStyles: { ...customization.customStyles, bodySize: e.target.value },
|
||||
customStyles: { ...customization.customStyles, bodySize: value },
|
||||
})
|
||||
}
|
||||
/>
|
||||
@@ -327,7 +327,7 @@ export default function TemplateCustomizer({
|
||||
{ value: 'spacious', label: 'Spacious' },
|
||||
]}
|
||||
value={customization.spacing}
|
||||
onChange={(e) => updateCustomization({ spacing: e.target.value })}
|
||||
onChange={(value) => updateCustomization({ spacing: value })}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -341,9 +341,9 @@ export default function TemplateCustomizer({
|
||||
{ value: 'large', label: 'Large' },
|
||||
]}
|
||||
value={customization.customStyles?.sectionPadding || 'medium'}
|
||||
onChange={(e) =>
|
||||
onChange={(value) =>
|
||||
updateCustomization({
|
||||
customStyles: { ...customization.customStyles, sectionPadding: e.target.value },
|
||||
customStyles: { ...customization.customStyles, sectionPadding: value },
|
||||
})
|
||||
}
|
||||
/>
|
||||
@@ -360,9 +360,9 @@ export default function TemplateCustomizer({
|
||||
{ value: 'full', label: 'Full Width' },
|
||||
]}
|
||||
value={customization.customStyles?.containerWidth || 'lg'}
|
||||
onChange={(e) =>
|
||||
onChange={(value) =>
|
||||
updateCustomization({
|
||||
customStyles: { ...customization.customStyles, containerWidth: e.target.value },
|
||||
customStyles: { ...customization.customStyles, containerWidth: value },
|
||||
})
|
||||
}
|
||||
/>
|
||||
|
||||
@@ -17,8 +17,7 @@ interface WordPressIntegration {
|
||||
sync_status: 'success' | 'failed' | 'pending';
|
||||
last_sync_at?: string;
|
||||
config_json?: {
|
||||
url?: string;
|
||||
username?: string;
|
||||
site_url?: string;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -75,7 +74,7 @@ export default function WordPressIntegrationCard({
|
||||
WordPress Integration
|
||||
</h3>
|
||||
<p className="text-sm text-gray-600 dark:text-gray-400">
|
||||
{integration.config_json?.url || 'WordPress Site'}
|
||||
{integration.config_json?.site_url || 'WordPress Site'}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
*/
|
||||
import React, { useState } from 'react';
|
||||
import { X, Globe, AlertCircle } from 'lucide-react';
|
||||
import Modal from '../ui/modal/Modal';
|
||||
import { Modal } from '../ui/modal';
|
||||
import Button from '../ui/button/Button';
|
||||
import Label from '../form/Label';
|
||||
import Input from '../form/input/Input';
|
||||
import Input from '../form/input/InputField';
|
||||
import Checkbox from '../form/input/Checkbox';
|
||||
import { useToast } from '../ui/toast/ToastContainer';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user