diff --git a/apps/web/components/apps/layouts/InstalledAppsLayout.tsx b/apps/web/components/apps/layouts/InstalledAppsLayout.tsx index 648817f021..d238742831 100644 --- a/apps/web/components/apps/layouts/InstalledAppsLayout.tsx +++ b/apps/web/components/apps/layouts/InstalledAppsLayout.tsx @@ -44,13 +44,15 @@ export default function InstalledAppsLayout({ children, ...rest }: { children: React.ReactNode } & ComponentProps) { + const variant: typeof InstalledAppVariants[number] = "payment"; + const query = trpc.viewer.integrations.useQuery({ - variant: InstalledAppVariants.payment, + variant, onlyInstalled: true, }); let actualTabs = tabs; if (query.data?.items.length === 0) { - actualTabs = tabs.filter((tab) => tab.name !== InstalledAppVariants.payment); + actualTabs = tabs.filter((tab) => tab.name !== variant); } return ( diff --git a/apps/web/pages/apps/installed/[category].tsx b/apps/web/pages/apps/installed/[category].tsx index d0503d4a33..d7468cf327 100644 --- a/apps/web/pages/apps/installed/[category].tsx +++ b/apps/web/pages/apps/installed/[category].tsx @@ -92,8 +92,8 @@ function ConnectOrDisconnectIntegrationButton(props: { } interface IntegrationsContainerProps { - variant?: keyof typeof InstalledAppVariants; - exclude?: (keyof typeof InstalledAppVariants)[]; + variant?: typeof InstalledAppVariants[number]; + exclude?: typeof InstalledAppVariants[number][]; } interface IntegrationsListProps { @@ -143,8 +143,10 @@ const IntegrationsContainer = ({ variant, exclude }: IntegrationsContainerProps) automation: Icon.FiShare2, analytics: Icon.FiBarChart, payment: Icon.FiCreditCard, + web3: Icon.FiBarChart, other: Icon.FiGrid, }; + return ( ; + export default function InstalledApps() { const { t } = useLocale(); const router = useRouter(); - const category = router.query.category; + const category = router.query.category as querySchemaType["category"]; + const categoryList: querySchemaType["category"][] = [ + "payment", + "conferencing", + "automation", + "analytics", + "web3", + ]; + return ( - {(category === InstalledAppVariants.payment || category === InstalledAppVariants.conferencing) && ( - - )} - {(category === InstalledAppVariants.automation || category === InstalledAppVariants.analytics) && ( - - )} - {category === InstalledAppVariants.calendar && } - {category === InstalledAppVariants.other && ( - + {categoryList.includes(category) && } + {category === "calendar" && } + {category === "other" && ( + )} ); diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.json index c9ff08313e..b4ed9b7afd 100644 --- a/apps/web/public/static/locales/en/common.json +++ b/apps/web/public/static/locales/en/common.json @@ -799,12 +799,14 @@ "no_category_apps_description_analytics": "Add an analytics app for your booking pages", "no_category_apps_description_automation": "Add an automation app to use", "no_category_apps_description_other": "Add any other type of app to do all sorts of things", + "no_category_apps_description_web3": "Add a web3 app for your booking pages", "installed_app_calendar_description": "Set the calendars to check for conflicts to prevent double bookings.", "installed_app_conferencing_description": "Add your favourite video conferencing apps for your meetings", "installed_app_payment_description": "Configure which payment processing services to use when charging your clients.", "installed_app_analytics_description": "Configure which analytics apps to use for your booking pages", "installed_app_other_description": "All your installed apps from other categories.", "installed_app_automation_description": "Configure which automation apps to use", + "installed_app_web3_description": "Configure which web3 apps to use for your booking pages", "analytics": "Analytics", "empty_installed_apps_headline": "No apps installed", "empty_installed_apps_description": "Apps enable you to enhance your workflow and improve your scheduling life significantly.", @@ -1217,6 +1219,7 @@ "connect_automation_apps": "Connect automation apps", "connect_analytics_apps": "Connect analytics apps", "connect_other_apps": "Connect other apps", + "connect_web3_apps": "Connect web3 apps", "current_step_of_total": "Step {{currentStep}} of {{maxSteps}}", "add_variable": "Add variable", "custom_phone_number": "Custom phone number", diff --git a/packages/app-store/_utils/getInstalledAppPath.ts b/packages/app-store/_utils/getInstalledAppPath.ts index 3d2b70c74f..f6f8fd1511 100644 --- a/packages/app-store/_utils/getInstalledAppPath.ts +++ b/packages/app-store/_utils/getInstalledAppPath.ts @@ -2,7 +2,7 @@ import z from "zod"; import { InstalledAppVariants } from "../utils"; -const variantSchema = z.nativeEnum(InstalledAppVariants); +const variantSchema = z.enum(InstalledAppVariants); export default function getInstalledAppPath( { variant, slug }: { variant?: string; slug?: string }, diff --git a/packages/app-store/utils.ts b/packages/app-store/utils.ts index a5d6fbf5a9..cdef280d0d 100644 --- a/packages/app-store/utils.ts +++ b/packages/app-store/utils.ts @@ -31,14 +31,15 @@ const credentialData = Prisma.validator()({ export type CredentialData = Prisma.CredentialGetPayload; -export enum InstalledAppVariants { - "conferencing" = "conferencing", - "calendar" = "calendar", - "payment" = "payment", - "analytics" = "analytics", - "automation" = "automation", - "other" = "other", -} +export const InstalledAppVariants = [ + "conferencing", + "calendar", + "payment", + "analytics", + "automation", + "other", + "web3", +] as const; export const ALL_APPS = Object.values(ALL_APPS_MAP);