diff --git a/apps/admin-x-settings/src/components/settings/site/navigation/NavigationEditForm.tsx b/apps/admin-x-settings/src/components/settings/site/navigation/NavigationEditForm.tsx index 9926942d9d..04692647c8 100644 --- a/apps/admin-x-settings/src/components/settings/site/navigation/NavigationEditForm.tsx +++ b/apps/admin-x-settings/src/components/settings/site/navigation/NavigationEditForm.tsx @@ -7,10 +7,6 @@ const NavigationEditForm: React.FC<{ baseUrl: string; navigation: NavigationEditor; }> = ({baseUrl, navigation}) => { - const onAddItem = () => { - navigation.addItem(); - }; - return
} + action={
; diff --git a/apps/admin-x-settings/src/components/settings/site/navigation/NavigationItemEditor.tsx b/apps/admin-x-settings/src/components/settings/site/navigation/NavigationItemEditor.tsx index 68eeeaf03e..ef576008cc 100644 --- a/apps/admin-x-settings/src/components/settings/site/navigation/NavigationItemEditor.tsx +++ b/apps/admin-x-settings/src/components/settings/site/navigation/NavigationItemEditor.tsx @@ -12,17 +12,9 @@ export type NavigationItemEditorProps = React.HTMLAttributes & { unstyled?: boolean textFieldClasses?: string action?: ReactNode - onAddItem?: () => void; // New prop } -const NavigationItemEditor: React.FC = ({baseUrl, item, updateItem, clearError, labelPlaceholder, unstyled, textFieldClasses, action, className, onAddItem,...props}) => { - const handleKeyDown = (e: React.KeyboardEvent) => { - if (e.key === 'Enter') { - e.preventDefault(); - onAddItem?.(); - } - }; - +const NavigationItemEditor: React.FC = ({baseUrl, item, updateItem, clearError, labelPlaceholder, unstyled, textFieldClasses, action, className, ...props}) => { return (
@@ -37,10 +29,7 @@ const NavigationItemEditor: React.FC = ({baseUrl, ite value={item.label} hideTitle onChange={e => updateItem?.({label: e.target.value})} - onKeyDown={(e) => { - clearError?.('label'); - handleKeyDown(e); - }} + onKeyDown={() => clearError?.('label')} />
@@ -55,10 +44,7 @@ const NavigationItemEditor: React.FC = ({baseUrl, ite value={item.url} hideTitle onChange={value => updateItem?.({url: value || ''})} - onKeyDown={(e) => { - clearError?.('url'); - handleKeyDown(e); - }} + onKeyDown={() => clearError?.('url')} />
{action}