Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: use named imports for icons

Abdullah Attacd792625ac86
diff --git a/apps/web/src/common/dialog-controller.tsx b/apps/web/src/common/dialog-controller.tsx
index c6f6038ef..6e70c71f4 100644
--- a/apps/web/src/common/dialog-controller.tsx
+++ b/apps/web/src/common/dialog-controller.tsx
@@ -29,7 +29,7 @@ import { store as noteStore } from "../stores/note-store";
import { db } from "./db";
import { showToast } from "../utils/toast";
import { Text } from "@theme-ui/components";
-import * as Icon from "../components/icons";
+import { Topic } from "../components/icons";
import Config from "../utils/config";
import { AppVersion, getChangelog } from "../utils/version";
import { Period } from "../dialogs/buy-dialog/types";
@@ -489,7 +489,7 @@ export function showEditTopicDialog(notebookId: string, topicId: string) {
title={"Edit topic"}
subtitle={`You are editing "${topic.title}" topic.`}
defaultValue={topic.title}
- icon={Icon.Topic}
+ icon={Topic}
item={topic}
onClose={() => perform(false)}
onAction={async (t: string) => {
diff --git a/apps/web/src/common/reminders.js b/apps/web/src/common/reminders.js
index d8534f95b..77dc5455d 100644
--- a/apps/web/src/common/reminders.js
+++ b/apps/web/src/common/reminders.js
@@ -21,7 +21,7 @@ import Config from "../utils/config";
import { createBackup, verifyAccount } from "./index";
import { db } from "./db";
import { store as appStore } from "../stores/app-store";
-import * as Icon from "../components/icons";
+import { Backup, User, Email, Warn } from "../components/icons";
import dayjs from "dayjs";
import {
showBuyDialog,
@@ -114,21 +114,21 @@ export const Reminders = {
subtitle: "Please upgrade to Pro to enable automatic backups.",
action: () => showBuyDialog(),
dismissable: true,
- icon: Icon.Backup
+ icon: Backup
},
login: {
key: "login",
title: "Login to sync your notes",
subtitle: "You are not logged in",
action: () => hardNavigate("/login"),
- icon: Icon.User
+ icon: User
},
email: {
key: "email",
title: "Your email is not confirmed",
subtitle: "Please confirm your email to sync your notes",
action: () => hashNavigate("/email/verify"),
- icon: Icon.Email
+ icon: Email
},
recoverykey: {
key: "recoverykey",
@@ -138,7 +138,7 @@ export const Reminders = {
action: async () => {
if (await verifyAccount()) await showRecoveryKeyDialog();
},
- icon: Icon.Warn
+ icon: Warn
}
};
diff --git a/apps/web/src/components/accent-item/index.jsx b/apps/web/src/components/accent-item/index.jsx
index 4251405a7..b1a4f2155 100644
--- a/apps/web/src/components/accent-item/index.jsx
+++ b/apps/web/src/components/accent-item/index.jsx
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { Flex } from "@theme-ui/components";
-import * as Icon from "../icons";
+import { Checkmark, Circle } from "../icons";
import { useStore as useThemeStore } from "../../stores/theme-store";
import { showBuyDialog } from "../../common/dialog-controller";
import { isUserPremium } from "../../hooks/use-is-user-premium";
@@ -41,7 +41,7 @@ function AccentItem(props) {
key={label}
>
{code === accent && (
- <Icon.Checkmark
+ <Checkmark
sx={{
position: "absolute",
zIndex: 1,
@@ -51,7 +51,7 @@ function AccentItem(props) {
size={20}
/>
)}
- <Icon.Circle size={40} sx={{ cursor: "pointer" }} color={code} />
+ <Circle size={40} sx={{ cursor: "pointer" }} color={code} />
</Flex>
);
}
diff --git a/apps/web/src/components/announcements/body.jsx b/apps/web/src/components/announcements/body.jsx
index 8f346d4a6..981ff85b2 100644
--- a/apps/web/src/components/announcements/body.jsx
+++ b/apps/web/src/components/announcements/body.jsx
@@ -29,7 +29,16 @@ import {
showBuyDialog
} from "../../common/dialog-controller";
import { ANALYTICS_EVENTS, trackEvent } from "../../utils/analytics";
-import * as Icon from "../icons";
+import {
+ Sync,
+ Notebook,
+ Tag2,
+ Attachment,
+ Backup,
+ Vault,
+ PDF,
+ Edit
+} from "../icons";
import { store as appStore } from "../../stores/app-store";
import { createBackup } from "../../common";
import { allowedPlatforms } from "../../stores/announcement-store";
@@ -38,14 +47,14 @@ var margins = [0, 2];
var HORIZONTAL_MARGIN = 3;
const features = [
- { icon: Icon.Sync, title: "Instant private sync" },
- { icon: Icon.Notebook, title: "Unlimited notebooks" },
- { icon: Icon.Tag2, title: "Unlimited tags" },
- { icon: Icon.Attachment, title: "Encrypted attachments" },
- { icon: Icon.Backup, title: "Encrypted backups" },
- { icon: Icon.Vault, title: "Secure private vault" },
- { icon: Icon.PDF, title: "Export to PDF" },
- { icon: Icon.Edit, title: "Rich text editor" }
+ { icon: Sync, title: "Instant private sync" },
+ { icon: Notebook, title: "Unlimited notebooks" },
+ { icon: Tag2, title: "Unlimited tags" },
+ { icon: Attachment, title: "Encrypted attachments" },
+ { icon: Backup, title: "Encrypted backups" },
+ { icon: Vault, title: "Secure private vault" },
+ { icon: PDF, title: "Export to PDF" },
+ { icon: Edit, title: "Rich text editor" }
];
export default function AnnouncementBody({ components, type, dismiss }) {
diff --git a/apps/web/src/components/announcements/index.jsx b/apps/web/src/components/announcements/index.jsx
index 92733c5c0..b19a10ade 100644
--- a/apps/web/src/components/announcements/index.jsx
+++ b/apps/web/src/components/announcements/index.jsx
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { Flex, Text } from "@theme-ui/components";
-import * as Icon from "../icons";
+import { Cross } from "../icons";
import { ANALYTICS_EVENTS, trackEvent } from "../../utils/analytics";
import AnnouncementBody from "./body";
import { useStore as useAnnouncementStore } from "../../stores/announcement-store";
@@ -61,7 +61,7 @@ function Announcements() {
dismiss(announcement.id);
}}
>
- <Icon.Cross color="error" size={16} />
+ <Cross color="error" size={16} />
</Text>
<AnnouncementBody components={announcement.body} type="inline" />
</Flex>
diff --git a/apps/web/src/components/dialog/index.tsx b/apps/web/src/components/dialog/index.tsx
index 94d24eddc..a27de165a 100644
--- a/apps/web/src/components/dialog/index.tsx
+++ b/apps/web/src/components/dialog/index.tsx
@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import React from "react";
import { Flex, Text, Button, ButtonProps } from "@theme-ui/components";
-import * as Icon from "../icons";
+import { Loading, Close } from "../icons";
import ReactModal from "react-modal";
import { FlexScrollContainer } from "../scroll-container";
import { SxProp } from "@theme-ui/core";
@@ -102,7 +102,7 @@ function BaseDialog(props: React.PropsWithChildren<DialogProps>) {
}}
>
{props.showCloseButton && (
- <Icon.Close
+ <Close
sx={{
position: "absolute",
cursor: "pointer",
@@ -199,7 +199,7 @@ function DialogButton(props: DialogButtonProps) {
disabled={props.disabled}
onClick={props.disabled ? undefined : props.onClick}
>
- {props.loading ? <Icon.Loading size={16} color="primary" /> : props.text}
+ {props.loading ? <Loading size={16} color="primary" /> : props.text}
</Button>
);
}
diff --git a/apps/web/src/components/diff-viewer/index.jsx b/apps/web/src/components/diff-viewer/index.jsx
index d0625eeb4..bd12d0674 100644
--- a/apps/web/src/components/diff-viewer/index.jsx
+++ b/apps/web/src/components/diff-viewer/index.jsx
@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { useState, useEffect, useCallback } from "react";
import { Flex, Text, Button } from "@theme-ui/components";
-import * as Icon from "../icons";
+import { Loading, ImageDownload } from "../icons";
import ContentToggle from "./content-toggle";
import { store as notesStore } from "../../stores/note-store";
import { db } from "../../common/db";
@@ -172,9 +172,9 @@ function DiffViewer(props) {
}}
>
{isDownloadingImages ? (
- <Icon.Loading size={18} />
+ <Loading size={18} />
) : (
- <Icon.ImageDownload size={18} />
+ <ImageDownload size={18} />
)}
<Text
ml={1}
diff --git a/apps/web/src/components/editor/header.jsx b/apps/web/src/components/editor/header.jsx
index 1c3130560..7b9869ada 100644
--- a/apps/web/src/components/editor/header.jsx
+++ b/apps/web/src/components/editor/header.jsx
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { useCallback, useEffect, useMemo, useRef } from "react";
import { useStore } from "../../stores/editor-store";
import { Input } from "@theme-ui/components";
-import * as Icon from "../icons";
+import { Tag, Plus } from "../icons";
import { Flex } from "@theme-ui/components";
import IconTag from "../icon-tag";
import { db } from "../../common/db";
@@ -46,7 +46,7 @@ function Header({ readonly }) {
testId={`tag`}
key={tag}
text={db.tags.alias(tag)}
- icon={Icon.Tag}
+ icon={Tag}
title={`Click to remove`}
onClick={() => setTag(tag)}
styles={{ container: { mr: 1 }, text: { fontSize: "body" } }}
@@ -120,7 +120,7 @@ export function Autosuggest({
items.push({
key: "new",
title: () => `Create "${filterText}" tag`,
- icon: Icon.Plus,
+ icon: Plus,
onClick: () => onAction("add", filterText)
});
}
@@ -130,7 +130,7 @@ export function Autosuggest({
...filtered.map((tag) => ({
key: tag.id,
title: () => tag.alias,
- icon: Icon.Tag,
+ icon: Tag,
onClick: () => onAction("select", tag)
}))
);
diff --git a/apps/web/src/components/editor/loading.tsx b/apps/web/src/components/editor/loading.tsx
index cea681d6a..50386aa9e 100644
--- a/apps/web/src/components/editor/loading.tsx
+++ b/apps/web/src/components/editor/loading.tsx
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { Flex, Text } from "@theme-ui/components";
-import * as Icon from "../icons";
+import { Loading } from "../icons";
function EditorLoading({ text }: { text?: string }) {
return (
@@ -30,7 +30,7 @@ function EditorLoading({ text }: { text?: string }) {
justifyContent: "center"
}}
>
- <Icon.Loading color="primary" sx={{ mt: 2 }} />
+ <Loading color="primary" sx={{ mt: 2 }} />
<Text variant="body" mt={2} sx={{ textAlign: "center" }}>
{text || "Loading editor. Please wait..."}
</Text>
diff --git a/apps/web/src/components/editor/toolbar.jsx b/apps/web/src/components/editor/toolbar.jsx
index 47d0a08e1..5f48b786c 100644
--- a/apps/web/src/components/editor/toolbar.jsx
+++ b/apps/web/src/components/editor/toolbar.jsx
@@ -19,7 +19,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { useEffect, useMemo, useState } from "react";
import { Button, Flex, Text } from "@theme-ui/components";
-import * as Icon from "../icons";
+import {
+ Published,
+ Publish,
+ EditorNormalWidth,
+ EditorFullWidth,
+ ThemeIcon,
+ FocusMode,
+ NormalMode,
+ ExitFullscreen,
+ Fullscreen,
+ Search,
+ Undo,
+ Redo,
+ Properties,
+ ArrowLeft
+} from "../icons";
import { useStore as useAppStore } from "../../stores/app-store";
import { useStore as useThemeStore } from "../../stores/theme-store";
import { useStore as useMonographStore } from "../../stores/monograph-store";
@@ -80,7 +95,7 @@ function Toolbar() {
() => [
{
title: isNotePublished ? "Published" : "Publish",
- icon: isNotePublished ? Icon.Published : Icon.Publish,
+ icon: isNotePublished ? Published : Publish,
hidden: !sessionId || isDeleted,
enabled: !isLocked,
onClick: () => showPublishView(store.get().session.id, "top")
@@ -95,20 +110,20 @@ function Toolbar() {
title: editorMargins
? "Disable editor margins"
: "Enable editor margins",
- icon: editorMargins ? Icon.EditorNormalWidth : Icon.EditorFullWidth,
+ icon: editorMargins ? EditorNormalWidth : EditorFullWidth,
enabled: true,
onClick: () => toggleEditorMargins()
},
{
title: theme === "dark" ? "Light mode" : "Dark mode",
- icon: Icon.ThemeIcon,
+ icon: ThemeIcon,
hidden: !isFocusMode,
enabled: true,
onClick: () => toggleNightMode()
},
{
title: isFocusMode ? "Normal mode" : "Focus mode",
- icon: isFocusMode ? Icon.FocusMode : Icon.NormalMode,
+ icon: isFocusMode ? FocusMode : NormalMode,
enabled: true,
hideOnMobile: true,
onClick: () => {
@@ -122,7 +137,7 @@ function Toolbar() {
},
{
title: isFullscreen ? "Exit fullscreen" : "Enter fullscreen",
- icon: isFullscreen ? Icon.ExitFullscreen : Icon.Fullscreen,
+ icon: isFullscreen ? ExitFullscreen : Fullscreen,
enabled: true,
hidden: !isFocusMode,
hideOnMobile: true,
@@ -137,28 +152,28 @@ function Toolbar() {
},
{
title: "Search",
- icon: Icon.Search,
+ icon: Search,
enabled: true,
hidden: !sessionId || isDeleted,
onClick: () => toggleSearch()
},
{
title: "Undo",
- icon: Icon.Undo,
+ icon: Undo,
enabled: canUndo,
hidden: !sessionId || isDeleted,
onClick: () => undo()
},
{
title: "Redo",
- icon: Icon.Redo,
+ icon: Redo,
enabled: canRedo,
hidden: !sessionId || isDeleted,
onClick: () => redo()
},
{
title: "Properties",
- icon: Icon.Properties,
+ icon: Properties,
enabled: true,
hidden: !sessionId || isFocusMode || isDeleted,
onClick: toggleProperties
@@ -187,7 +202,7 @@ function Toolbar() {
return (
<Flex mx={2} my={1} sx={{ justifyContent: "space-between" }}>
<Flex sx={{ flex: 1, alignItems: "center", justifyContent: "center" }}>
- <Icon.ArrowLeft
+ <ArrowLeft
sx={{
display: ["block", "none", "none"],
flexShrink: 0
diff --git a/apps/web/src/components/field/index.jsx b/apps/web/src/components/field/index.jsx
index 97ea3174f..ffeb2e8e1 100644
--- a/apps/web/src/components/field/index.jsx
+++ b/apps/web/src/components/field/index.jsx
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { useState } from "react";
import { Button, Flex, Text } from "@theme-ui/components";
import { Input, Label } from "@theme-ui/components";
-import * as Icon from "../icons";
+import { PasswordVisible, PasswordInvisible, Check, Cross } from "../icons";
const passwordValidationRules = [
{
@@ -176,11 +176,7 @@ function Field(props) {
":hover": { bg: "border" }
}}
>
- {isPasswordVisible ? (
- <Icon.PasswordVisible />
- ) : (
- <Icon.PasswordInvisible />
- )}
+ {isPasswordVisible ? <PasswordVisible /> : <PasswordInvisible />}
</Flex>
)}
{action && (
@@ -210,9 +206,9 @@ function Field(props) {
{rules.map((rule) => (
<Flex key={rule.title}>
{rule.isValid ? (
- <Icon.Check color="success" size={14} />
+ <Check color="success" size={14} />
) : (
- <Icon.Cross color="error" size={14} />
+ <Cross color="error" size={14} />
)}
<Text ml={1} sx={{ fontSize: "body", color: "text" }}>
{rule.title}
diff --git a/apps/web/src/components/group-header/index.jsx b/apps/web/src/components/group-header/index.jsx
index 3c113d99e..c535250b0 100644
--- a/apps/web/src/components/group-header/index.jsx
+++ b/apps/web/src/components/group-header/index.jsx
@@ -17,7 +17,18 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import * as Icon from "../icons";
+import {
+ GroupBy,
+ OrderAtoZ,
+ OrderOldestNewest,
+ OrderZtoA,
+ OrderNewestOldest,
+ SortBy,
+ SortAsc,
+ SortDesc,
+ DetailedView,
+ CompactView
+} from "../icons";
import { useEffect, useMemo, useRef, useState } from "react";
import { Button, Flex, Text } from "@theme-ui/components";
import { db } from "../../common/db";
@@ -39,7 +50,7 @@ const groupByToTitleMap = {
const groupByMenu = {
key: "groupBy",
title: "Group by",
- icon: Icon.GroupBy,
+ icon: GroupBy,
items: map([
{ key: "none", title: "None" },
{ key: "default", title: "Default" },
@@ -56,11 +67,11 @@ const orderByMenu = {
icon: ({ groupOptions }) =>
groupOptions.sortDirection === "asc"
? groupOptions.sortBy === "title"
- ? Icon.OrderAtoZ
- : Icon.OrderOldestNewest
+ ? OrderAtoZ
+ : OrderOldestNewest
: groupOptions.sortBy === "title"
- ? Icon.OrderZtoA
- : Icon.OrderNewestOldest,
+ ? OrderZtoA
+ : OrderNewestOldest,
items: map([
{
key: "asc",
@@ -78,7 +89,7 @@ const orderByMenu = {
const sortByMenu = {
key: "sortBy",
title: "Sort by",
- icon: Icon.SortBy,
+ icon: SortBy,
items: map([
{
key: "dateCreated",
@@ -253,11 +264,7 @@ function GroupHeader(props) {
{type && (
<IconButton
testId={`${type}-sort-button`}
- icon={
- groupOptions.sortDirection === "asc"
- ? Icon.SortAsc
- : Icon.SortDesc
- }
+ icon={groupOptions.sortDirection === "asc" ? SortAsc : SortDesc}
title={`Grouped by ${groupByToTitleMap[groupOptions.groupBy]}`}
onClick={() => {
const groupOptions = db.settings.getGroupOptions(type);
@@ -274,9 +281,7 @@ function GroupHeader(props) {
)}
{viewMode && (
<IconButton
- icon={
- viewMode === "compact" ? Icon.DetailedView : Icon.CompactView
- }
+ icon={viewMode === "compact" ? DetailedView : CompactView}
title={
viewMode === "compact"
? "Switch to detailed view"
diff --git a/apps/web/src/components/icons/resolver.tsx b/apps/web/src/components/icons/resolver.tsx
deleted file mode 100644
index 70c700162..000000000
--- a/apps/web/src/components/icons/resolver.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
-This file is part of the Notesnook project (https://notesnook.com/)
-
-Copyright (C) 2023 Streetwriters (Private) Limited
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-import { toTitleCase, toCamelCase, KebabCase } from "@notesnook/common";
-import * as Icons from "./index";
-
-export type IconAlias = KebabCase<keyof typeof Icons>;
-export function getIconFromAlias(alias: IconAlias) {
- if (!alias) return;
- const iconName = toTitleCase(toCamelCase(alias));
- return Icons[iconName as keyof typeof Icons];
-}
-export function AliasIcon(props: Icons.IconProps & { alias?: IconAlias }) {
- if (!props.alias) return null;
-
- const iconName = toTitleCase(toCamelCase(props.alias));
- const Icon = Icons[iconName as keyof typeof Icons];
- return <Icon {...props} />;
-}
diff --git a/apps/web/src/components/list-container/index.tsx b/apps/web/src/components/list-container/index.tsx
index 75333d9aa..38d865add 100644
--- a/apps/web/src/components/list-container/index.tsx
+++ b/apps/web/src/components/list-container/index.tsx
@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { forwardRef, useEffect, useMemo, useRef, useState } from "react";
import { Flex, Button } from "@theme-ui/components";
-import * as Icon from "../icons";
+import { Plus } from "../icons";
import { ScrollerProps, Virtuoso, VirtuosoHandle } from "react-virtuoso";
import {
useStore as useSelectionStore,
@@ -266,7 +266,7 @@ function ListContainer(props: ListContainerProps) {
height: 45
}}
>
- <Icon.Plus color="static" />
+ <Plus color="static" />
</Button>
)}
</Flex>
diff --git a/apps/web/src/components/list-item/index.jsx b/apps/web/src/components/list-item/index.jsx
index a93a4ae27..d89f0fce5 100644
--- a/apps/web/src/components/list-item/index.jsx
+++ b/apps/web/src/components/list-item/index.jsx
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { Box, Flex, Text } from "@theme-ui/components";
-import * as Icon from "../icons";
+import { Copy } from "../icons";
import {
store as selectionStore,
useStore as useSelectionStore
@@ -35,7 +35,7 @@ function debugMenuItems(type) {
{
key: "copy-data",
title: () => "Copy data",
- icon: Icon.Copy,
+ icon: Copy,
onClick: async ({ [type]: item }) => {
if (type === "note" && item.contentId) {
item.additionalData = {
diff --git a/apps/web/src/components/note/index.jsx b/apps/web/src/components/note/index.jsx
index 1e2babadd..958630931 100644
--- a/apps/web/src/components/note/index.jsx
+++ b/apps/web/src/components/note/index.jsx
@@ -19,7 +19,37 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import React, { useMemo } from "react";
import { Button, Flex, Text } from "@theme-ui/components";
-import * as Icon from "../icons";
+import {
+ Topic,
+ Notebook,
+ Reminder,
+ Alert,
+ Lock,
+ Star,
+ SyncOff,
+ Attachment,
+ AttachmentError,
+ Pin,
+ PDF,
+ Markdown,
+ HTML,
+ Readonly,
+ StarOutline,
+ AddReminder,
+ Colors,
+ Tag2,
+ Print,
+ Publish,
+ Export,
+ Duplicate,
+ Sync,
+ Trash,
+ Circle,
+ AddToNotebook,
+ RemoveShortcutLink,
+ Plus,
+ Tag
+} from "../icons";
import TimeAgo from "../time-ago";
import ListItem from "../list-item";
import {
@@ -123,12 +153,12 @@ function Note(props) {
navigate(reference.url);
}}
text={reference.title}
- icon={reference.type === "topic" ? Icon.Topic : Icon.Notebook}
+ icon={reference.type === "topic" ? Topic : Notebook}
/>
))}
{reminder && isReminderActive(reminder) && (
<IconTag
- icon={Icon.Reminder}
+ icon={Reminder}
text={formatReminderTime(reminder, true)}
title={reminder.title}
styles={
@@ -154,10 +184,10 @@ function Note(props) {
{compact ? (
<>
{note.conflicted && (
- <Icon.Alert size={15} color="error" sx={{ mr: 1 }} />
+ <Alert size={15} color="error" sx={{ mr: 1 }} />
)}
{note.locked && (
- <Icon.Lock
+ <Lock
size={11}
color={"fontTertiary"}
sx={{ mr: 1 }}
@@ -165,17 +195,17 @@ function Note(props) {
/>
)}
{note.favorite && (
- <Icon.Star color={primary} size={15} sx={{ mr: 1 }} />
+ <Star color={primary} size={15} sx={{ mr: 1 }} />
)}
<TimeAgo live={true} datetime={date} locale="short" />
</>
) : (
<>
{note.conflicted && (
- <Icon.Alert size={15} color="error" sx={{ mr: 1 }} />
+ <Alert size={15} color="error" sx={{ mr: 1 }} />
)}
- {note.localOnly && <Icon.SyncOff size={13} sx={{ mr: 1 }} />}
+ {note.localOnly && <SyncOff size={13} sx={{ mr: 1 }} />}
<TimeAgo
sx={{ flexShrink: 0 }}
@@ -187,24 +217,24 @@ function Note(props) {
{attachments.length > 0 && (
<Flex mr={1}>
- <Icon.Attachment size={13} color="fontTertiary" />
+ <Attachment size={13} color="fontTertiary" />
<Text ml={"2px"}>{attachments.length}</Text>
</Flex>
)}
{failed.length > 0 && (
<Flex mr={1} title={`Errors in ${failed.length} attachments.`}>
- <Icon.AttachmentError size={13} color="error" />
+ <AttachmentError size={13} color="error" />
<Text ml={"2px"}>{failed.length}</Text>
</Flex>
)}
{note.pinned && !props.context && (
- <Icon.Pin size={13} color={primary} sx={{ mr: 1 }} />
+ <Pin size={13} color={primary} sx={{ mr: 1 }} />
)}
{note.locked && (
- <Icon.Lock
+ <Lock
size={13}
color={"fontTertiary"}
sx={{ mr: 1 }}
@@ -213,7 +243,7 @@ function Note(props) {
)}
{note.favorite && (
- <Icon.Star color={primary} size={15} sx={{ mr: 1 }} />
+ <Star color={primary} size={15} sx={{ mr: 1 }} />
)}
{tags?.map((tag) => {
@@ -282,26 +312,26 @@ const formats = [
{
type: "pdf",
title: "PDF",
- icon: Icon.PDF,
+ icon: PDF,
subtitle:
"Can be opened in any PDF reader like Adobe Acrobat or Foxit Reader."
},
{
type: "md",
title: "Markdown",
- icon: Icon.Markdown,
+ icon: Markdown,
subtitle: "Can be opened in any plain-text or markdown editor."
},
{
type: "html",
title: "HTML",
- icon: Icon.HTML,
+ icon: HTML,
subtitle: "Can be opened in any web browser like Google Chrome."
},
{
type: "txt",
title: "Text",
- icon: Icon.Text,
+ icon: Text,
subtitle: "Can be opened in any plain-text editor."
}
];
@@ -313,7 +343,7 @@ const menuItems = [
key: "pin",
title: "Pin",
checked: ({ note }) => note.pinned,
- icon: Icon.Pin,
+ icon: Pin,
onClick: async ({ note }) => {
await pin(note);
}
@@ -322,14 +352,14 @@ const menuItems = [
key: "readonly",
title: "Readonly",
checked: ({ note }) => note.readonly,
- icon: Icon.Readonly,
+ icon: Readonly,
onClick: ({ note }) => store.readonly(note.id)
},
{
key: "favorite",
title: "Favorite",
checked: ({ note }) => note.favorite,
- icon: Icon.StarOutline,
+ icon: StarOutline,
onClick: ({ note }) => store.favorite(note.id)
},
{
@@ -338,7 +368,7 @@ const menuItems = [
!db.notes.note(note.id).synced() ? notFullySyncedText : false,
title: "Lock",
checked: ({ note }) => note.locked,
- icon: Icon.Lock,
+ icon: Lock,
onClick: async ({ note }) => {
const { unlock, lock } = store.get();
if (!note.locked) {
@@ -354,7 +384,7 @@ const menuItems = [
{
key: "remind-me",
title: "Remind me",
- icon: Icon.AddReminder,
+ icon: AddReminder,
onClick: async ({ note }) => {
await showAddReminderDialog(note.id);
}
@@ -363,20 +393,20 @@ const menuItems = [
{
key: "notebooks",
title: "Notebooks",
- icon: Icon.Notebook,
+ icon: Notebook,
items: notebooksMenuItems,
multiSelect: true
},
{
key: "colors",
title: "Assign color",
- icon: Icon.Colors,
+ icon: Colors,
items: colorsToMenuItems()
},
{
key: "add-tags",
title: "Tags",
- icon: Icon.Tag2,
+ icon: Tag2,
multiSelect: true,
items: tagsMenuItems
// onClick: async ({ items }) => {
@@ -391,7 +421,7 @@ const menuItems = [
if (!db.notes.note(note.id).synced()) return notFullySyncedText;
if (note.locked) return "Locked notes cannot be printed.";
},
- icon: Icon.Print,
+ icon: Print,
onClick: async ({ note }) => {
await exportNotes("pdf", [note.id]);
}
@@ -403,7 +433,7 @@ const menuItems = [
if (!db.monographs.isPublished(note.id) && note.locked)
return "You cannot publish a locked note.";
},
- icon: Icon.Publish,
+ icon: Publish,
title: "Publish",
checked: ({ note }) => db.monographs.isPublished(note.id),
onClick: async ({ note }) => {
@@ -415,7 +445,7 @@ const menuItems = [
{
key: "export",
title: "Export as",
- icon: Icon.Export,
+ icon: Export,
disabled: ({ note }) => {
if (!db.notes.note(note.id).synced()) return notFullySyncedText;
if (note.locked) return "Locked notes cannot be exported currently.";
@@ -447,7 +477,7 @@ const menuItems = [
if (!db.notes.note(note.id).synced()) return notFullySyncedText;
if (note.locked) return "Locked notes cannot be duplicated";
},
- icon: Icon.Duplicate,
+ icon: Duplicate,
onClick: async ({ note }) => {
const id = await store.get().duplicate(note);
if (
@@ -470,7 +500,7 @@ const menuItems = [
!db.notes.note(note.id).synced() ? notFullySyncedText : false,
title: "Local only",
checked: ({ note }) => note.localOnly,
- icon: ({ note }) => (note.localOnly ? Icon.Sync : Icon.SyncOff),
+ icon: ({ note }) => (note.localOnly ? Sync : SyncOff),
onClick: async ({ note }) => {
if (
note.localOnly ||
@@ -491,7 +521,7 @@ const menuItems = [
title: "Move to trash",
color: "error",
iconColor: "error",
- icon: Icon.Trash,
+ icon: Trash,
disabled: ({ items }) => {
const areAllSynced = items.reduce((prev, curr) => {
if (!prev || !db.notes.note(curr.id).synced()) return false;
@@ -520,7 +550,7 @@ function colorsToMenuItems() {
return {
key: lowercase,
title: () => db.colors.alias(lowercase) || label,
- icon: Icon.Circle,
+ icon: Circle,
iconColor: lowercase,
checked: ({ note }) => {
return note.color === lowercase;
@@ -540,7 +570,7 @@ function notebooksMenuItems({ items }) {
menuItems.push({
key: "link-notebooks",
title: "Link to...",
- icon: Icon.AddToNotebook,
+ icon: AddToNotebook,
onClick: async () => {
await showMoveNoteDialog(noteIds);
}
@@ -556,7 +586,7 @@ function notebooksMenuItems({ items }) {
{
key: "remove-from-all-notebooks",
title: "Unlink from all",
- icon: Icon.RemoveShortcutLink,
+ icon: RemoveShortcutLink,
onClick: async () => {
await db.notes.removeFromAllNotebooks(...noteIds);
store.refresh();
@@ -571,7 +601,7 @@ function notebooksMenuItems({ items }) {
menuItems.push({
key: notebook.id,
title: notebook.title,
- icon: Icon.Notebook,
+ icon: Notebook,
checked: true,
tooltip: "Click to remove from this notebook",
onClick: async () => {
@@ -592,7 +622,7 @@ function notebooksMenuItems({ items }) {
menuItems.push({
key: topicId,
title: topic.title,
- icon: Icon.Topic,
+ icon: Topic,
checked: true,
tooltip: "Click to remove from this topic",
onClick: async () => {
@@ -617,7 +647,7 @@ function tagsMenuItems({ items }) {
menuItems.push({
key: "assign-tags",
title: "Assign to...",
- icon: Icon.Plus,
+ icon: Plus,
onClick: async () => {
await showAddTagsDialog(noteIds);
}
@@ -630,7 +660,7 @@ function tagsMenuItems({ items }) {
{
key: "remove-from-all-tags",
title: "Remove from all",
- icon: Icon.RemoveShortcutLink,
+ icon: RemoveShortcutLink,
onClick: async () => {
for (const note of items) {
for (const tag of tags) {
@@ -650,7 +680,7 @@ function tagsMenuItems({ items }) {
menuItems.push({
key: tag,
title: db.tags.alias(tag),
- icon: Icon.Tag,
+ icon: Tag,
checked: true,
tooltip: "Click to remove from this tag",
onClick: async () => {
diff --git a/apps/web/src/components/notebook/index.jsx b/apps/web/src/components/notebook/index.jsx
index 15d6ab354..3a795480d 100644
--- a/apps/web/src/components/notebook/index.jsx
+++ b/apps/web/src/components/notebook/index.jsx
@@ -24,7 +24,16 @@ import { useStore, store } from "../../stores/notebook-store";
import { store as appStore } from "../../stores/app-store";
import { showUnpinnedToast } from "../../common/toasts";
import { db } from "../../common/db";
-import * as Icon from "../icons";
+import {
+ Topic,
+ PinFilled,
+ NotebookEdit,
+ Notebook as NotebookIcon,
+ Pin,
+ RemoveShortcutLink,
+ Shortcut,
+ Trash
+} from "../icons";
import { hashNavigate, navigate } from "../../navigation";
import IconTag from "../icon-tag";
import { showToast } from "../../utils/toast";
@@ -66,7 +75,7 @@ function Notebook(props) {
<IconTag
key={topic.id}
text={topic.title}
- icon={Icon.Topic}
+ icon={Topic}
onClick={() => {
navigate(`/notebooks/${notebook.id}/${topic.id}`);
}}
@@ -83,7 +92,7 @@ function Notebook(props) {
}}
>
{notebook.pinned && (
- <Icon.PinFilled color="primary" size={13} sx={{ mr: 1 }} />
+ <PinFilled color="primary" size={13} sx={{ mr: 1 }} />
)}
{getFormattedDate(date, "date")}
@@ -127,7 +136,7 @@ const menuItems = [
{
key: "edit",
title: "Edit",
- icon: Icon.NotebookEdit,
+ icon: NotebookEdit,
onClick: ({ notebook }) => hashNavigate(`/notebooks/${notebook.id}/edit`)
},
{
@@ -138,7 +147,7 @@ const menuItems = [
return defaultNotebook?.id === notebook.id && !defaultNotebook?.topic;
},
- icon: Icon.Notebook,
+ icon: NotebookIcon,
onClick: async ({ notebook }) => {
const defaultNotebook = db.settings.getDefaultNotebook();
const isDefault =
@@ -151,7 +160,7 @@ const menuItems = [
},
{
key: "pin",
- icon: Icon.Pin,
+ icon: Pin,
title: "Pin",
checked: ({ notebook }) => notebook.pinned,
onClick: ({ notebook }) => pin(notebook)
@@ -159,9 +168,7 @@ const menuItems = [
{
key: "shortcut",
icon: ({ notebook }) =>
- db.shortcuts.exists(notebook.id)
- ? Icon.RemoveShortcutLink
- : Icon.Shortcut,
+ db.shortcuts.exists(notebook.id) ? RemoveShortcutLink : Shortcut,
title: ({ notebook }) =>
db.shortcuts.exists(notebook.id) ? "Remove shortcut" : "Create shortcut",
onClick: ({ notebook }) => appStore.addToShortcuts(notebook)
@@ -172,7 +179,7 @@ const menuItems = [
title: "Move to trash",
color: "error",
iconColor: "error",
- icon: Icon.Trash,
+ icon: Trash,
onClick: async ({ items }) => {
const result = await confirm({
title: `Delete ${pluralize(items.length, "notebook")}?`,
diff --git a/apps/web/src/components/placeholders/index.tsx b/apps/web/src/components/placeholders/index.tsx
index 7f7d9a9de..4a997cd4f 100644
--- a/apps/web/src/components/placeholders/index.tsx
+++ b/apps/web/src/components/placeholders/index.tsx
@@ -20,7 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { Button, Flex, Text } from "@theme-ui/components";
import { Context, useTip } from "../../hooks/use-tip";
import { Info } from "../icons";
-import { AliasIcon } from "../icons/resolver";
type PlaceholderProps = { context: Context; text?: string };
function Placeholder(props: PlaceholderProps) {
@@ -71,7 +70,7 @@ function Placeholder(props: PlaceholderProps) {
<Text mr={1} color="primary">
{tip.button.title}
</Text>
- <AliasIcon alias={tip.button.icon} size={18} color="primary" />
+ {tip.button.icon && <tip.button.icon size={18} color="primary" />}
</Button>
)}
</Flex>
diff --git a/apps/web/src/components/properties/index.jsx b/apps/web/src/components/properties/index.jsx
index 17cc5b766..5852e714e 100644
--- a/apps/web/src/components/properties/index.jsx
+++ b/apps/web/src/components/properties/index.jsx
@@ -18,7 +18,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import React, { useCallback, useEffect, useMemo, useState } from "react";
-import * as Icon from "../icons";
+import {
+ Pin,
+ StarOutline,
+ Unlock,
+ Readonly,
+ SyncOff,
+ ArrowLeft,
+ Circle,
+ Checkmark,
+ Lock
+} from "../icons";
import { Flex, Text } from "@theme-ui/components";
import { useStore, store } from "../../stores/editor-store";
import { COLORS } from "../../common/constants";
@@ -40,23 +50,23 @@ import Reminder from "../reminder";
import { getFormattedDate } from "@notesnook/common";
const tools = [
- { key: "pin", property: "pinned", icon: Icon.Pin, label: "Pin" },
+ { key: "pin", property: "pinned", icon: Pin, label: "Pin" },
{
key: "favorite",
property: "favorite",
- icon: Icon.StarOutline,
+ icon: StarOutline,
label: "Favorite"
},
- { key: "lock", icon: Icon.Unlock, label: "Lock", property: "locked" },
+ { key: "lock", icon: Unlock, label: "Lock", property: "locked" },
{
key: "readonly",
- icon: Icon.Readonly,
+ icon: Readonly,
label: "Readonly",
property: "readonly"
},
{
key: "local-only",
- icon: Icon.SyncOff,
+ icon: SyncOff,
label: "Disable sync",
property: "localOnly"
}
@@ -171,7 +181,7 @@ function Properties(props) {
<Card
title="Properties"
button={
- <Icon.ArrowLeft
+ <ArrowLeft
data-test-id="properties-close"
onClick={() => toggleProperties(false)}
size={18}
@@ -237,7 +247,7 @@ function Properties(props) {
}}
data-test-id={`properties-${label}`}
>
- <Icon.Circle
+ <Circle
size={35}
color={label.toLowerCase()}
data-test-id={`toggle-state-${
@@ -247,7 +257,7 @@ function Properties(props) {
}`}
/>
{label.toLowerCase() === color?.toLowerCase() && (
- <Icon.Checkmark
+ <Checkmark
color="static"
size={18}
sx={{ position: "absolute", left: "8px" }}
@@ -365,9 +375,7 @@ function Properties(props) {
{label}
</Text>
<Flex sx={{ fontSize: "subBody", color: "fontTertiary" }}>
- {session.locked && (
- <Icon.Lock size={14} data-test-id="locked" />
- )}
+ {session.locked && <Lock size={14} data-test-id="locked" />}
<TimeAgo
live
datetime={session.dateModified}
diff --git a/apps/web/src/components/publish-view/index.jsx b/apps/web/src/components/publish-view/index.jsx
index 872c405ce..8afec4cf0 100644
--- a/apps/web/src/components/publish-view/index.jsx
+++ b/apps/web/src/components/publish-view/index.jsx
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { useCallback, useEffect, useMemo, useState } from "react";
import ReactDOM from "react-dom";
import { Flex, Text, Button } from "@theme-ui/components";
-import * as Icon from "../icons";
+import { Copy, Loading } from "../icons";
import Toggle from "../toggle";
import Field from "../field";
import { db } from "../../common/db";
@@ -170,7 +170,7 @@ function PublishView(props) {
);
}}
>
- <Icon.Copy size={20} color="primary" />
+ <Copy size={20} color="primary" />
</Button>
</Flex>
</Flex>
@@ -244,7 +244,7 @@ function PublishView(props) {
>
{isPublishing ? (
<>
- <Icon.Loading color="static" />
+ <Loading color="static" />
</>
) : publishId ? (
"Update"
diff --git a/apps/web/src/components/reminder-bar/index.jsx b/apps/web/src/components/reminder-bar/index.jsx
index 37ec1afdd..42dc5e8b4 100644
--- a/apps/web/src/components/reminder-bar/index.jsx
+++ b/apps/web/src/components/reminder-bar/index.jsx
@@ -21,7 +21,7 @@ import { useMemo } from "react";
import { Button, Flex, Text } from "@theme-ui/components";
import { useStore as useAppStore } from "../../stores/app-store";
import { Reminders } from "../../common/reminders";
-import * as Icon from "../icons";
+import { Dismiss } from "../icons";
import Config from "../../utils/config";
function ReminderBar() {
@@ -86,7 +86,7 @@ function ReminderBar() {
}}
variant="tool"
>
- <Icon.Dismiss size={20} color="primary" />
+ <Dismiss size={20} color="primary" />
</Button>
)}
</Flex>
diff --git a/apps/web/src/components/reminder/index.tsx b/apps/web/src/components/reminder/index.tsx
index 5abc23c6a..89bf37ad3 100644
--- a/apps/web/src/components/reminder/index.tsx
+++ b/apps/web/src/components/reminder/index.tsx
@@ -20,7 +20,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import React from "react";
import ListItem from "../list-item";
import { Flex } from "@theme-ui/components";
-import * as Icon from "../icons";
+import {
+ Silent,
+ Vibrate,
+ Loud,
+ ReminderOff,
+ Clock,
+ Refresh,
+ Icon,
+ Edit,
+ Reminders,
+ Trash
+} from "../icons";
import IconTag from "../icon-tag";
import {
Reminder as ReminderType,
@@ -44,9 +55,9 @@ const RECURRING_MODE_MAP = {
} as const;
const PRIORITY_ICON_MAP = {
- silent: Icon.Silent,
- vibrate: Icon.Vibrate,
- urgent: Icon.Loud
+ silent: Silent,
+ vibrate: Vibrate,
+ urgent: Loud
} as const;
function Reminder({
@@ -78,14 +89,14 @@ function Reminder({
>
{reminder.disabled ? (
<IconTag
- icon={Icon.ReminderOff}
+ icon={ReminderOff}
text={"Disabled"}
styles={{ icon: { color: "error" } }}
testId={"disabled"}
/>
) : (
<IconTag
- icon={Icon.Clock}
+ icon={Clock}
text={getFormattedReminderTime(reminder)}
highlight={isReminderToday(reminder)}
testId={"reminder-time"}
@@ -96,7 +107,7 @@ function Reminder({
)}
{reminder.mode === "repeat" && reminder.recurringMode && (
<IconTag
- icon={Icon.Refresh}
+ icon={Refresh}
text={RECURRING_MODE_MAP[reminder.recurringMode]}
testId={`recurring-mode`}
/>
@@ -126,7 +137,7 @@ type MenuItem = {
type?: "separator";
key: string;
title?: MenuItemValue<string>;
- icon?: MenuItemValue<Icon.Icon>;
+ icon?: MenuItemValue<Icon>;
onClick?: (options: MenuActionParams) => void;
color?: MenuItemValue<string>;
iconColor?: MenuItemValue<string>;
@@ -138,14 +149,14 @@ const menuItems: MenuItem[] = [
{
key: "edit",
title: "Edit",
- icon: Icon.Edit,
+ icon: Edit,
onClick: ({ reminder }) => hashNavigate(`/reminders/${reminder.id}/edit`)
},
{
key: "toggle",
title: ({ reminder }) => (reminder.disabled ? "Activate" : "Deactivate"),
icon: ({ reminder }: MenuActionParams) =>
- reminder.disabled ? Icon.Reminders : Icon.ReminderOff,
+ reminder.disabled ? Reminders : ReminderOff,
onClick: async ({ reminder }) => {
await db.reminders?.add({
id: reminder.id,
@@ -160,7 +171,7 @@ const menuItems: MenuItem[] = [
title: "Delete",
color: "error",
iconColor: "error",
- icon: Icon.Trash,
+ icon: Trash,
onClick: async ({ items }) => {
confirm({
title: `Delete ${pluralize(items.length, "reminder")}`,
diff --git a/apps/web/src/components/route-container/index.jsx b/apps/web/src/components/route-container/index.jsx
index fa920da95..5e1ef2a0d 100644
--- a/apps/web/src/components/route-container/index.jsx
+++ b/apps/web/src/components/route-container/index.jsx
@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { useEffect, useRef, useState } from "react";
import { Flex, Text } from "@theme-ui/components";
-import * as Icon from "../icons";
+import { ArrowLeft, Menu, Search, Plus } from "../icons";
import { useStore } from "../../stores/app-store";
import { CREATE_BUTTON_MAP } from "../../common";
import useMobile from "../../hooks/use-mobile";
@@ -66,7 +66,7 @@ function Header(props) {
<Flex sx={{ alignItems: "center", justifyContent: "space-between" }}>
<Flex py={1} sx={{ alignItems: "center", justifyContent: "center" }}>
{buttons?.back ? (
- <Icon.ArrowLeft
+ <ArrowLeft
size={24}
title={buttons.back.title}
onClick={buttons.back.action}
@@ -75,7 +75,7 @@ function Header(props) {
data-test-id="go-back"
/>
) : (
- <Icon.Menu
+ <Menu
onClick={() => toggleSideMenu(true)}
sx={{
flexShrink: 0,
@@ -98,7 +98,7 @@ function Header(props) {
</Flex>
<Flex sx={{ flexShrink: 0 }}>
{buttons?.search && (
- <Icon.Search
+ <Search
data-test-id={"open-search"}
size={24}
title={buttons.search.title}
@@ -107,7 +107,7 @@ function Header(props) {
)}
{!isMobile && createButtonData && (
- <Icon.Plus
+ <Plus
data-test-id={`${type}-action-button`}
color="static"
size={18}
diff --git a/apps/web/src/components/search/index.jsx b/apps/web/src/components/search/index.jsx
index 0d39ba56a..1dfae5116 100644
--- a/apps/web/src/components/search/index.jsx
+++ b/apps/web/src/components/search/index.jsx
@@ -17,10 +17,11 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import * as Icon from "../icons";
+import { Search } from "../icons";
import "./search.css";
import Field from "../field";
import { debounce } from "@notesnook/common";
+
function SearchBox({ onSearch }) {
return (
<Field
@@ -33,7 +34,7 @@ function SearchBox({ onSearch }) {
placeholder="Type your query here"
onChange={debounce((e) => onSearch(e.target.value), 250)}
action={{
- icon: Icon.Search,
+ icon: Search,
testId: "search-button",
onClick: () => {
const searchField = document.getElementById("search");
diff --git a/apps/web/src/components/status-bar/index.jsx b/apps/web/src/components/status-bar/index.jsx
index 3bd66bea2..5f8882224 100644
--- a/apps/web/src/components/status-bar/index.jsx
+++ b/apps/web/src/components/status-bar/index.jsx
@@ -40,7 +40,6 @@ import {
showUpdateAvailableNotice
} from "../../common/dialog-controller";
import useStatus from "../../hooks/use-status";
-import { getIconFromAlias } from "../icons/resolver";
import { checkForUpdate, installUpdate } from "../../utils/updater";
function StatusBar() {
@@ -125,8 +124,7 @@ function StatusBar() {
Report an issue
</Text>
</Button>
- {statuses?.map(({ key, status, progress, icon }) => {
- const Icon = getIconFromAlias(icon);
+ {statuses?.map(({ key, status, progress, icon: Icon }) => {
return (
<Flex
key={key}
diff --git a/apps/web/src/components/tag/index.jsx b/apps/web/src/components/tag/index.jsx
index 43ceefca5..64c903c13 100644
--- a/apps/web/src/components/tag/index.jsx
+++ b/apps/web/src/components/tag/index.jsx
@@ -25,7 +25,7 @@ import { store as tagStore } from "../../stores/tag-store";
import { store as noteStore } from "../../stores/note-store";
import { store as editorStore } from "../../stores/editor-store";
import { db } from "../../common/db";
-import * as Icon from "../icons";
+import { Edit, Shortcut, DeleteForver } from "../icons";
import { showToast } from "../../utils/toast";
import { pluralize } from "@notesnook/common";
@@ -33,7 +33,7 @@ const menuItems = [
{
key: "edit",
title: "Rename tag",
- icon: Icon.Edit,
+ icon: Edit,
onClick: ({ tag }) => {
hashNavigate(`/tags/${tag.id}/edit`);
}
@@ -42,7 +42,7 @@ const menuItems = [
key: "shortcut",
title: ({ tag }) =>
db.shortcuts.exists(tag.id) ? "Remove shortcut" : "Create shortcut",
- icon: Icon.Shortcut,
+ icon: Shortcut,
onClick: ({ tag }) => appStore.addToShortcuts(tag)
},
{ key: "sep", type: "separator" },
@@ -51,7 +51,7 @@ const menuItems = [
color: "error",
iconColor: "error",
title: "Delete",
- icon: Icon.DeleteForver,
+ icon: DeleteForver,
onClick: async ({ items }) => {
for (let tag of items) {
if (tag.noteIds.includes(editorStore.get().session.id))
diff --git a/apps/web/src/components/topic/index.jsx b/apps/web/src/components/topic/index.jsx
index b4449c92a..6ff0e4b94 100644
--- a/apps/web/src/components/topic/index.jsx
+++ b/apps/web/src/components/topic/index.jsx
@@ -23,7 +23,7 @@ import { db } from "../../common/db";
import { store as appStore } from "../../stores/app-store";
import { hashNavigate } from "../../navigation";
import { Flex, Text } from "@theme-ui/components";
-import * as Icon from "../icons";
+import { Edit, Topic, Shortcut, Trash } from "../icons";
import { Multiselect } from "../../common/multi-select";
import { confirm } from "../../common/dialog-controller";
import { useStore as useNotesStore } from "../../stores/note-store";
@@ -72,7 +72,7 @@ const menuItems = [
{
key: "edit",
title: "Edit",
- icon: Icon.Edit,
+ icon: Edit,
onClick: ({ topic }) =>
hashNavigate(`/notebooks/${topic.notebookId}/topics/${topic.id}/edit`)
},
@@ -86,7 +86,7 @@ const menuItems = [
defaultNotebook?.topic === topic.id
);
},
- icon: Icon.Topic,
+ icon: Topic,
onClick: async ({ topic }) => {
const defaultNotebook = db.settings.getDefaultNotebook();
const isDefault =
@@ -102,14 +102,14 @@ const menuItems = [
key: "shortcut",
title: ({ topic }) =>
db.shortcuts.exists(topic.id) ? "Remove shortcut" : "Create shortcut",
- icon: Icon.Shortcut,
+ icon: Shortcut,
onClick: ({ topic }) => appStore.addToShortcuts(topic)
},
{ key: "sep", type: "separator" },
{
key: "delete",
title: "Delete",
- icon: Icon.Trash,
+ icon: Trash,
color: "error",
iconColor: "error",
onClick: async ({ items, notebookId }) => {
diff --git a/apps/web/src/components/trash-item/index.jsx b/apps/web/src/components/trash-item/index.jsx
index d37bdb9b3..3c3cdcb2d 100644
--- a/apps/web/src/components/trash-item/index.jsx
+++ b/apps/web/src/components/trash-item/index.jsx
@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import ListItem from "../list-item";
import { showMultiPermanentDeleteConfirmation } from "../../common/dialog-controller";
-import * as Icon from "../icons";
+import { Restore, DeleteForver } from "../icons";
import { store } from "../../stores/trash-store";
import { Flex, Text } from "@theme-ui/components";
import TimeAgo from "../time-ago";
@@ -63,7 +63,7 @@ const menuItems = [
{
key: "restore",
title: "Restore",
- icon: Icon.Restore,
+ icon: Restore,
onClick: ({ items }) => {
store.restore(items.map((i) => i.id));
showToast("success", `${pluralize(items.length, "item")} restored`);
@@ -73,7 +73,7 @@ const menuItems = [
{
key: "delete",
title: "Delete",
- icon: Icon.DeleteForver,
+ icon: DeleteForver,
color: "error",
iconColor: "error",
onClick: async ({ items }) => {
diff --git a/apps/web/src/components/unlock/index.jsx b/apps/web/src/components/unlock/index.jsx
index 392fc948a..5d6c13b80 100644
--- a/apps/web/src/components/unlock/index.jsx
+++ b/apps/web/src/components/unlock/index.jsx
@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { useRef, useState, useCallback, useEffect, useMemo } from "react";
import { Flex, Text, Button } from "@theme-ui/components";
-import * as Icon from "../icons";
+import { Lock, Alert } from "../icons";
import { db } from "../../common/db";
import { useStore as useEditorStore } from "../../stores/editor-store";
import { useStore as useAppStore } from "../../stores/app-store";
@@ -90,7 +90,7 @@ function Unlock(props) {
justifyContent: "center"
}}
>
- <Icon.Lock size={100} sx={{ opacity: 0.2 }} />
+ <Lock size={100} sx={{ opacity: 0.2 }} />
<Text
data-test-id="unlock-note-title"
variant="heading"
@@ -139,7 +139,7 @@ function Unlock(props) {
alignSelf: "flex-center"
}}
>
- <Icon.Alert color="error" size={12} />
+ <Alert color="error" size={12} />
<Text ml={1} sx={{ fontSize: "body" }}>
Wrong password
</Text>
diff --git a/apps/web/src/dialogs/add-notebook-dialog.jsx b/apps/web/src/dialogs/add-notebook-dialog.jsx
index 88c245827..e42211ae4 100644
--- a/apps/web/src/dialogs/add-notebook-dialog.jsx
+++ b/apps/web/src/dialogs/add-notebook-dialog.jsx
@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import React from "react";
import { Flex, Text } from "@theme-ui/components";
-import * as Icon from "../components/icons";
+import { Notebook, Checkmark, Plus, Topic } from "../components/icons";
import Dialog from "../components/dialog";
import qclone from "qclone";
import Field from "../components/field";
@@ -130,7 +130,7 @@ class AddNotebookDialog extends React.Component {
? `You are editing "${this.notebookTitle}".`
: "Notebooks are the best way to organize your notes."
}
- icon={Icon.Notebook}
+ icon={Notebook}
positiveButton={{
text: props.edit ? "Save" : "Create",
onClick: () => {
@@ -181,7 +181,7 @@ class AddNotebookDialog extends React.Component {
this.addTopic(this._topicInputRef.value);
}
},
- icon: this.state.isEditting ? Icon.Checkmark : Icon.Plus
+ icon: this.state.isEditting ? Checkmark : Plus
}}
onChange={(e) => {
if (!this.state.isEditting) return;
@@ -241,7 +241,7 @@ function TopicItem(props) {
data-test-id="topic-item"
>
<Flex sx={{ alignItems: "center", justifyContent: "center" }}>
- <Icon.Topic />
+ <Topic />
<Text as="span" ml={1} sx={{ fontSize: "body", color: "text" }}>
{title}
</Text>
diff --git a/apps/web/src/dialogs/buy-dialog/buy-dialog.tsx b/apps/web/src/dialogs/buy-dialog/buy-dialog.tsx
index f0a4bab60..40d090431 100644
--- a/apps/web/src/dialogs/buy-dialog/buy-dialog.tsx
+++ b/apps/web/src/dialogs/buy-dialog/buy-dialog.tsx
@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { useCallback, useEffect, useRef, useState } from "react";
import { Text, Flex, Button } from "@theme-ui/components";
-import * as Icon from "../../components/icons";
+import { Cross, Check, Loading } from "../../components/icons";
import { useStore as useUserStore } from "../../stores/user-store";
import { useStore as useThemeStore } from "../../stores/theme-store";
import Modal from "react-modal";
@@ -294,7 +294,7 @@ function TrialOrUpgrade(props: TrialOrUpgradeProps) {
Ready to take the next step in your private note taking journey?
</Text>
{isLoading || !plan ? (
- <Icon.Loading sx={{ mt: 4 }} />
+ <Loading sx={{ mt: 4 }} />
) : (
<Text variant={"body"} mt={4} sx={{ fontSize: "title" }}>
Starting from {getCurrencySymbol(plan.currency)}
@@ -519,10 +519,10 @@ function SelectedPlan(props: SelectedPlanProps) {
}}
action={{
icon: isApplyingCoupon
- ? Icon.Loading
+ ? Loading
: pricingInfo?.coupon
- ? Icon.Cross
- : Icon.Check,
+ ? Cross
+ : Check,
onClick: () =>
pricingInfo?.coupon ? removeCoupon() : applyCoupon()
}}
@@ -541,7 +541,7 @@ function SelectedPlan(props: SelectedPlanProps) {
)}
</>
) : (
- <Icon.Loading sx={{ mt: 4 }} />
+ <Loading sx={{ mt: 4 }} />
)}
</>
);
diff --git a/apps/web/src/dialogs/buy-dialog/plan-list.tsx b/apps/web/src/dialogs/buy-dialog/plan-list.tsx
index b82766a7c..3f889a1b3 100644
--- a/apps/web/src/dialogs/buy-dialog/plan-list.tsx
+++ b/apps/web/src/dialogs/buy-dialog/plan-list.tsx
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { Text, Flex, Button } from "@theme-ui/components";
-import * as Icon from "../../components/icons";
+import { Loading } from "../../components/icons";
import { ReactComponent as Nomad } from "../../assets/nomad.svg";
import { Period, Plan } from "./types";
import { PLAN_METADATA, usePlans } from "./plans";
@@ -95,7 +95,7 @@ export function PlansList(props: PlansListProps) {
{metadata.subtitle}
</Text>
</Text>
- {isLoading ? <Icon.Loading /> : <RecurringPricing plan={plan} />}
+ {isLoading ? <Loading /> : <RecurringPricing plan={plan} />}
</Button>
);
})}
diff --git a/apps/web/src/dialogs/loading-dialog.tsx b/apps/web/src/dialogs/loading-dialog.tsx
index 2ddb0a7a5..211cb86d5 100644
--- a/apps/web/src/dialogs/loading-dialog.tsx
+++ b/apps/web/src/dialogs/loading-dialog.tsx
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { useEffect } from "react";
import { Box, Text } from "@theme-ui/components";
import Dialog from "../components/dialog";
-import * as Icon from "../components/icons";
+import { Loading } from "../components/icons";
type LoadingDialogProps<T> = {
onClose: (result: T | boolean) => void;
@@ -49,7 +49,7 @@ function LoadingDialog<T>(props: LoadingDialogProps<T>) {
<Text as="span" variant="body">
{message}
</Text>
- <Icon.Loading rotate sx={{ my: 2 }} color="primary" />
+ <Loading rotate sx={{ my: 2 }} color="primary" />
</Box>
</Dialog>
);
diff --git a/apps/web/src/dialogs/move-note-dialog.tsx b/apps/web/src/dialogs/move-note-dialog.tsx
index 5e631c42d..b16ed05ed 100644
--- a/apps/web/src/dialogs/move-note-dialog.tsx
+++ b/apps/web/src/dialogs/move-note-dialog.tsx
@@ -19,7 +19,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { useCallback, useEffect, useState } from "react";
import { Box, Button, Flex, Input, Text } from "@theme-ui/components";
-import * as Icon from "../components/icons";
+import {
+ Plus,
+ ChevronDown,
+ ChevronUp,
+ Circle,
+ CheckCircleOutline,
+ CheckIntermediate,
+ CheckRemove,
+ CircleEmpty
+} from "../components/icons";
import { db } from "../common/db";
import Dialog from "../components/dialog";
import { useStore, store } from "../stores/notebook-store";
@@ -302,18 +311,18 @@ function NotebookItem(props: {
data-test-id="create-topic"
sx={{ display: "none", p: 1 }}
>
- <Icon.Plus
+ <Plus
size={18}
title="Add a new topic"
onClick={() => setIsCreatingNew(true)}
/>
</Button>
- <Icon.ChevronDown
+ <ChevronDown
className="arrow-down"
size={20}
sx={{ height: "20px" }}
/>
- <Icon.ChevronUp
+ <ChevronUp
className="arrow-up"
size={20}
sx={{ display: "none", height: "20px" }}
@@ -378,7 +387,7 @@ function TopicSelectionIndicator({ notebook }: { notebook: Notebook }) {
);
if (!hasSelectedTopics) return null;
- return <Icon.Circle size={8} color="primary" sx={{ mr: 1 }} />;
+ return <Circle size={8} color="primary" sx={{ mr: 1 }} />;
}
function TopicItem(props: { topic: Topic }) {
@@ -438,13 +447,13 @@ function SelectedCheck({
selectedItem?.op === "remove" ? "remove" : selectedItem?.op === "add";
return selected === true ? (
- <Icon.CheckCircleOutline size={size} sx={{ mr: 1 }} color="primary" />
+ <CheckCircleOutline size={size} sx={{ mr: 1 }} color="primary" />
) : selected === null ? (
- <Icon.CheckIntermediate size={size} sx={{ mr: 1 }} color="dimPrimary" />
+ <CheckIntermediate size={size} sx={{ mr: 1 }} color="dimPrimary" />
) : selected === "remove" ? (
- <Icon.CheckRemove size={size} sx={{ mr: 1 }} color="error" />
+ <CheckRemove size={size} sx={{ mr: 1 }} color="error" />
) : (
- <Icon.CircleEmpty size={size} sx={{ mr: 1, opacity: 0.4 }} />
+ <CircleEmpty size={size} sx={{ mr: 1, opacity: 0.4 }} />
);
}
diff --git a/apps/web/src/dialogs/onboarding-dialog.jsx b/apps/web/src/dialogs/onboarding-dialog.jsx
index 30b8e011d..fa5065125 100644
--- a/apps/web/src/dialogs/onboarding-dialog.jsx
+++ b/apps/web/src/dialogs/onboarding-dialog.jsx
@@ -19,7 +19,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { Text, Flex, Button, Image, Box } from "@theme-ui/components";
import Dialog from "../components/dialog";
-import * as Icon from "../components/icons";
+import {
+ Pro,
+ Email,
+ Discord,
+ Twitter,
+ Github,
+ Loading
+} from "../components/icons";
import { ReactComponent as E2E } from "../assets/e2e.svg";
import { ReactComponent as Note } from "../assets/note2.svg";
import { ReactComponent as Nomad } from "../assets/nomad.svg";
@@ -73,7 +80,7 @@ const newUserSteps = [
image: <Friends width={140} />
},
{
- image: <Icon.Pro size={60} color="primary" />,
+ image: <Pro size={60} color="primary" />,
title: "Notesnook Pro",
subtitle: "Experience the next level of private note taking",
component: TrialOffer
@@ -292,25 +299,25 @@ const supportChannels = [
key: "email",
url: "mailto:[email protected]",
title: "Email us",
- icon: Icon.Email
+ icon: Email
},
{
key: "discord",
url: "https://discord.com/invite/zQBK97EE22",
title: "Join the community",
- icon: Icon.Discord
+ icon: Discord
},
{
key: "twitter",
url: "https://twitter.com/notesnook",
title: "Follow us @notesnook",
- icon: Icon.Twitter
+ icon: Twitter
},
{
key: "github",
url: "https://github.com/streetwriters/notesnook",
title: "Create an issue",
- icon: Icon.Github
+ icon: Github
}
];
@@ -500,7 +507,7 @@ function TrialOffer({ onClose }) {
}
}}
>
- {loading ? <Icon.Loading size={16} /> : "Try free for 14 days"}
+ {loading ? <Loading size={16} /> : "Try free for 14 days"}
</Button>
</Flex>
<Button
diff --git a/apps/web/src/dialogs/reminder-dialog.jsx b/apps/web/src/dialogs/reminder-dialog.jsx
index 9ef95b5ed..3c633c2f6 100644
--- a/apps/web/src/dialogs/reminder-dialog.jsx
+++ b/apps/web/src/dialogs/reminder-dialog.jsx
@@ -19,18 +19,27 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { Text, Flex, Box } from "@theme-ui/components";
import Dialog from "../components/dialog";
-import * as Icon from "../components/icons";
+import {
+ Sync,
+ Notebook,
+ Tag2,
+ Attachment,
+ Backup,
+ Vault,
+ PDF,
+ Edit
+} from "../components/icons";
import { showBuyDialog } from "../common/dialog-controller";
const features = [
- { icon: Icon.Sync, title: "Instant private sync" },
- { icon: Icon.Notebook, title: "Unlimited notebooks" },
- { icon: Icon.Tag2, title: "Unlimited tags" },
- { icon: Icon.Attachment, title: "Encrypted attachments" },
- { icon: Icon.Backup, title: "Encrypted backups" },
- { icon: Icon.Vault, title: "Secure private vault" },
- { icon: Icon.PDF, title: "Export to PDF" },
- { icon: Icon.Edit, title: "Rich text editor" }
+ { icon: Sync, title: "Instant private sync" },
+ { icon: Notebook, title: "Unlimited notebooks" },
+ { icon: Tag2, title: "Unlimited tags" },
+ { icon: Attachment, title: "Encrypted attachments" },
+ { icon: Backup, title: "Encrypted backups" },
+ { icon: Vault, title: "Secure private vault" },
+ { icon: PDF, title: "Export to PDF" },
+ { icon: Edit, title: "Rich text editor" }
];
// TODO create trial expiry coupon codes
const reminders = {
diff --git a/apps/web/src/hooks/use-status.ts b/apps/web/src/hooks/use-status.ts
index 0fbcb7407..4aa550601 100644
--- a/apps/web/src/hooks/use-status.ts
+++ b/apps/web/src/hooks/use-status.ts
@@ -19,12 +19,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { create } from "zustand";
import produce from "immer";
+import { Icon } from "../components/icons";
type Status = {
key: string;
status: string;
progress?: number;
- icon?: string | null;
+ icon?: Icon | null;
};
interface IStatusStore {
statuses: Record<string, Status>;
diff --git a/apps/web/src/hooks/use-tip.ts b/apps/web/src/hooks/use-tip.ts
index 347523cfc..695803316 100644
--- a/apps/web/src/hooks/use-tip.ts
+++ b/apps/web/src/hooks/use-tip.ts
@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { useEffect, useRef, useState } from "react";
import { CREATE_BUTTON_MAP } from "../common";
-import { IconAlias } from "../components/icons/resolver";
+import { ArrowTopRight, Icon, Plus } from "../components/icons";
import Config from "../utils/config";
declare global {
@@ -36,7 +36,7 @@ export type TipButton = {
title: string;
type?: string;
onClick: () => void;
- icon?: IconAlias;
+ icon?: Icon;
};
export type Context =
| "notes"
@@ -153,7 +153,7 @@ const tips: Tip[] = [
contexts: ["notes", "notebooks", "tags", "topics"],
button: {
title: "Join the Notesnook community",
- icon: "arrow-top-right",
+ icon: ArrowTopRight,
onClick: () =>
window.open("https://discord.gg/notesnook-796015620436787241", "_blank")
}
@@ -173,7 +173,7 @@ const DEFAULT_TIPS: Record<Context, Omit<Tip, "contexts">> = {
text: "You haven't published any notes yet.",
button: {
title: "What are monographs?",
- icon: "arrow-top-right",
+ icon: ArrowTopRight,
onClick() {
window.open(
"https://help.notesnook.com/publish-notes-with-monographs",
@@ -184,31 +184,31 @@ const DEFAULT_TIPS: Record<Context, Omit<Tip, "contexts">> = {
},
notebooks: {
text: "You haven't created any notebooks.",
- button: { ...CREATE_BUTTON_MAP.notebooks, icon: "plus" }
+ button: { ...CREATE_BUTTON_MAP.notebooks, icon: Plus }
},
notes: {
text: "You have not created any notes yet.",
button: {
...CREATE_BUTTON_MAP.notes,
- icon: "plus"
+ icon: Plus
}
},
topics: {
text: "You can add topics in notebooks to further organize your notes.",
button: {
...CREATE_BUTTON_MAP.topics,
- icon: "plus"
+ icon: Plus
}
},
reminders: {
text: "You can set daily, weekly or monthly reminders & stay ahead of your tasks.",
- button: { ...CREATE_BUTTON_MAP.reminders, icon: "plus" }
+ button: { ...CREATE_BUTTON_MAP.reminders, icon: Plus }
},
tags: {
text: "You can use #tags to organize your notes.",
button: {
...CREATE_BUTTON_MAP.tags,
- icon: "plus"
+ icon: Plus
}
},
trash: {
diff --git a/apps/web/src/utils/web-extension-relay.ts b/apps/web/src/utils/web-extension-relay.ts
index ed8e808a0..f36df78af 100644
--- a/apps/web/src/utils/web-extension-relay.ts
+++ b/apps/web/src/utils/web-extension-relay.ts
@@ -23,6 +23,7 @@ import {
Gateway,
WEB_EXTENSION_CHANNEL_EVENTS
} from "@notesnook/web-clipper/dist/common/bridge";
+import { Extension } from "../components/icons";
export class WebExtensionRelay {
private gateway?: Remote<Gateway>;
@@ -60,7 +61,7 @@ export class WebExtensionRelay {
updateStatus({
key: metadata.id,
status: `${metadata.name} connected`,
- icon: "extension"
+ icon: Extension
});
return true;
diff --git a/apps/web/src/views/email-confirmed.jsx b/apps/web/src/views/email-confirmed.jsx
index d5880c9a9..8f3876ca0 100644
--- a/apps/web/src/views/email-confirmed.jsx
+++ b/apps/web/src/views/email-confirmed.jsx
@@ -23,7 +23,7 @@ import { Flex, Text } from "@theme-ui/components";
import ThemeProvider from "../components/theme-provider";
import { ANALYTICS_EVENTS, trackEvent } from "../utils/analytics";
import { useQueryParams } from "../navigation";
-import * as Icon from "../components/icons";
+import { MailCheck, Discord, Twitter, Reddit } from "../components/icons";
function EmailConfirmed() {
const [{ userId }] = useQueryParams();
@@ -50,7 +50,7 @@ function EmailConfirmed() {
justifyContent: "center"
}}
>
- <Icon.MailCheck
+ <MailCheck
sx={{ bg: "shade", borderRadius: 100, p: 5 }}
size={72}
color="primary"
@@ -108,19 +108,19 @@ const social = [
{
title: "Discord",
hoverColor: "#7289da",
- icon: Icon.Discord,
+ icon: Discord,
link: "https://discord.com/invite/zQBK97EE22"
},
{
title: "Twitter",
hoverColor: "#1da1f2",
- icon: Icon.Twitter,
+ icon: Twitter,
link: "https://twitter.com/notesnook"
},
{
title: "Reddit",
hoverColor: "#ff4500",
- icon: Icon.Reddit,
+ icon: Reddit,
link: "https://reddit.com/r/Notesnook"
}
];
diff --git a/apps/web/src/views/trash.jsx b/apps/web/src/views/trash.jsx
index 6981fa41e..ffd40243d 100644
--- a/apps/web/src/views/trash.jsx
+++ b/apps/web/src/views/trash.jsx
@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import * as Icon from "../components/icons";
+import { Trash as TrashIcon } from "../components/icons";
import ListContainer from "../components/list-container";
import { confirm } from "../common/dialog-controller";
import { useStore, store } from "../stores/trash-store";
@@ -45,7 +45,7 @@ function Trash() {
button={{
show: !!items.length,
content: "Clear Trash",
- icon: Icon.Trash,
+ icon: TrashIcon,
onClick: function () {
confirm({
title: "Clear Trash",