From 34d34da5e17048aae79c4265e1f3434537d7f385 Mon Sep 17 00:00:00 2001 From: hexcowboy Date: Mon, 12 Sep 2022 16:33:08 -0700 Subject: [PATCH] dynamic import rainbow (only if installed) --- apps/web/components/Gates.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/web/components/Gates.tsx b/apps/web/components/Gates.tsx index 6fa5ebc79ff503..114c32cc9c15a6 100644 --- a/apps/web/components/Gates.tsx +++ b/apps/web/components/Gates.tsx @@ -1,8 +1,7 @@ +import dynamic from "next/dynamic"; import { Dispatch, useState, useEffect } from "react"; import { JSONObject } from "superjson/dist/types"; -import RainbowGate from "@calcom/app-store/rainbow/components/RainbowKit"; - export type Gate = undefined | "rainbow"; // Add more like ` | "geolocation" | "payment"` export type GateState = { @@ -16,6 +15,8 @@ type GateProps = { dispatch: Dispatch>; }; +const RainbowGate = dynamic(() => import("@calcom/app-store/rainbow/components/RainbowKit")); + // To add a new Gate just add the gate logic to the switch statement const Gates: React.FC = ({ children, gates, metadata, dispatch }) => { const [rainbowToken, setRainbowToken] = useState();