Reduce bundle size by importing single icons at a time (#6644)
* Removed barrel import for icons to reduce bundle size. * Fixed replacement mistakes * Reverted unneccesary yarn.lock updates * Added some missed Icon. import conversions * Remove merge artifact import in @calcom/ui * Don't import Icon in pages/[user] * Update packages/ui/package.json Co-authored-by: Alex van Andel <[email protected]> Co-authored-by: Omar López <[email protected]>
This commit is contained in:
155 files changed
+881
-768
No files matched your search
@@ -6,7 +6,7 @@ import { classNames } from "@calcom/lib";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import type { AppFrontendPayload as App } from "@calcom/types/App";
|
||||
import type { CredentialFrontendPayload as Credential } from "@calcom/types/Credential";
|
||||
import { Icon } from "@calcom/ui";
|
||||
import { FiChevronLeft, FiChevronRight, FiSearch } from "@calcom/ui/components/icon";
|
||||
|
||||
import { EmptyScreen } from "../empty-screen";
|
||||
import { AppCard } from "./AppCard";
|
||||
@@ -78,7 +78,7 @@ function CategoryTab({ selectedCategory, categories, searchText }: CategoryTabPr
|
||||
{leftVisible && (
|
||||
<button onClick={handleLeft} className="absolute top-9 flex md:left-1/2 md:-top-1">
|
||||
<div className="flex h-12 w-5 items-center justify-end bg-white">
|
||||
<Icon.FiChevronLeft className="h-4 w-4 text-gray-500" />
|
||||
<FiChevronLeft className="h-4 w-4 text-gray-500" />
|
||||
</div>
|
||||
<div className="flex h-12 w-5 bg-gradient-to-l from-transparent to-white" />
|
||||
</button>
|
||||
@@ -121,7 +121,7 @@ function CategoryTab({ selectedCategory, categories, searchText }: CategoryTabPr
|
||||
<button onClick={handleRight} className="absolute top-9 right-0 flex md:-top-1">
|
||||
<div className="flex h-12 w-5 bg-gradient-to-r from-transparent to-white" />
|
||||
<div className="flex h-12 w-5 items-center justify-end bg-white">
|
||||
<Icon.FiChevronRight className="h-4 w-4 text-gray-500" />
|
||||
<FiChevronRight className="h-4 w-4 text-gray-500" />
|
||||
</div>
|
||||
</button>
|
||||
)}
|
||||
@@ -175,7 +175,7 @@ export function AllApps({ apps, searchText, categories }: AllAppsPropsType) {
|
||||
</div>
|
||||
) : (
|
||||
<EmptyScreen
|
||||
Icon={Icon.FiSearch}
|
||||
Icon={FiSearch}
|
||||
headline={t("no_results")}
|
||||
description={searchText ? searchText?.toString() : ""}
|
||||
/>
|
||||
|
||||
@@ -6,8 +6,8 @@ import { InstallAppButton } from "@calcom/app-store/components";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { AppFrontendPayload as App } from "@calcom/types/App";
|
||||
import type { CredentialFrontendPayload as Credential } from "@calcom/types/Credential";
|
||||
|
||||
import { Button, Icon, showToast } from "../..";
|
||||
import { Button, showToast } from "@calcom/ui";
|
||||
import { FiPlus } from "@calcom/ui/components/icon";
|
||||
|
||||
interface AppCardProps {
|
||||
app: App;
|
||||
@@ -100,7 +100,7 @@ export function AppCard({ app, credentials, searchText }: AppCardProps) {
|
||||
<Button
|
||||
color="secondary"
|
||||
className="[@media(max-width:260px)]:w-full [@media(max-width:260px)]:justify-center"
|
||||
StartIcon={Icon.FiPlus}
|
||||
StartIcon={FiPlus}
|
||||
{...props}>
|
||||
{t("install")}
|
||||
</Button>
|
||||
@@ -125,7 +125,7 @@ export function AppCard({ app, credentials, searchText }: AppCardProps) {
|
||||
}
|
||||
return (
|
||||
<Button
|
||||
StartIcon={Icon.FiPlus}
|
||||
StartIcon={FiPlus}
|
||||
color="secondary"
|
||||
className="[@media(max-width:260px)]:w-full [@media(max-width:260px)]:justify-center"
|
||||
data-testid="install-app-button"
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import Link from "next/link";
|
||||
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { Icon, SkeletonText } from "@calcom/ui";
|
||||
import { SkeletonText } from "@calcom/ui";
|
||||
import { FiArrowRight } from "@calcom/ui/components/icon";
|
||||
|
||||
import { Slider } from "./Slider";
|
||||
|
||||
@@ -43,7 +44,7 @@ export function AppStoreCategories({
|
||||
)}
|
||||
<p className="pt-2 text-sm font-medium text-gray-500">
|
||||
{isLocaleReady ? t("number_apps", { count: category.count }) : <SkeletonText invisible />}{" "}
|
||||
<Icon.FiArrowRight className="inline-block h-4 w-4" />
|
||||
<FiArrowRight className="inline-block h-4 w-4" />
|
||||
</p>
|
||||
</div>
|
||||
</Link>
|
||||
|
||||
@@ -4,8 +4,8 @@ import "@glidejs/glide/dist/css/glide.theme.min.css";
|
||||
import { ComponentProps, FC, useEffect, useRef } from "react";
|
||||
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { FiArrowLeft, FiArrowRight } from "@calcom/ui/components/icon";
|
||||
|
||||
import { Icon } from "../../components/icon";
|
||||
import { SkeletonText } from "../skeleton";
|
||||
|
||||
const SliderButton: FC<ComponentProps<"button">> = (props) => {
|
||||
@@ -68,10 +68,10 @@ export const Slider = <T extends string | unknown>({
|
||||
)}
|
||||
<div className="glide__arrows ml-auto flex items-center gap-x-1" data-glide-el="controls">
|
||||
<SliderButton data-glide-dir="<">
|
||||
<Icon.FiArrowLeft className="h-5 w-5" />
|
||||
<FiArrowLeft className="h-5 w-5" />
|
||||
</SliderButton>
|
||||
<SliderButton data-glide-dir=">">
|
||||
<Icon.FiArrowRight className="h-5 w-5" />
|
||||
<FiArrowRight className="h-5 w-5" />
|
||||
</SliderButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user