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:
authored and GitHub committed 2023-01-23 23:08:01 +00:00
1 parent a888be6e04
commit cfa8fd8b67
155 files changed
+881 -768

No files matched your search

@@ -2,8 +2,9 @@ import { WebhookTriggerEvents } from "@prisma/client";
import classNames from "@calcom/lib/classNames";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { RouterOutputs, trpc } from "@calcom/trpc/react";
import { Badge, Button, Icon, showToast, Switch, Tooltip } from "@calcom/ui";
import { trpc } from "@calcom/trpc/react";
import { Badge, Button, showToast, Switch, Tooltip } from "@calcom/ui";
import { FiAlertCircle, FiTrash } from "@calcom/ui/components/icon";
type WebhookProps = {
id: string;
@@ -50,7 +51,7 @@ export default function WebhookListItem(props: {
className="ltr:mr-2 rtl:ml-2"
variant="gray"
bold
StartIcon={Icon.FiAlertCircle}>
StartIcon={FiAlertCircle}>
{t(`${trigger.toLowerCase()}`)}
</Badge>
))}
@@ -74,7 +75,7 @@ export default function WebhookListItem(props: {
</Button>
<Button
color="destructive"
StartIcon={Icon.FiTrash}
StartIcon={FiTrash}
variant="icon"
onClick={() => {
// TODO: Confimation dialog before deleting
@@ -2,7 +2,8 @@ import { useWatch } from "react-hook-form";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { trpc } from "@calcom/trpc/react";
import { Badge, Button, Icon, showToast } from "@calcom/ui";
import { Badge, Button, showToast } from "@calcom/ui";
import { FiActivity } from "@calcom/ui/components/icon";
export default function WebhookTestDisclosure() {
const subscriberUrl: string = useWatch({ name: "subscriberUrl" });
@@ -29,7 +30,7 @@ export default function WebhookTestDisclosure() {
type="button"
color="secondary"
disabled={mutation.isLoading || !subscriberUrl}
StartIcon={Icon.FiActivity}
StartIcon={FiActivity}
onClick={() => mutation.mutate({ url: subscriberUrl, type: "PING", payloadTemplate })}>
{t("ping_test")}
</Button>
@@ -4,7 +4,8 @@ import { Suspense } from "react";
import { APP_NAME, WEBAPP_URL } from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { trpc } from "@calcom/trpc/react";
import { Button, EmptyScreen, Icon, Meta, SkeletonText } from "@calcom/ui";
import { Button, EmptyScreen, Meta, SkeletonText } from "@calcom/ui";
import { FiPlus, FiLink } from "@calcom/ui/components/icon";
import { getLayout } from "../../settings/layouts/SettingsLayout";
import { WebhookListItem, WebhookListSkeleton } from "../components";
@@ -29,7 +30,7 @@ const NewWebhookButton = () => {
<Button
color="secondary"
data-testid="new_webhook"
StartIcon={Icon.FiPlus}
StartIcon={FiPlus}
href={`${WEBAPP_URL}/settings/developer/webhooks/new`}>
{isLocaleReady ? t("new_webhook") : <SkeletonText className="h-4 w-24" />}
</Button>
@@ -63,7 +64,7 @@ const WebhooksList = () => {
</>
) : (
<EmptyScreen
Icon={Icon.FiLink}
Icon={FiLink}
headline={t("create_your_first_webhook")}
description={t("create_your_first_webhook_description", { appName: APP_NAME })}
buttonRaw={<NewWebhookButton />}