diff --git a/components/pages/create-video/CreateInput/ConfigPanel.tsx b/components/pages/create-video/CreateInput/ConfigPanel.tsx index ea4d917..ac2f7dc 100644 --- a/components/pages/create-video/CreateInput/ConfigPanel.tsx +++ b/components/pages/create-video/CreateInput/ConfigPanel.tsx @@ -15,7 +15,7 @@ interface ConfigPanelProps { /** Current configuration options */ configOptions: ConfigOptions; /** Handler for configuration changes */ - onConfigChange: (key: K, value: ConfigOptions[K]) => void; + onConfigChange: (key: K, value: ConfigOptions[K], exclude?: boolean) => void; /** Whether it's mobile device */ isMobile?: boolean; /** Whether it's desktop device */ @@ -100,14 +100,7 @@ export const ConfigPanel = ({ { - onConfigChange('videoDuration', key as VideoDurationValue); - if (key === '8s') { - onConfigChange('expansion_mode', false); - } else { - onConfigChange('expansion_mode', true); - } - }, + onClick: ({ key }) => onConfigChange('videoDuration', key as VideoDurationValue), className: 'bg-[#1a1a1a] border border-white/10' }} trigger={['click']} @@ -151,7 +144,7 @@ export const ConfigPanel = ({ {/* Portrait/Anime selector */} onConfigChange('pcode', v)} + onChange={(v) => onConfigChange('pcode', v, true)} /> ); diff --git a/components/pages/create-video/CreateInput/MobileConfigModal.tsx b/components/pages/create-video/CreateInput/MobileConfigModal.tsx index c6c5090..2c1645b 100644 --- a/components/pages/create-video/CreateInput/MobileConfigModal.tsx +++ b/components/pages/create-video/CreateInput/MobileConfigModal.tsx @@ -10,7 +10,7 @@ import { WandSparkles, RectangleHorizontal, RectangleVertical, Palette } from 'l import { Modal, Dropdown } from 'antd'; import { LanguageOptions, VideoDurationOptions } from './config-options'; import type { ConfigOptions, LanguageValue, VideoDurationValue } from './config-options'; -import { useEffect, useState } from 'react'; +import { useEffect, useMemo, useState } from 'react'; import { fetchSettingByCode } from '@/api/serversetting'; interface MobileConfigModalProps { @@ -21,7 +21,7 @@ interface MobileConfigModalProps { /** Current configuration options */ configOptions: ConfigOptions; /** Handler for configuration changes */ - onConfigChange: (key: K, value: ConfigOptions[K]) => void; + onConfigChange: (key: K, value: ConfigOptions[K], exclude?: boolean) => void; } /** @@ -57,6 +57,11 @@ export function MobileConfigModal({ return () => { mounted = false; }; }, []); + /** Check if currentAnime is valid in animeOptions */ + const isValidAnimeChoice = useMemo(() => { + return animeOptions.some(opt => opt.pcode === configOptions.pcode); + }, [animeOptions, configOptions.pcode]); + const isPortrait = configOptions.pcode === 'portrait'; const currentLanguage = LanguageOptions.find(opt => opt.value === configOptions.language); @@ -225,7 +230,7 @@ export function MobileConfigModal({