From 2dbf92f7f1b34b2a09f8c67580f0fb47f3c36ade Mon Sep 17 00:00:00 2001
From: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com>
Date: Wed, 28 Aug 2024 16:55:28 +0200
Subject: [PATCH] perf: reduce bundle size by 21% with direct icon imports
(#3844)
---
web/src/components/AppearanceSelect.tsx | 8 ++---
.../components/ChangeMemberPasswordDialog.tsx | 4 +--
web/src/components/ChangePasswordDialog.tsx | 4 +--
.../components/CreateAccessTokenDialog.tsx | 4 +--
.../CreateIdentityProviderDialog.tsx | 4 +--
web/src/components/CreateWebhookDialog.tsx | 4 +--
web/src/components/Empty.tsx | 4 +--
.../ExploreSidebar/ExploreSidebarDrawer.tsx | 4 +--
.../HomeSidebar/HomeSidebarDrawer.tsx | 4 +--
.../components/HomeSidebar/TagsSection.tsx | 14 ++++----
web/src/components/Icon.tsx | 3 --
.../components/Inbox/MemoCommentMessage.tsx | 9 ++----
.../components/Inbox/VersionUpdateMessage.tsx | 9 ++----
web/src/components/LearnMore.tsx | 4 +--
web/src/components/LocaleSelect.tsx | 4 +--
web/src/components/MemoActionMenu.tsx | 23 +++++++++----
web/src/components/MemoContent/CodeBlock.tsx | 4 +--
.../EmbeddedContent/EmbeddedMemo.tsx | 4 +--
.../MemoDetailSidebar/MemoDetailSidebar.tsx | 10 +++---
.../MemoDetailSidebarDrawer.tsx | 4 +--
web/src/components/MemoDisplaySettingMenu.tsx | 4 +--
.../ActionButton/AddMemoRelationPopover.tsx | 4 +--
.../MemoEditor/ActionButton/MarkdownMenu.tsx | 8 ++---
.../MemoEditor/ActionButton/TagSelector.tsx | 4 +--
.../ActionButton/UploadResourceButton.tsx | 4 +--
.../MemoEditor/RelationListView.tsx | 6 ++--
.../MemoEditor/ResourceListView.tsx | 4 +--
web/src/components/MemoEditor/index.tsx | 4 +--
web/src/components/MemoFilters.tsx | 20 ++++++------
web/src/components/MemoRelationListView.tsx | 10 +++---
web/src/components/MemoView.tsx | 6 ++--
web/src/components/Navigation.tsx | 20 ++++++------
web/src/components/NavigationDrawer.tsx | 4 +--
web/src/components/PreviewImageDialog.tsx | 4 +--
web/src/components/ReactionSelector.tsx | 4 +--
web/src/components/RenameTagDialog.tsx | 4 +--
web/src/components/ResourceIcon.tsx | 32 ++++++++++++-------
web/src/components/SearchBar.tsx | 4 +--
.../Settings/AccessTokenSection.tsx | 6 ++--
web/src/components/Settings/MemberSection.tsx | 4 +--
.../components/Settings/MyAccountSection.tsx | 6 ++--
web/src/components/Settings/SSOSection.tsx | 4 +--
.../components/Settings/StorageSection.tsx | 4 +--
.../components/Settings/WebhookSection.tsx | 6 ++--
.../components/Settings/WorkspaceSection.tsx | 4 +--
web/src/components/TagTree.tsx | 6 ++--
web/src/components/UpdateAccountDialog.tsx | 6 ++--
.../UpdateCustomizedProfileDialog.tsx | 4 +--
web/src/components/UserBanner.tsx | 6 ++--
web/src/components/UserStatisticsView.tsx | 18 ++++-------
web/src/components/VisibilityIcon.tsx | 8 ++---
web/src/layouts/RootLayout.tsx | 6 ++--
web/src/pages/About.tsx | 8 ++---
web/src/pages/Archived.tsx | 10 +++---
web/src/pages/AuthCallback.tsx | 4 +--
web/src/pages/Explore.tsx | 4 +--
web/src/pages/Home.tsx | 4 +--
web/src/pages/Inboxes.tsx | 4 +--
web/src/pages/Loading.tsx | 4 +--
web/src/pages/MemoDetail.tsx | 8 ++---
web/src/pages/Resources.tsx | 8 ++---
web/src/pages/Setting.tsx | 17 +++++-----
web/src/pages/UserProfile.tsx | 6 ++--
63 files changed, 222 insertions(+), 217 deletions(-)
delete mode 100644 web/src/components/Icon.tsx
diff --git a/web/src/components/AppearanceSelect.tsx b/web/src/components/AppearanceSelect.tsx
index 521b40841..6fc0296e5 100644
--- a/web/src/components/AppearanceSelect.tsx
+++ b/web/src/components/AppearanceSelect.tsx
@@ -1,7 +1,7 @@
import { Option, Select } from "@mui/joy";
+import { SunIcon, MoonIcon, SmileIcon } from "lucide-react";
import { FC } from "react";
import { useTranslate } from "@/utils/i18n";
-import Icon from "./Icon";
interface Props {
value: Appearance;
@@ -18,11 +18,11 @@ const AppearanceSelect: FC
{t("setting.account-section.change-password")}
Create access token
{t(isCreating ? "setting.sso-section.create-sso" : "setting.sso-section.update-sso")}
{isCreating ? "Create webhook" : "Edit webhook"}
{t("tag.create-tags-guide")}