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

@@ -1,5 +1,6 @@
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { Dropdown, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, Icon } from "@calcom/ui";
import { Dropdown, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@calcom/ui";
import { FiChevronDown } from "@calcom/ui/components/icon";
interface IAddVariablesDropdown {
addVariable: (variable: string) => void;
@@ -18,14 +19,14 @@ export const AddVariablesDropdown = (props: IAddVariablesDropdown) => {
<>
<div className="hidden sm:flex">
{t("add_variable")}
<Icon.FiChevronDown className="mt-[2px] ml-1 h-4 w-4" />
<FiChevronDown className="mt-[2px] ml-1 h-4 w-4" />
</div>
<div className="block sm:hidden">+</div>
</>
) : (
<div className="flex">
{t("add_variable")}
<Icon.FiChevronDown className="mt-[2px] ml-1 h-4 w-4" />
<FiChevronDown className="mt-[2px] ml-1 h-4 w-4" />
</div>
)}
</div>
@@ -29,15 +29,8 @@ import {
import { useCallback, useEffect, useRef, useState } from "react";
import { createPortal } from "react-dom";
import {
Icon,
Dropdown,
DropdownMenuTrigger,
DropdownMenuItem,
DropdownItem,
DropdownMenuContent,
Button,
} from "@calcom/ui";
import { Dropdown, DropdownMenuTrigger, DropdownMenuItem, DropdownMenuContent, Button } from "@calcom/ui";
import { FiChevronDown } from "@calcom/ui/components/icon";
import { TextEditorProps } from "../Editor";
import { AddVariablesDropdown } from "./AddVariablesDropdown";
@@ -407,7 +400,7 @@ export default function ToolbarPlugin(props: TextEditorProps) {
<span className="text hidden text-gray-700 sm:flex">
{blockTypeToBlockName[blockType as keyof BlockType]}
</span>
<Icon.FiChevronDown className="ml-2 h-4 w-4 text-gray-700" />
<FiChevronDown className="ml-2 h-4 w-4 text-gray-700" />
</>
</DropdownMenuTrigger>
<DropdownMenuContent>