From 021dfab5eeb888f155982cc1cd3636b2b4ca52a3 Mon Sep 17 00:00:00 2001 From: Innei Date: Wed, 31 Jul 2024 22:04:38 +0800 Subject: [PATCH] fix: eagle icon Signed-off-by: Innei --- src/renderer/public/eagle.svg | 48 ------------------- .../ui/platform-icon/collections/eagle.tsx | 18 +++++++ .../src/components/ui/platform-icon/icons.ts | 1 + .../src/hooks/biz/useEntryActions.tsx | 11 +++-- src/renderer/src/modules/discover/form.tsx | 2 +- .../src/modules/entry-content/header.tsx | 5 +- .../modules/entry-content/read-history.tsx | 2 +- .../src/modules/settings/modal/layout.tsx | 2 +- src/renderer/src/styles/colors.css | 9 ++-- 9 files changed, 39 insertions(+), 59 deletions(-) delete mode 100644 src/renderer/public/eagle.svg create mode 100644 src/renderer/src/components/ui/platform-icon/collections/eagle.tsx create mode 100644 src/renderer/src/components/ui/platform-icon/icons.ts diff --git a/src/renderer/public/eagle.svg b/src/renderer/public/eagle.svg deleted file mode 100644 index 0c7f08db8..000000000 --- a/src/renderer/public/eagle.svg +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/renderer/src/components/ui/platform-icon/collections/eagle.tsx b/src/renderer/src/components/ui/platform-icon/collections/eagle.tsx new file mode 100644 index 000000000..34cf6ba4c --- /dev/null +++ b/src/renderer/src/components/ui/platform-icon/collections/eagle.tsx @@ -0,0 +1,18 @@ +import type { SVGProps } from "react" + +export function SimpleIconsEagle(props: SVGProps) { + return ( + + + + ) +} diff --git a/src/renderer/src/components/ui/platform-icon/icons.ts b/src/renderer/src/components/ui/platform-icon/icons.ts new file mode 100644 index 000000000..55d2fe34f --- /dev/null +++ b/src/renderer/src/components/ui/platform-icon/icons.ts @@ -0,0 +1 @@ +export * from "./collections/eagle" diff --git a/src/renderer/src/hooks/biz/useEntryActions.tsx b/src/renderer/src/hooks/biz/useEntryActions.tsx index 57efa5ede..33b89e827 100644 --- a/src/renderer/src/hooks/biz/useEntryActions.tsx +++ b/src/renderer/src/hooks/biz/useEntryActions.tsx @@ -1,3 +1,4 @@ +import { SimpleIconsEagle } from "@renderer/components/ui/platform-icon/icons" import { COPY_MAP } from "@renderer/constants" import { shortcuts } from "@renderer/constants/shortcuts" import { tipcClient } from "@renderer/lib/client" @@ -11,6 +12,7 @@ import { useFeedById } from "@renderer/store/feed" import { useMutation, useQuery } from "@tanstack/react-query" import type { FetchError } from "ofetch" import { ofetch } from "ofetch" +import type { ReactNode } from "react" import { useMemo } from "react" import { toast } from "sonner" @@ -99,7 +101,7 @@ export const useEntryActions = ({ className?: string shortcut?: string name: string - icon?: string + icon?: ReactNode disabled?: boolean onClick: () => void }[] = [ @@ -159,7 +161,7 @@ export const useEntryActions = ({ }, { name: "Save Media to Eagle", - icon: "/eagle.svg", + icon: , key: "saveToEagle", disabled: (checkEagle.isLoading ? true : !checkEagle.data) || @@ -189,7 +191,10 @@ export const useEntryActions = ({ { name: "Share", key: "share", - className: getOS() === "macOS" ? `i-mgc-share-3-cute-re` : "i-mgc-share-forward-cute-re", + className: + getOS() === "macOS" ? + `i-mgc-share-3-cute-re` : + "i-mgc-share-forward-cute-re", shortcut: shortcuts.entry.share.key, disabled: !window.electron && !navigator.share, diff --git a/src/renderer/src/modules/discover/form.tsx b/src/renderer/src/modules/discover/form.tsx index 3a8f30989..d2d650545 100644 --- a/src/renderer/src/modules/discover/form.tsx +++ b/src/renderer/src/modules/discover/form.tsx @@ -228,7 +228,7 @@ export function DiscoverForm({ type }: { type: string }) { )}
- + {item.subscriptionCount} {" "} diff --git a/src/renderer/src/modules/entry-content/header.tsx b/src/renderer/src/modules/entry-content/header.tsx index f9e6d44f3..63d7403c6 100644 --- a/src/renderer/src/modules/entry-content/header.tsx +++ b/src/renderer/src/modules/entry-content/header.tsx @@ -1,3 +1,4 @@ +import { Slot } from "@radix-ui/react-slot" import { ActionButton } from "@renderer/components/ui/button" import { useEntryActions } from "@renderer/hooks/biz/useEntryActions" import { cn } from "@renderer/lib/utils" @@ -73,7 +74,9 @@ export function EntryHeader({ + + {item.icon} + ) : ( ) diff --git a/src/renderer/src/modules/entry-content/read-history.tsx b/src/renderer/src/modules/entry-content/read-history.tsx index 0dcb79ea3..48188a06b 100644 --- a/src/renderer/src/modules/entry-content/read-history.tsx +++ b/src/renderer/src/modules/entry-content/read-history.tsx @@ -54,7 +54,7 @@ export const EntryReadHistory: Component<{ entryId: string }> = ({ right: "80px", zIndex: 11, }} - className="relative z-[11] flex size-8 items-center justify-center rounded-full border border-border bg-muted ring ring-background" + className="relative z-[11] flex size-7 items-center justify-center rounded-full border border-border bg-muted ring ring-background" > + diff --git a/src/renderer/src/modules/settings/modal/layout.tsx b/src/renderer/src/modules/settings/modal/layout.tsx index c54d8d2e2..c0c0f00e6 100644 --- a/src/renderer/src/modules/settings/modal/layout.tsx +++ b/src/renderer/src/modules/settings/modal/layout.tsx @@ -70,7 +70,7 @@ export function SettingModalLayout( onPointerDown={handleDrag} /> )} -
+
diff --git a/src/renderer/src/styles/colors.css b/src/renderer/src/styles/colors.css index 0d448a1f1..5ab50d0c2 100644 --- a/src/renderer/src/styles/colors.css +++ b/src/renderer/src/styles/colors.css @@ -12,8 +12,8 @@ --fo-inactive: 0, 0%, 80%; --fo-disabled: 0, 0%, 70%; - --fo-item-active: theme(colors.native.active/0.4); - --fo-item-hover: theme(colors.native.active/0.2); + --fo-item-active: theme(colors.zinc.400/0.3); + --fo-item-hover: theme(colors.zinc.400/0.2); --fo-modal-background: theme(colors.zinc.50/0.8); --fo-modal-background-opaque: theme(colors.zinc.50); @@ -28,8 +28,9 @@ --fo-vibrancy-background: theme(colors.native.active); - --fo-item-active: theme(colors.neutral.700/0.4); - --fo-item-hover: theme(colors.native.active/0.2); + --fo-item-active: theme(colors.neutral.600/0.4); + --fo-item-hover: theme(colors.neutral.700/0.3); + --fo-tooltip-background: 0, 0%, 15%; --fo-tooltip-foreground: 0, 0%, 96%;