A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
web: add cross icon for removing tags
Abdullah Atta289acd8ab632
diff --git a/apps/web/src/components/editor/header.tsx b/apps/web/src/components/editor/header.tsxindex 71cb4bc04..7385f3383 100644--- a/apps/web/src/components/editor/header.tsx+++ b/apps/web/src/components/editor/header.tsx@@ -26,6 +26,7 @@ import IconTag from "../icon-tag";import { db } from "../../common/db";import { useMenuTrigger } from "../../hooks/use-menu";import { MenuItem } from "@notesnook/ui";+import { navigate } from "../../navigation";type HeaderProps = { readonly: boolean };function Header(props: HeaderProps) {@@ -50,8 +51,16 @@ function Header(props: HeaderProps) {key={tag}text={db.tags?.alias(tag)}icon={Tag}- title={`Click to remove`}- onClick={() => setTag(tag)}+ title={tag}+ onClick={() => {+ const tagItem = db.tags?.tag(tag);+ if (!tagItem) {+ setTag(tag);+ return;+ }+ navigate(`/tags/${tagItem.id}`);+ }}+ onDismiss={readonly ? undefined : () => setTag(tag)}styles={{ container: { mr: 1 }, text: { fontSize: "body" } }}/>))}diff --git a/apps/web/src/components/icon-tag/index.tsx b/apps/web/src/components/icon-tag/index.tsxindex 6aa26a989..458faed2a 100644--- a/apps/web/src/components/icon-tag/index.tsx+++ b/apps/web/src/components/icon-tag/index.tsx@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.import { Flex, Text } from "@theme-ui/components";import { ThemeUICSSObject } from "@theme-ui/core";-import { Icon } from "../icons";+import { Close, Icon } from "../icons";type IconTagProps = {text: string;@@ -33,10 +33,20 @@ type IconTagProps = {};testId?: string;highlight?: boolean;+ onDismiss?: () => void;};function IconTag(props: IconTagProps) {- const { icon: Icon, text, title, onClick, styles, testId, highlight } = props;+ const {+ icon: Icon,+ text,+ title,+ onClick,+ onDismiss,+ styles,+ testId,+ highlight+ } = props;return (<Flex@@ -92,6 +102,22 @@ function IconTag(props: IconTagProps) {>{text}</Text>+ {onDismiss && (+ <Close+ size={12}+ title="Remove"+ onClick={(e) => {+ e.preventDefault();+ e.stopPropagation();+ onDismiss();+ }}+ sx={{+ ml: 1,+ ":hover": { bg: "background-error" },+ ":hover path": { fill: "var(--icon-error) !important" }+ }}+ />+ )}</Flex>);}