diff --git a/components/FamousTemplate.tsx b/components/FamousTemplate.tsx index 8ec7c73..3ac7f70 100644 --- a/components/FamousTemplate.tsx +++ b/components/FamousTemplate.tsx @@ -13,9 +13,12 @@ import { useDeviceType } from "@/hooks/useDeviceType" /** * A compact template showcase with a header and link to all templates. * Shows first 12 templates, in 3 columns, each with thumbnail, name and brief. + * @param {object} props - Component props. + * @param {boolean} [props.showTabs=true] - Whether to show category tabs. * @returns {JSX.Element} - FamousTemplate component */ -const FamousTemplate: React.FC = () => { +interface FamousTemplateProps { showTabs?: boolean } +const FamousTemplate: React.FC = ({ showTabs = true }) => { const { templateStoryList, getTemplateStoryList, isLoading } = useTemplateStoryServiceHook() const dispatch = useAppDispatch() const { isDesktop } = useDeviceType() @@ -47,23 +50,25 @@ const FamousTemplate: React.FC = () => {

Hot Templates

-
- {(["all", "music", "animation", "fantasy"] as const).map((tab) => ( - - ))} -
+ {showTabs && ( +
+ {(["all", "music", "animation", "fantasy"] as const).map((tab) => ( + + ))} +
+ )} {isLoading ? ( @@ -82,7 +87,7 @@ const FamousTemplate: React.FC = () => { >
{
{t.name}
+
@@ -113,7 +122,20 @@ const FamousTemplate: React.FC = () => { setIsModalOpen(true) } }} - /> + > + + ) })} @@ -136,7 +158,7 @@ const FamousTemplate: React.FC = () => { dispatch(selectTemplateById(id)) setActiveTemplateId(null) }} - primaryLabel="Try it Free" + primaryLabel="Try this" /> ) })()} diff --git a/components/HomeBanner.tsx b/components/HomeBanner.tsx index 9851d9a..ab088fc 100644 --- a/components/HomeBanner.tsx +++ b/components/HomeBanner.tsx @@ -6,6 +6,7 @@ import { X, ChevronUp, ChevronsDown } from "lucide-react"; import { ChatInputBox } from "@/components/ChatInputBox/ChatInputBox"; import { VideoCreationForm } from '@/components/pages/create-video/CreateInput'; import { useDeviceType } from '@/hooks/useDeviceType'; +import { useAppSelector } from '@/lib/store/hooks'; export const HOME_BANNER_CODE = "homeBanner"; const HOME_BANNER_COLLAPSE_KEY = "homeBannerCollapsedDate"; @@ -44,6 +45,7 @@ export default function HomeBanner() { const skipAutoCollapseRef = useRef(false); const { isMobile, isDesktop } = useDeviceType(); + const selectedTemplateId = useAppSelector((state) => state.creationTemplate.selectedTemplateId); /** Returns YYYY-MM-DD for user's local timezone */ const getLocalDateKey = () => { @@ -96,6 +98,19 @@ export default function HomeBanner() { }; }, []); + // Collapse banner when a template is selected/changed + useEffect(() => { + if (!selectedTemplateId) return; + setIsFlying(true); + try { + localStorage.setItem(HOME_BANNER_COLLAPSE_KEY, getLocalDateKey()); + } catch {} + if (autoCollapseTimerRef.current) { + clearTimeout(autoCollapseTimerRef.current); + autoCollapseTimerRef.current = null; + } + }, [selectedTemplateId]); + useEffect(() => { let active = true; diff --git a/components/common/TemplatePreviewModal.tsx b/components/common/TemplatePreviewModal.tsx index 97ec233..04a948b 100644 --- a/components/common/TemplatePreviewModal.tsx +++ b/components/common/TemplatePreviewModal.tsx @@ -33,7 +33,7 @@ export function TemplatePreviewModal({ title, description, onPrimaryAction, - primaryLabel = 'Try it Free', + primaryLabel = 'Try this', }: TemplatePreviewModalProps) { const [isReady, setIsReady] = useState(false); const [isExpanded, setIsExpanded] = useState(false); diff --git a/components/pages/create-video/CreateInput/VideoCreationForm.tsx b/components/pages/create-video/CreateInput/VideoCreationForm.tsx index 6dc0a32..7ebaefe 100644 --- a/components/pages/create-video/CreateInput/VideoCreationForm.tsx +++ b/components/pages/create-video/CreateInput/VideoCreationForm.tsx @@ -394,14 +394,14 @@ export default function VideoCreationForm() { {/* Template Description */} {inputPlaceholder && (
-
{inputPlaceholder}
+
{inputPlaceholder}
)} {/* Text Input Area - Middle */} {shouldShowInput && (
{isTemplateSelected?.freeInput[0].input_name && ( -
{isTemplateSelected?.freeInput[0].input_name}
+
{`${isTemplateSelected?.freeInput[0].input_name}:`}
)}