diff --git a/packages/frontend/src/assets/templates.ts b/packages/frontend/src/assets/templates.ts index 0b56696f..84c60bb5 100644 --- a/packages/frontend/src/assets/templates.ts +++ b/packages/frontend/src/assets/templates.ts @@ -4,29 +4,34 @@ export default [ name: 'Progressive Web App (PWA)', icon: 'pwa', repoFullName: `${process.env.REACT_APP_GITHUB_PWA_TEMPLATE_REPO}`, + isComingSoon: false, }, { id: '2', name: 'Image Upload PWA', icon: 'pwa', repoFullName: `${process.env.REACT_APP_GITHUB_IMAGE_UPLOAD_PWA_TEMPLATE_REPO}`, + isComingSoon: false, }, { id: '3', name: 'Kotlin', icon: 'kotlin', repoFullName: '', + isComingSoon: false, }, { id: '4', name: 'React Native', icon: 'react-native', repoFullName: '', + isComingSoon: false, }, { id: '5', name: 'Swift', icon: 'swift', repoFullName: '', + isComingSoon: true, }, ]; diff --git a/packages/frontend/src/components/projects/create/TemplateCard/TemplateCard.tsx b/packages/frontend/src/components/projects/create/TemplateCard/TemplateCard.tsx index a191d117..b5ac2057 100644 --- a/packages/frontend/src/components/projects/create/TemplateCard/TemplateCard.tsx +++ b/packages/frontend/src/components/projects/create/TemplateCard/TemplateCard.tsx @@ -9,12 +9,14 @@ import { Tag } from 'components/shared/Tag'; import React, { ComponentPropsWithoutRef, useCallback } from 'react'; import { useNavigate } from 'react-router-dom'; import { useToast } from 'components/shared/Toast'; +import { cn } from 'utils/classnames'; export interface TemplateDetail { id: string; name: string; icon: string; repoFullName?: string; + isComingSoon?: boolean; } export interface TemplateCardProps extends ComponentPropsWithoutRef<'div'> { @@ -27,6 +29,14 @@ export const TemplateCard = ({ template, isGitAuth }: TemplateCardProps) => { const navigate = useNavigate(); const handleClick = useCallback(() => { + if (template?.isComingSoon) { + return toast({ + id: 'coming-soon', + title: 'This template is coming soon', + variant: 'info', + onDismiss: dismiss, + }); + } if (isGitAuth) { return navigate(`/template?templateId=${template.id}`); } @@ -36,27 +46,40 @@ export const TemplateCard = ({ template, isGitAuth }: TemplateCardProps) => { variant: 'error', onDismiss: dismiss, }); - }, [isGitAuth, navigate, template.id, toast]); + }, [isGitAuth, navigate, template, toast]); return ( -