From ce7b4ab0abfc2d65b9e2d9305dafa508c33dda76 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Tue, 4 Jun 2024 18:36:49 +0800 Subject: [PATCH] feat: window traffic light and headers position --- src/main/window.ts | 4 + src/renderer/src/App.tsx | 2 +- .../src/components/entry-column/index.tsx | 85 +++++++++---------- .../src/components/entry-content/share.tsx | 2 +- .../src/components/feed-column/index.tsx | 37 +++----- src/renderer/src/components/ui/button.tsx | 2 +- .../src/pages/(main)/(context)/layout.tsx | 2 +- src/renderer/src/pages/add/index.tsx | 2 +- src/renderer/src/pages/settings/layout.tsx | 4 +- 9 files changed, 60 insertions(+), 80 deletions(-) diff --git a/src/main/window.ts b/src/main/window.ts index d58bb926d..4d873ce6b 100644 --- a/src/main/window.ts +++ b/src/main/window.ts @@ -25,6 +25,10 @@ export function createWindow(options?: { }, titleBarStyle: "hiddenInset", + trafficLightPosition: { + x: 18, + y: 18, + }, transparent: true, backgroundColor: "#00000000", // transparent hexadecimal or anything with transparency, diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx index 43b5700ce..4982f385e 100644 --- a/src/renderer/src/App.tsx +++ b/src/renderer/src/App.tsx @@ -20,7 +20,7 @@ function App() { return ( <>
diff --git a/src/renderer/src/components/entry-column/index.tsx b/src/renderer/src/components/entry-column/index.tsx index 1b2593a05..6c3e8c979 100644 --- a/src/renderer/src/components/entry-column/index.tsx +++ b/src/renderer/src/components/entry-column/index.tsx @@ -8,7 +8,7 @@ import { import { views } from "@renderer/lib/constants" import { FeedViewType } from "@renderer/lib/enum" import { buildStorageNS } from "@renderer/lib/ns" -import { cn, getEntriesParams } from "@renderer/lib/utils" +import { getEntriesParams } from "@renderer/lib/utils" import type { EntryModel } from "@renderer/models" import { apiClient } from "@renderer/queries/api-fetch" import { useEntries } from "@renderer/queries/entries" @@ -194,8 +194,43 @@ const ListHeader: FC = () => { }, [activeList]) return ( -
-
+
+
+
+ setUnreadOnly(!unreadOnly)} + > + {unreadOnly ? ( + + ) : ( + + )} + + + + {}} tooltip="Mark All as Read"> + + + + +
Mark all as read?
+
+ + + + {/* TODO */} + +
+
+
+
+
+
{activeList?.name}
{entries.data?.pages?.[0].total || 0} @@ -205,50 +240,6 @@ const ListHeader: FC = () => { Items
-
- - - - - setUnreadOnly(!unreadOnly)} - active={unreadOnly} - > - {unreadOnly ? ( - - ) : ( - - )} - - - - {}} tooltip="Mark All as Read"> - - - - - -
Mark all as read?
-
- - - - {/* TODO */} - -
-
-
-
) } diff --git a/src/renderer/src/components/entry-content/share.tsx b/src/renderer/src/components/entry-content/share.tsx index e5318e442..7ec64dfe7 100644 --- a/src/renderer/src/components/entry-content/share.tsx +++ b/src/renderer/src/components/entry-content/share.tsx @@ -21,7 +21,7 @@ export function EntryShare({ if (!entry?.entries.url) return null return ( -
+
{items .filter((item) => !item.disabled) diff --git a/src/renderer/src/components/feed-column/index.tsx b/src/renderer/src/components/feed-column/index.tsx index 0c632f073..9232cbca8 100644 --- a/src/renderer/src/components/feed-column/index.tsx +++ b/src/renderer/src/components/feed-column/index.tsx @@ -1,4 +1,4 @@ -import { Button } from "@renderer/components/ui/button" +import { Button, HeaderActionButton } from "@renderer/components/ui/button" import { Tooltip, TooltipContent, @@ -67,33 +67,18 @@ export function FeedColumn() { preventNavigate: true, })} > -
-
{ - e.stopPropagation() - setActiveList({ - level: levels.view, - id: active, - name: views[active].name, - view: active, - }) - }} - > - logo - Follow -
-
- - + +
diff --git a/src/renderer/src/components/ui/button.tsx b/src/renderer/src/components/ui/button.tsx index 45f71cbc1..f90861b95 100644 --- a/src/renderer/src/components/ui/button.tsx +++ b/src/renderer/src/components/ui/button.tsx @@ -71,7 +71,7 @@ Button.displayName = "Button" // BIZ buttons interface HeaderActionButtonProps { - onClick: () => void + onClick?: () => void icon?: React.ReactNode | React.FC tooltip: string tooltipSide?: "top" | "bottom" diff --git a/src/renderer/src/pages/(main)/(context)/layout.tsx b/src/renderer/src/pages/(main)/(context)/layout.tsx index 70d3c2a39..725c6be46 100644 --- a/src/renderer/src/pages/(main)/(context)/layout.tsx +++ b/src/renderer/src/pages/(main)/(context)/layout.tsx @@ -5,7 +5,7 @@ import { Outlet } from "react-router-dom" export function Component() { return (
-
+
diff --git a/src/renderer/src/pages/add/index.tsx b/src/renderer/src/pages/add/index.tsx index 1fa530063..f5a5cd43f 100644 --- a/src/renderer/src/pages/add/index.tsx +++ b/src/renderer/src/pages/add/index.tsx @@ -117,7 +117,7 @@ export function Component() { ) return ( -
+
logo Add follow diff --git a/src/renderer/src/pages/settings/layout.tsx b/src/renderer/src/pages/settings/layout.tsx index 790f1e582..7ef474276 100644 --- a/src/renderer/src/pages/settings/layout.tsx +++ b/src/renderer/src/pages/settings/layout.tsx @@ -32,8 +32,8 @@ export function Component() { Follow Settings
*/}
-
-
+
+
logo Settings