diff --git a/apps/web/app/layout.tsx b/apps/web/app/layout.tsx index 36acecac5f..4781e6102d 100644 --- a/apps/web/app/layout.tsx +++ b/apps/web/app/layout.tsx @@ -5,6 +5,7 @@ import { headers, cookies } from "next/headers"; import React from "react"; import { getLocale } from "@calcom/features/auth/lib/getLocale"; +import { IconSprites } from "@calcom/ui"; import { prepareRootMetadata } from "@lib/metadata"; @@ -83,6 +84,7 @@ export default async function RootLayout({ children }: { children: React.ReactNo --font-cal: ${calFont.style.fontFamily.replace(/\'/g, "")}; } `} + + {getLayout( Component.requiresLicense ? ( diff --git a/apps/web/lib/app-providers-app-dir.tsx b/apps/web/lib/app-providers-app-dir.tsx index c813aa3f8c..0a80b40feb 100644 --- a/apps/web/lib/app-providers-app-dir.tsx +++ b/apps/web/lib/app-providers-app-dir.tsx @@ -10,6 +10,7 @@ import type { AppProps as NextAppProps } from "next/app"; import type { ReadonlyURLSearchParams } from "next/navigation"; import { useSearchParams } from "next/navigation"; import { useEffect, type ReactNode } from "react"; +import CacheProvider from "react-inlinesvg/provider"; import { OrgBrandingProvider } from "@calcom/features/ee/organizations/context/provider"; import DynamicHelpscoutProvider from "@calcom/features/ee/support/lib/helpscout/providerDynamic"; @@ -273,7 +274,10 @@ const AppProviders = (props: PageWrapperProps) => { isBookingPage={props.isBookingPage || isBookingPage}> - {props.children} + {/* @ts-expect-error FIXME remove this comment when upgrading typescript to v5 */} + + {props.children} + diff --git a/apps/web/lib/app-providers.tsx b/apps/web/lib/app-providers.tsx index caf1856c1e..34975b68f4 100644 --- a/apps/web/lib/app-providers.tsx +++ b/apps/web/lib/app-providers.tsx @@ -10,6 +10,7 @@ import type { AppProps as NextAppProps, AppProps as NextJsAppProps } from "next/ import type { ParsedUrlQuery } from "querystring"; import type { PropsWithChildren, ReactNode } from "react"; import { useEffect } from "react"; +import CacheProvider from "react-inlinesvg/provider"; import { OrgBrandingProvider } from "@calcom/features/ee/organizations/context/provider"; import DynamicHelpscoutProvider from "@calcom/features/ee/support/lib/helpscout/providerDynamic"; @@ -299,7 +300,10 @@ const AppProviders = (props: AppPropsWithChildren) => { router={props.router}> - {props.children} + {/* @ts-expect-error FIXME remove this comment when upgrading typescript to v5 */} + + {props.children} + diff --git a/packages/platform/atoms/cal-provider/BaseCalProvider.tsx b/packages/platform/atoms/cal-provider/BaseCalProvider.tsx index 95e8a58fe9..44480f384b 100644 --- a/packages/platform/atoms/cal-provider/BaseCalProvider.tsx +++ b/packages/platform/atoms/cal-provider/BaseCalProvider.tsx @@ -2,6 +2,7 @@ import { TooltipProvider } from "@radix-ui/react-tooltip"; import { useState } from "react"; import { useCallback } from "react"; +import { IconSprites } from "@calcom/ui"; import deTranslations from "@calcom/web/public/static/locales/de/common.json"; import enTranslations from "@calcom/web/public/static/locales/en/common.json"; import esTranslations from "@calcom/web/public/static/locales/es/common.json"; @@ -124,6 +125,7 @@ export function BaseCalProvider({ }}> {children} + ) : ( {children} + ); diff --git a/packages/ui/components/icon/Icon.tsx b/packages/ui/components/icon/Icon.tsx index b456801811..7a7c89a3c3 100644 --- a/packages/ui/components/icon/Icon.tsx +++ b/packages/ui/components/icon/Icon.tsx @@ -12,7 +12,7 @@ function Icon({ }) { return ( - + ); } diff --git a/packages/ui/components/icon/IconSprites.tsx b/packages/ui/components/icon/IconSprites.tsx new file mode 100644 index 0000000000..128912a786 --- /dev/null +++ b/packages/ui/components/icon/IconSprites.tsx @@ -0,0 +1,12 @@ +import * as React from "react"; +import SVG from "react-inlinesvg"; + +export function IconSprites() { + return ( + + ); +} + +export default IconSprites; diff --git a/packages/ui/index.tsx b/packages/ui/index.tsx index 8ef6994188..e1511fe499 100644 --- a/packages/ui/index.tsx +++ b/packages/ui/index.tsx @@ -203,3 +203,4 @@ export type { OrgBannerProps } from "./components/organization-banner"; export { StorybookTrpcProvider } from "./components/mocks/trpc"; export { default as Icon } from "./components/icon/Icon"; export type { IconName } from "./components/icon/icon-names"; +export { IconSprites } from "./components/icon/IconSprites"; diff --git a/packages/ui/package.json b/packages/ui/package.json index bdacfbe146..87adc58ef1 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -48,6 +48,7 @@ "react-colorful": "^5.6.0", "react-day-picker": "^8.10.1", "react-hook-form": "^7.43.3", + "react-inlinesvg": "^4.1.3", "react-select": "^5.7.0", "react-virtual": "^2.10.4" }, diff --git a/yarn.lock b/yarn.lock index 5a76fa70a9..5578f199ee 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4867,6 +4867,7 @@ __metadata: react-colorful: ^5.6.0 react-day-picker: ^8.10.1 react-hook-form: ^7.43.3 + react-inlinesvg: ^4.1.3 react-select: ^5.7.0 react-virtual: ^2.10.4 typescript: ^4.9.4 @@ -35715,6 +35716,15 @@ __metadata: languageName: node linkType: hard +"react-from-dom@npm:^0.7.2": + version: 0.7.3 + resolution: "react-from-dom@npm:0.7.3" + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + checksum: c2dd74dbdae570ce3ce2f7466643ac8e27de2511cb73cb3027fdfc572bed7bb058e1c459ffb32d02e2c41e4c21b0ca490d0dc861f30452fe3689d2e938ad7277 + languageName: node + linkType: hard + "react-hook-form@npm:^7.43.3": version: 7.43.3 resolution: "react-hook-form@npm:7.43.3" @@ -35776,6 +35786,17 @@ __metadata: languageName: node linkType: hard +"react-inlinesvg@npm:^4.1.3": + version: 4.1.3 + resolution: "react-inlinesvg@npm:4.1.3" + dependencies: + react-from-dom: ^0.7.2 + peerDependencies: + react: 16.8 - 18 + checksum: c8b3f670188b645f03172ca89c653435cf41d99123791694e7525a5a2531a0bde4451735afe4e82a7188d8f90a362cb55f49bf8160cd77cd4fd5b1c78aa0f324 + languageName: node + linkType: hard + "react-inspector@npm:^5.1.1": version: 5.1.1 resolution: "react-inspector@npm:5.1.1"