diff --git a/components/FamousTemplate.tsx b/components/FamousTemplate.tsx index 3ac7f70..1387091 100644 --- a/components/FamousTemplate.tsx +++ b/components/FamousTemplate.tsx @@ -80,7 +80,25 @@ const FamousTemplate: React.FC = ({ showTabs = true }) => { {topTemplates.map((t) => { return ( -
+
{ + const v = e.currentTarget.querySelector('video') as HTMLVideoElement | null + // @ts-ignore + v?.play?.() + }} + onMouseLeave={(e) => { + const v = e.currentTarget.querySelector('video') as HTMLVideoElement | null + // @ts-ignore + v?.pause?.() + if (v) { + // @ts-ignore + v.currentTime = 0 + } + }} + >
= ({ showTabs = true }) => {
{t.name}
+
+
{ if (!isTemplateSelected) { @@ -88,6 +87,11 @@ export default function VideoCreationForm() { const dispatch = useAppDispatch(); const selectedTemplateId = useAppSelector(state => state.creationTemplate.selectedTemplateId); + useEffect(() => { + setTimeout(() => { + mainTextInputRef.current?.focus(); + }, 0); + }, [mainTextInputRef]); /** Clear current template related states */ const clearTemplateSelection = () => { handleConfigChange('pcode', ''); @@ -393,20 +397,17 @@ export default function VideoCreationForm() { )} {/* Template Description */} {inputPlaceholder && ( -
-
{inputPlaceholder}
+
+
{inputPlaceholder}
)} {/* Text Input Area - Middle */} {shouldShowInput && (
- {isTemplateSelected?.freeInput[0].input_name && ( -
{`${isTemplateSelected?.freeInput[0].input_name}:`}
- )}