Merge remote-tracking branch 'origin/main'
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@
|
||||
"tsx": true,
|
||||
"tailwind": {
|
||||
"config": "tailwind.config.cjs",
|
||||
"css": "src/renderer/src/assets/main.css",
|
||||
"css": "src/renderer/src/styles/main.css",
|
||||
"baseColor": "slate",
|
||||
"cssVariables": true,
|
||||
"prefix": ""
|
||||
|
||||
+3
-2
@@ -48,6 +48,7 @@
|
||||
"@tanstack/react-query-persist-client": "5.40.0",
|
||||
"@use-gesture/react": "10.3.1",
|
||||
"class-variance-authority": "0.7.0",
|
||||
"click-to-react-component": "1.1.0",
|
||||
"clsx": "2.1.1",
|
||||
"cmdk": "1.0.0",
|
||||
"dayjs": "1.11.11",
|
||||
@@ -57,8 +58,8 @@
|
||||
"hast-util-to-jsx-runtime": "2.3.0",
|
||||
"immer": "10.1.1",
|
||||
"jotai": "2.8.2",
|
||||
"jotai-dark": "^0.3.0",
|
||||
"jotai-effect": "^1.0.0",
|
||||
"jotai-dark": "0.3.1",
|
||||
"jotai-effect": "1.0.0",
|
||||
"lethargy": "1.0.9",
|
||||
"lodash-es": "4.17.21",
|
||||
"lucide-react": "0.381.0",
|
||||
|
||||
Generated
+96
-6
@@ -83,6 +83,9 @@ importers:
|
||||
class-variance-authority:
|
||||
specifier: 0.7.0
|
||||
version: 0.7.0
|
||||
click-to-react-component:
|
||||
specifier: 1.1.0
|
||||
version: 1.1.0(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
|
||||
clsx:
|
||||
specifier: 2.1.1
|
||||
version: 2.1.1
|
||||
@@ -111,10 +114,10 @@ importers:
|
||||
specifier: 2.8.2
|
||||
version: 2.8.2(@types/react@18.3.3)(react@18.3.1)
|
||||
jotai-dark:
|
||||
specifier: ^0.3.0
|
||||
version: 0.3.0(jotai-effect@1.0.0(jotai@2.8.2(@types/react@18.3.3)(react@18.3.1)))(jotai@2.8.2(@types/react@18.3.3)(react@18.3.1))(react@18.3.1)
|
||||
specifier: 0.3.1
|
||||
version: 0.3.1(jotai-effect@1.0.0(jotai@2.8.2(@types/react@18.3.3)(react@18.3.1)))(jotai@2.8.2(@types/react@18.3.3)(react@18.3.1))(react@18.3.1)
|
||||
jotai-effect:
|
||||
specifier: ^1.0.0
|
||||
specifier: 1.0.0
|
||||
version: 1.0.0(jotai@2.8.2(@types/react@18.3.3)(react@18.3.1))
|
||||
lethargy:
|
||||
specifier: 1.0.9
|
||||
@@ -1119,12 +1122,28 @@ packages:
|
||||
resolution: {integrity: sha512-niBqk8iwv96+yuTwjM6bWg8ovzAPF9qkICsGtcoa5/dmqcEMfdwNAX7+/OHcJHc7wj7XqPxH98oAHytFYlw6Sw==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@floating-ui/core@0.6.2':
|
||||
resolution: {integrity: sha512-jktYRmZwmau63adUG3GKOAVCofBXkk55S/zQ94XOorAHhwqFIOFAy1rSp2N0Wp6/tGbe9V3u/ExlGZypyY17rg==}
|
||||
|
||||
'@floating-ui/core@1.6.0':
|
||||
resolution: {integrity: sha512-PcF++MykgmTj3CIyOQbKA/hDzOAiqI3mhuoN44WRCopIs1sgoDoU4oty4Jtqaj/y3oDU6fnVSm4QG0a3t5i0+g==}
|
||||
|
||||
'@floating-ui/dom@0.4.5':
|
||||
resolution: {integrity: sha512-b+prvQgJt8pieaKYMSJBXHxX/DYwdLsAWxKYqnO5dO2V4oo/TYBZJAUQCVNjTWWsrs6o4VDrNcP9+E70HAhJdw==}
|
||||
|
||||
'@floating-ui/dom@1.6.3':
|
||||
resolution: {integrity: sha512-RnDthu3mzPlQ31Ss/BTwQ1zjzIhr3lk1gZB1OC56h/1vEtaXkESrOqL5fQVMfXpwGtRwX+YsZBdyHtJMQnkArw==}
|
||||
|
||||
'@floating-ui/react-dom-interactions@0.3.1':
|
||||
resolution: {integrity: sha512-tP2KEh7EHJr5hokSBHcPGojb+AorDNUf0NYfZGg/M+FsMvCOOsSEeEF0O1NDfETIzDnpbHnCs0DuvCFhSMSStg==}
|
||||
deprecated: Package renamed to @floating-ui/react
|
||||
|
||||
'@floating-ui/react-dom@0.6.3':
|
||||
resolution: {integrity: sha512-hC+pS5D6AgS2wWjbmSQ6UR6Kpy+drvWGJIri6e1EDGADTPsCaa4KzCgmCczHrQeInx9tqs81EyDmbKJYY2swKg==}
|
||||
peerDependencies:
|
||||
react: '>=16.8.0'
|
||||
react-dom: '>=16.8.0'
|
||||
|
||||
'@floating-ui/react-dom@2.0.8':
|
||||
resolution: {integrity: sha512-HOdqOt3R3OGeTKidaLvJKcgg75S6tibQ3Tif4eyd91QnIJWr0NLvoXFpJA/j8HqkFSL68GDca9AuyWEHlhyClw==}
|
||||
peerDependencies:
|
||||
@@ -2362,6 +2381,11 @@ packages:
|
||||
resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
click-to-react-component@1.1.0:
|
||||
resolution: {integrity: sha512-/DjZemufS1BkxyRgZL3r7HXVVOFRWVQi5Xd4EBnjxZMwrHEh0OlUVA2N9CjXkZ0x8zMf8dL1cKnnx+xUWUg4VA==}
|
||||
peerDependencies:
|
||||
react: '>=16.8.0'
|
||||
|
||||
cliui@8.0.1:
|
||||
resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -3328,6 +3352,9 @@ packages:
|
||||
resolution: {integrity: sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==}
|
||||
engines: {node: '>=10'}
|
||||
|
||||
htm@3.1.1:
|
||||
resolution: {integrity: sha512-983Vyg8NwUE7JkZ6NmOqpCZ+sh1bKv2iYTlUkzlWmA5JD2acKoxd4KVxbMmxX/85mtfdnDmTFoNKcg5DGAvxNQ==}
|
||||
|
||||
html-void-elements@3.0.0:
|
||||
resolution: {integrity: sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==}
|
||||
|
||||
@@ -3538,8 +3565,8 @@ packages:
|
||||
jose@5.3.0:
|
||||
resolution: {integrity: sha512-IChe9AtAE79ru084ow8jzkN2lNrG3Ntfiv65Cvj9uOCE2m5LNsdHG+9EbxWxAoWRF9TgDOqLN5jm08++owDVRg==}
|
||||
|
||||
jotai-dark@0.3.0:
|
||||
resolution: {integrity: sha512-Vuhymer1VLaAjSW+hLowZBZa0FSKMamo3xajXubCr0Jdnp5P80vrh/5s29EQ2cp3eSa9weuUy+kdoMKEDdp/sA==}
|
||||
jotai-dark@0.3.1:
|
||||
resolution: {integrity: sha512-6yW4qk+xG9kv/YkDr4aCWHMPQZHd+q/p1orFzg5NFJwlBCfK/UBlUJfPTRLMdbMf1+U5u4pBQWPGa7ZHOqSFBQ==}
|
||||
peerDependencies:
|
||||
foxact: ^0.2.33
|
||||
jotai: '>=2.5.0'
|
||||
@@ -4237,6 +4264,9 @@ packages:
|
||||
resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==}
|
||||
engines: {node: '>=4'}
|
||||
|
||||
point-in-polygon@1.1.0:
|
||||
resolution: {integrity: sha512-3ojrFwjnnw8Q9242TzgXuTD+eKiutbzyslcq1ydfu82Db2y+Ogbmyrkpv0Hgj31qwT3lbS9+QAAO/pIQM35XRw==}
|
||||
|
||||
postcss-import@15.1.0:
|
||||
resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==}
|
||||
engines: {node: '>=14.0.0'}
|
||||
@@ -4353,6 +4383,9 @@ packages:
|
||||
react-dom:
|
||||
optional: true
|
||||
|
||||
react-merge-refs@1.1.0:
|
||||
resolution: {integrity: sha512-alTKsjEL0dKH/ru1Iyn7vliS2QRcBp9zZPGoWxUOvRGWPUYgjo+V01is7p04It6KhgrzhJGnIj9GgX8W4bZoCQ==}
|
||||
|
||||
react-refresh@0.14.2:
|
||||
resolution: {integrity: sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
@@ -4966,6 +4999,15 @@ packages:
|
||||
'@types/react':
|
||||
optional: true
|
||||
|
||||
use-isomorphic-layout-effect@1.1.2:
|
||||
resolution: {integrity: sha512-49L8yCO3iGT/ZF9QttjwLF/ZD9Iwto5LnH5LmEdk/6cFmXddqi2ulF0edxTwjj+7mqvpVVGQWvbXZdn32wRSHA==}
|
||||
peerDependencies:
|
||||
'@types/react': '*'
|
||||
react: ^16.8.0 || ^17.0.0 || ^18.0.0
|
||||
peerDependenciesMeta:
|
||||
'@types/react':
|
||||
optional: true
|
||||
|
||||
use-sidecar@1.1.2:
|
||||
resolution: {integrity: sha512-epTbsLuzZ7lPClpz2TyryBfztm7m+28DlEv2ZCQ3MDr5ssiwyOwGH/e5F9CkfWjJ1t4clvI58yF822/GUkjjhw==}
|
||||
engines: {node: '>=10'}
|
||||
@@ -6106,15 +6148,41 @@ snapshots:
|
||||
|
||||
'@eslint/js@9.3.0': {}
|
||||
|
||||
'@floating-ui/core@0.6.2': {}
|
||||
|
||||
'@floating-ui/core@1.6.0':
|
||||
dependencies:
|
||||
'@floating-ui/utils': 0.2.1
|
||||
|
||||
'@floating-ui/dom@0.4.5':
|
||||
dependencies:
|
||||
'@floating-ui/core': 0.6.2
|
||||
|
||||
'@floating-ui/dom@1.6.3':
|
||||
dependencies:
|
||||
'@floating-ui/core': 1.6.0
|
||||
'@floating-ui/utils': 0.2.1
|
||||
|
||||
'@floating-ui/react-dom-interactions@0.3.1(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)':
|
||||
dependencies:
|
||||
'@floating-ui/react-dom': 0.6.3(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
|
||||
aria-hidden: 1.2.4
|
||||
point-in-polygon: 1.1.0
|
||||
use-isomorphic-layout-effect: 1.1.2(@types/react@18.3.3)(react@18.3.1)
|
||||
transitivePeerDependencies:
|
||||
- '@types/react'
|
||||
- react
|
||||
- react-dom
|
||||
|
||||
'@floating-ui/react-dom@0.6.3(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)':
|
||||
dependencies:
|
||||
'@floating-ui/dom': 0.4.5
|
||||
react: 18.3.1
|
||||
react-dom: 18.3.1(react@18.3.1)
|
||||
use-isomorphic-layout-effect: 1.1.2(@types/react@18.3.3)(react@18.3.1)
|
||||
transitivePeerDependencies:
|
||||
- '@types/react'
|
||||
|
||||
'@floating-ui/react-dom@2.0.8(react-dom@18.3.1(react@18.3.1))(react@18.3.1)':
|
||||
dependencies:
|
||||
'@floating-ui/dom': 1.6.3
|
||||
@@ -7578,6 +7646,16 @@ snapshots:
|
||||
slice-ansi: 5.0.0
|
||||
string-width: 7.1.0
|
||||
|
||||
click-to-react-component@1.1.0(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1):
|
||||
dependencies:
|
||||
'@floating-ui/react-dom-interactions': 0.3.1(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
|
||||
htm: 3.1.1
|
||||
react: 18.3.1
|
||||
react-merge-refs: 1.1.0
|
||||
transitivePeerDependencies:
|
||||
- '@types/react'
|
||||
- react-dom
|
||||
|
||||
cliui@8.0.1:
|
||||
dependencies:
|
||||
string-width: 4.2.3
|
||||
@@ -8930,6 +9008,8 @@ snapshots:
|
||||
dependencies:
|
||||
lru-cache: 6.0.0
|
||||
|
||||
htm@3.1.1: {}
|
||||
|
||||
html-void-elements@3.0.0: {}
|
||||
|
||||
http-cache-semantics@4.1.1: {}
|
||||
@@ -9110,7 +9190,7 @@ snapshots:
|
||||
|
||||
jose@5.3.0: {}
|
||||
|
||||
jotai-dark@0.3.0(jotai-effect@1.0.0(jotai@2.8.2(@types/react@18.3.3)(react@18.3.1)))(jotai@2.8.2(@types/react@18.3.3)(react@18.3.1))(react@18.3.1):
|
||||
jotai-dark@0.3.1(jotai-effect@1.0.0(jotai@2.8.2(@types/react@18.3.3)(react@18.3.1)))(jotai@2.8.2(@types/react@18.3.3)(react@18.3.1))(react@18.3.1):
|
||||
optionalDependencies:
|
||||
jotai: 2.8.2(@types/react@18.3.3)(react@18.3.1)
|
||||
jotai-effect: 1.0.0(jotai@2.8.2(@types/react@18.3.3)(react@18.3.1))
|
||||
@@ -9912,6 +9992,8 @@ snapshots:
|
||||
|
||||
pluralize@8.0.0: {}
|
||||
|
||||
point-in-polygon@1.1.0: {}
|
||||
|
||||
postcss-import@15.1.0(postcss@8.4.38):
|
||||
dependencies:
|
||||
postcss: 8.4.38
|
||||
@@ -10005,6 +10087,8 @@ snapshots:
|
||||
optionalDependencies:
|
||||
react-dom: 18.3.1(react@18.3.1)
|
||||
|
||||
react-merge-refs@1.1.0: {}
|
||||
|
||||
react-refresh@0.14.2: {}
|
||||
|
||||
react-remove-scroll-bar@2.3.6(@types/react@18.3.3)(react@18.3.1):
|
||||
@@ -10685,6 +10769,12 @@ snapshots:
|
||||
optionalDependencies:
|
||||
'@types/react': 18.3.3
|
||||
|
||||
use-isomorphic-layout-effect@1.1.2(@types/react@18.3.3)(react@18.3.1):
|
||||
dependencies:
|
||||
react: 18.3.1
|
||||
optionalDependencies:
|
||||
'@types/react': 18.3.3
|
||||
|
||||
use-sidecar@1.1.2(@types/react@18.3.3)(react@18.3.1):
|
||||
dependencies:
|
||||
detect-node-es: 1.1.0
|
||||
|
||||
+12
-1
@@ -1,9 +1,20 @@
|
||||
<!doctype html>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="referrer" content="no-referrer" />
|
||||
<title>Follow</title>
|
||||
|
||||
<script>
|
||||
(function () {
|
||||
var e =
|
||||
window.matchMedia &&
|
||||
window.matchMedia("(prefers-color-scheme: dark)").matches,
|
||||
t = localStorage.getItem("theme") || '"system"';
|
||||
('"dark"' === t || (e && '"light"' !== t)) &&
|
||||
(document.documentElement.dataset.theme = "light");
|
||||
})();
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
@@ -7,15 +7,14 @@ import { handlers } from "./tipc"
|
||||
|
||||
function App() {
|
||||
useDark()
|
||||
|
||||
useEffect(() => {
|
||||
const unlisten = handlers?.invalidateQuery.listen((queryKey) => {
|
||||
const cleanup = handlers?.invalidateQuery.listen((queryKey) => {
|
||||
queryClient.invalidateQueries({
|
||||
queryKey,
|
||||
})
|
||||
})
|
||||
|
||||
return unlisten
|
||||
return cleanup
|
||||
}, [])
|
||||
|
||||
return (
|
||||
|
||||
@@ -3,8 +3,7 @@ import { useDark } from "@renderer/hooks/useDark"
|
||||
import { Switch } from "./ui/switch"
|
||||
|
||||
export function AppearanceSwitch() {
|
||||
const { toggleDark, isDark } = useDark()
|
||||
|
||||
const { isDark, toggleDark } = useDark()
|
||||
return (
|
||||
<div className="flex items-center justify-between gap-4">
|
||||
<p>Dark Mode</p>
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
import { Button } from "@renderer/components/ui/button"
|
||||
import { Button, HeaderActionButton } from "@renderer/components/ui/button"
|
||||
import {
|
||||
Popover,
|
||||
PopoverClose,
|
||||
PopoverContent,
|
||||
PopoverTrigger,
|
||||
} from "@renderer/components/ui/popover"
|
||||
import {
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
TooltipTrigger,
|
||||
} from "@renderer/components/ui/tooltip"
|
||||
import { views } from "@renderer/lib/constants"
|
||||
import { buildStorageNS } from "@renderer/lib/ns"
|
||||
import type { EntryModel } from "@renderer/lib/types"
|
||||
import { cn, getEntriesParams } from "@renderer/lib/utils"
|
||||
import { apiClient } from "@renderer/queries/api-fetch"
|
||||
import { useEntries } from "@renderer/queries/entries"
|
||||
@@ -110,7 +106,7 @@ export function EntryColumn() {
|
||||
),
|
||||
)
|
||||
|
||||
const virtusoOptions = {
|
||||
const virtuosoOptions = {
|
||||
components: {
|
||||
List: ListContent,
|
||||
},
|
||||
@@ -119,7 +115,7 @@ export function EntryColumn() {
|
||||
totalCount: entries.data?.pages?.[0]?.total,
|
||||
endReached: () => entries.hasNextPage && entries.fetchNextPage(),
|
||||
data: entries.data?.pages.flatMap((page) => page.data) || [],
|
||||
itemContent: (_, entry) => {
|
||||
itemContent: useCallback((_, entry: EntryModel | undefined) => {
|
||||
if (!entry) return null
|
||||
return (
|
||||
<EntryItemWrapper
|
||||
@@ -130,23 +126,24 @@ export function EntryColumn() {
|
||||
<Item entryId={entry.entries.id} />
|
||||
</EntryItemWrapper>
|
||||
)
|
||||
},
|
||||
}, []),
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="relative flex h-full flex-1 flex-col" onClick={() => setActiveEntry?.(null)}>
|
||||
<div
|
||||
className="relative flex h-full flex-1 flex-col"
|
||||
onClick={() => setActiveEntry?.(null)}
|
||||
>
|
||||
<ListHeader />
|
||||
{activeList?.view && views[activeList.view].gridMode ?
|
||||
(
|
||||
<VirtuosoGrid
|
||||
listClassName="grid grid-cols-2 gap-3 md:grid-cols-3 lg:grid-cols-4 px-4"
|
||||
{...virtusoOptions}
|
||||
{...virtuosoOptions}
|
||||
/>
|
||||
) :
|
||||
(
|
||||
<Virtuoso
|
||||
{...virtusoOptions}
|
||||
/>
|
||||
<Virtuoso {...virtuosoOptions} />
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
@@ -187,7 +184,7 @@ const ListHeader: FC = () => {
|
||||
|
||||
return (
|
||||
<div className="mb-5 flex w-full items-center justify-between pl-9 pr-2">
|
||||
<div>
|
||||
<div className="mt-4">
|
||||
<div className="text-lg font-bold">{activeList?.name}</div>
|
||||
<div className="text-xs font-medium text-zinc-400">
|
||||
{entries.data?.pages?.[0].total}
|
||||
@@ -197,42 +194,48 @@ const ListHeader: FC = () => {
|
||||
Items
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-1">
|
||||
<Tooltip>
|
||||
<TooltipTrigger>
|
||||
<Button className="size-8 rounded-full p-0 text-lg" variant="ghost" onClick={() => entries.refetch()}>
|
||||
<i className={cn("i-mingcute-refresh-2-line", entries.isRefetching && "animate-spin")} />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="bottom">Refresh</TooltipContent>
|
||||
</Tooltip>
|
||||
<Tooltip>
|
||||
<TooltipTrigger>
|
||||
<Button className="size-8 rounded-full p-0 text-lg" variant="ghost" onClick={() => setUnreadOnly(!unreadOnly)}>
|
||||
{unreadOnly ? <i className="i-mingcute-round-fill" /> : <i className="i-mingcute-round-line" />}
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="bottom">{unreadOnly ? "Unread Only" : "All"}</TooltipContent>
|
||||
</Tooltip>
|
||||
<div className="relative z-[1] flex h-14 items-center gap-1 text-zinc-500">
|
||||
<HeaderActionButton onClick={entries.refetch} tooltip="Refresh">
|
||||
<i
|
||||
className={cn(
|
||||
"i-mingcute-refresh-2-line",
|
||||
entries.isRefetching && "animate-spin",
|
||||
)}
|
||||
/>
|
||||
</HeaderActionButton>
|
||||
|
||||
<HeaderActionButton
|
||||
tooltip={unreadOnly ? "Unread Only" : "All"}
|
||||
onClick={() => setUnreadOnly(!unreadOnly)}
|
||||
active={unreadOnly}
|
||||
>
|
||||
{unreadOnly ?
|
||||
(
|
||||
<i className="i-mingcute-round-fill" />
|
||||
) :
|
||||
(
|
||||
<i className="i-mingcute-round-line" />
|
||||
)}
|
||||
</HeaderActionButton>
|
||||
<Popover open={markPopoverOpen} onOpenChange={setMarkPopoverOpen}>
|
||||
<PopoverTrigger>
|
||||
<Tooltip>
|
||||
<TooltipTrigger>
|
||||
<Button className="size-8 rounded-full p-0 text-lg" variant="ghost">
|
||||
<i className="i-mingcute-check-circle-line" />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="bottom">Mark All as Read</TooltipContent>
|
||||
</Tooltip>
|
||||
<HeaderActionButton onClick={() => {}} tooltip="Mark All as Read">
|
||||
<i className="i-mingcute-check-circle-line" />
|
||||
</HeaderActionButton>
|
||||
</PopoverTrigger>
|
||||
|
||||
<PopoverContent className="flex w-fit flex-col items-center justify-center gap-3 text-[15px] font-medium">
|
||||
<div>Mark all as read?</div>
|
||||
<div className="space-x-4">
|
||||
<PopoverClose>
|
||||
<Button size="sm" variant="outline">Cancel</Button>
|
||||
<Button size="sm" variant="outline">
|
||||
Cancel
|
||||
</Button>
|
||||
</PopoverClose>
|
||||
{/* TODO */}
|
||||
<Button size="sm" onClick={handleMarkAllAsRead}>Confirm</Button>
|
||||
<Button size="sm" onClick={handleMarkAllAsRead}>
|
||||
Confirm
|
||||
</Button>
|
||||
</div>
|
||||
</PopoverContent>
|
||||
</Popover>
|
||||
|
||||
@@ -48,8 +48,8 @@ export function EntryItemWrapper({
|
||||
<div className={cn(!views[view || 0].wideMode && "pb-3")}>
|
||||
<div
|
||||
className={cn(
|
||||
"rounded-md bg-white transition-colors",
|
||||
!views[view || 0].wideMode && activeEntry === entry.entries.id && "bg-native-active/40",
|
||||
"rounded-md bg-background transition-colors",
|
||||
!views[view || 0].wideMode && activeEntry === entry.entries.id && "bg-theme-item-active",
|
||||
entry.read ? "text-zinc-500/90" : "text-zinc-900 dark:text-white/90",
|
||||
)}
|
||||
// ref={ref}
|
||||
|
||||
@@ -39,7 +39,7 @@ export function EntryContent({ entryId }: { entryId: ActiveEntry }) {
|
||||
<a
|
||||
href={entry.data?.entries.url || void 0}
|
||||
target="_blank"
|
||||
className="mx-auto block max-w-[598px] rounded-md p-6 transition-colors hover:bg-zinc-100 dark:hover:bg-neutral-800"
|
||||
className="mx-auto block max-w-[598px] rounded-md p-6 transition-colors hover:bg-theme-item-hover"
|
||||
rel="noreferrer"
|
||||
>
|
||||
<div className="select-text break-words text-3xl font-bold">
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import { Button } from "@renderer/components/ui/button"
|
||||
import { HeaderActionButton } from "@renderer/components/ui/button"
|
||||
import {
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
TooltipProvider,
|
||||
TooltipTrigger,
|
||||
} from "@renderer/components/ui/tooltip"
|
||||
import { useEntryActions } from "@renderer/hooks/useEntryActions"
|
||||
import { useEntry } from "@renderer/store/entry"
|
||||
@@ -29,25 +26,20 @@ export function EntryShare({
|
||||
{items
|
||||
.filter((item) => !item.disabled)
|
||||
.map((item) => (
|
||||
<Tooltip key={item.name}>
|
||||
<TooltipTrigger asChild>
|
||||
<Button
|
||||
className="no-drag-region flex items-center text-xl"
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={item.onClick}
|
||||
>
|
||||
{item.icon ?
|
||||
(
|
||||
<img className="size-4 grayscale" src={item.icon} />
|
||||
) :
|
||||
(
|
||||
<i className={item.className} />
|
||||
)}
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="bottom">{item.name}</TooltipContent>
|
||||
</Tooltip>
|
||||
<HeaderActionButton
|
||||
icon={
|
||||
item.icon ?
|
||||
(
|
||||
<img className="size-4 grayscale" src={item.icon} />
|
||||
) :
|
||||
(
|
||||
<i className={item.className} />
|
||||
)
|
||||
}
|
||||
onClick={item.onClick}
|
||||
tooltip={item.name}
|
||||
key={item.name}
|
||||
/>
|
||||
))}
|
||||
</TooltipProvider>
|
||||
</div>
|
||||
|
||||
@@ -89,14 +89,14 @@ export function FeedColumn() {
|
||||
<UserButton className="h-5 p-0" hideName />
|
||||
</Link>
|
||||
</Button>
|
||||
<Button variant="ghost" size="sm">
|
||||
<Button className="hover:bg-theme-vibrancyBg" variant="ghost" size="sm">
|
||||
<Link to="/discover" className="flex">
|
||||
<i className="i-mingcute-add-line size-5 text-zinc-500" />
|
||||
<i className="i-mingcute-add-line size-5 text-theme-vibrancyFg" />
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex w-full justify-between px-3 text-xl text-zinc-500">
|
||||
<div className="flex w-full justify-between px-3 text-xl text-theme-vibrancyFg">
|
||||
{views.map((item, index) => (
|
||||
<Tooltip key={item.name}>
|
||||
<TooltipTrigger asChild>
|
||||
@@ -104,6 +104,7 @@ export function FeedColumn() {
|
||||
className={cn(
|
||||
active === index && item.className,
|
||||
"flex items-center text-xl",
|
||||
"hover:!bg-theme-vibrancyBg",
|
||||
)}
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
|
||||
@@ -41,7 +41,7 @@ export function FeedList({
|
||||
>
|
||||
{view !== undefined && views[view].name}
|
||||
</div>
|
||||
<div className="ml-2 flex items-center gap-3 text-sm text-zinc-500">
|
||||
<div className="ml-2 flex items-center gap-3 text-sm text-theme-vibrancyFg">
|
||||
{expansion ?
|
||||
(
|
||||
<i
|
||||
|
||||
@@ -4,7 +4,9 @@ import type { VariantProps } from "class-variance-authority"
|
||||
import { cva } from "class-variance-authority"
|
||||
import * as React from "react"
|
||||
|
||||
const buttonVariants = cva(
|
||||
import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip"
|
||||
|
||||
export const buttonVariants = cva(
|
||||
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
||||
{
|
||||
variants: {
|
||||
@@ -41,7 +43,7 @@ export interface ButtonProps
|
||||
isLoading?: boolean
|
||||
}
|
||||
|
||||
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
(
|
||||
{ className, variant, size, asChild = false, isLoading = false, ...props },
|
||||
ref,
|
||||
@@ -66,4 +68,45 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
)
|
||||
Button.displayName = "Button"
|
||||
|
||||
export { Button, buttonVariants }
|
||||
// BIZ buttons
|
||||
|
||||
interface HeaderActionButtonProps {
|
||||
onClick: () => void
|
||||
icon?: React.ReactNode | React.FC<ComponentType>
|
||||
tooltip: string
|
||||
tooltipSide?: "top" | "bottom"
|
||||
active?: boolean
|
||||
}
|
||||
export const HeaderActionButton = React.forwardRef<
|
||||
HTMLButtonElement,
|
||||
ComponentType<HeaderActionButtonProps>
|
||||
>(
|
||||
(
|
||||
{ icon, onClick, tooltip, className, tooltipSide, children, active },
|
||||
ref,
|
||||
) => (
|
||||
<Tooltip key={tooltip}>
|
||||
<TooltipTrigger asChild ref={ref}>
|
||||
<Button
|
||||
className={cn(
|
||||
"no-drag-region flex items-center text-xl",
|
||||
active && "bg-zinc-500/15 hover:bg-zinc-500/20",
|
||||
className,
|
||||
)}
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={onClick}
|
||||
>
|
||||
{typeof icon === "function" ?
|
||||
React.createElement(icon, {
|
||||
className: "size-4 grayscale text-current",
|
||||
}) :
|
||||
icon}
|
||||
|
||||
{children}
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side={tooltipSide ?? "bottom"}>{tooltip}</TooltipContent>
|
||||
</Tooltip>
|
||||
),
|
||||
)
|
||||
|
||||
@@ -16,7 +16,7 @@ const Switch = React.forwardRef<
|
||||
>
|
||||
<SwitchPrimitives.Thumb
|
||||
className={cn(
|
||||
"pointer-events-none block size-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",
|
||||
"pointer-events-none block size-5 rounded-full bg-background shadow-lg ring-0 !transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",
|
||||
)}
|
||||
/>
|
||||
</SwitchPrimitives.Root>
|
||||
|
||||
@@ -16,7 +16,9 @@ const TooltipContent = React.forwardRef<
|
||||
ref={ref}
|
||||
sideOffset={sideOffset}
|
||||
className={cn(
|
||||
"z-50 overflow-hidden rounded-md bg-stone-300 px-2 py-1 text-sm text-popover-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
||||
"z-50 overflow-hidden border border-border bg-theme-tooltip-background px-2 py-1 text-theme-tooltip-foreground backdrop-blur",
|
||||
"animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
||||
"rounded-lg text-xs shadow shadow-theme-tooltip-background",
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
import { useAtom } from "jotai"
|
||||
import { atomDark } from "jotai-dark"
|
||||
|
||||
const isDarkAtom = atomDark()
|
||||
const isDarkAtom = atomDark({
|
||||
storageKey: "theme",
|
||||
disableTransition: true,
|
||||
applyDarkMode(isDark) {
|
||||
document.documentElement.dataset.theme = isDark ? "dark" : "light"
|
||||
},
|
||||
})
|
||||
|
||||
export function useDark() {
|
||||
const [isDark, setIsDark] = useAtom(isDarkAtom)
|
||||
|
||||
+5
-113
@@ -1,122 +1,13 @@
|
||||
import "./assets/main.css"
|
||||
import "./styles/main.css"
|
||||
|
||||
import { authConfigManager } from "@hono/auth-js/react"
|
||||
import { ClickToComponent } from "click-to-react-component"
|
||||
import * as React from "react"
|
||||
import ReactDOM from "react-dom/client"
|
||||
import { createBrowserRouter, RouterProvider } from "react-router-dom"
|
||||
import { RouterProvider } from "react-router-dom"
|
||||
|
||||
import App from "./App"
|
||||
import { RootProviders } from "./providers/root-providers"
|
||||
|
||||
const router = createBrowserRouter([
|
||||
{
|
||||
path: "/",
|
||||
element: <App />,
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
lazy: () => import("./pages/(main)/layout"),
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
lazy: () => import("./pages/(main)/(context)/layout"),
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
lazy: () => import("./pages/(main)/(context)/index"),
|
||||
},
|
||||
{
|
||||
path: "/discover",
|
||||
lazy: () => import("./pages/(main)/(context)/discover/layout"),
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
lazy: () => import("./pages/(main)/(context)/discover/index"),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "/profile",
|
||||
lazy: () => import("./pages/(main)/(context)/profile/layout"),
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
lazy: () =>
|
||||
import("./pages/(main)/(context)/profile/index"),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "",
|
||||
lazy: () => import("./pages/(external)/layout"),
|
||||
children: [
|
||||
{
|
||||
path: "login",
|
||||
lazy: () => import("./pages/(external)/login"),
|
||||
},
|
||||
{
|
||||
path: "redirect",
|
||||
lazy: () => import("./pages/(external)/redirect"),
|
||||
},
|
||||
{
|
||||
path: "debug",
|
||||
lazy: () => import("./pages/(external)/debug"),
|
||||
},
|
||||
{
|
||||
path: "/feed/:id",
|
||||
lazy: () => import("./pages/(external)/feed/layout"),
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
lazy: () => import("./pages/(external)/feed/index"),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "settings",
|
||||
lazy: () => import("./pages/settings/layout"),
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
lazy: () => import("./pages/settings/index"),
|
||||
},
|
||||
{
|
||||
path: "rsshub",
|
||||
lazy: () => import("./pages/settings/rsshub"),
|
||||
},
|
||||
{
|
||||
path: "profile",
|
||||
lazy: () => import("./pages/settings/profile"),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "add",
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
lazy: () => import("./pages/add/index"),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "preview",
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
lazy: () => import("./pages/preview"),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
])
|
||||
import { router } from "./router"
|
||||
|
||||
authConfigManager.setConfig({
|
||||
baseUrl: import.meta.env.VITE_API_URL,
|
||||
@@ -128,6 +19,7 @@ ReactDOM.createRoot(document.querySelector("#root") as HTMLElement).render(
|
||||
<React.StrictMode>
|
||||
<RootProviders>
|
||||
<RouterProvider router={router} />
|
||||
<ClickToComponent />
|
||||
</RootProviders>
|
||||
</React.StrictMode>,
|
||||
)
|
||||
|
||||
@@ -2,10 +2,7 @@ import { EntryColumn } from "@renderer/components/entry-column"
|
||||
import { EntryContent } from "@renderer/components/entry-content"
|
||||
import { views } from "@renderer/lib/constants"
|
||||
import { cn } from "@renderer/lib/utils"
|
||||
import {
|
||||
feedActions,
|
||||
useFeedStore,
|
||||
} from "@renderer/store"
|
||||
import { feedActions, useFeedStore } from "@renderer/store"
|
||||
import { AnimatePresence } from "framer-motion"
|
||||
import { useEffect } from "react"
|
||||
import { useShallow } from "zustand/react/shallow"
|
||||
@@ -27,7 +24,6 @@ export function Component() {
|
||||
<div
|
||||
className={cn(
|
||||
"h-full shrink-0 overflow-y-auto border-r",
|
||||
window.electron ? "pt-10" : "pt-4",
|
||||
activeList && views[activeList.view].wideMode ? "flex-1" : "w-[340px]",
|
||||
)}
|
||||
>
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
import { createBrowserRouter } from "react-router-dom"
|
||||
|
||||
import App from "./App"
|
||||
|
||||
export const router = createBrowserRouter([
|
||||
{
|
||||
path: "/",
|
||||
element: <App />,
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
lazy: () => import("./pages/(main)/layout"),
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
lazy: () => import("./pages/(main)/(context)/layout"),
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
lazy: () => import("./pages/(main)/(context)/index"),
|
||||
},
|
||||
{
|
||||
path: "/discover",
|
||||
lazy: () => import("./pages/(main)/(context)/discover/layout"),
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
lazy: () =>
|
||||
import("./pages/(main)/(context)/discover/index"),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "/profile",
|
||||
lazy: () => import("./pages/(main)/(context)/profile/layout"),
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
lazy: () =>
|
||||
import("./pages/(main)/(context)/profile/index"),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "",
|
||||
lazy: () => import("./pages/(external)/layout"),
|
||||
children: [
|
||||
{
|
||||
path: "login",
|
||||
lazy: () => import("./pages/(external)/login"),
|
||||
},
|
||||
{
|
||||
path: "redirect",
|
||||
lazy: () => import("./pages/(external)/redirect"),
|
||||
},
|
||||
{
|
||||
path: "debug",
|
||||
lazy: () => import("./pages/(external)/debug"),
|
||||
},
|
||||
{
|
||||
path: "/feed/:id",
|
||||
lazy: () => import("./pages/(external)/feed/layout"),
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
lazy: () => import("./pages/(external)/feed/index"),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "settings",
|
||||
lazy: () => import("./pages/settings/layout"),
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
lazy: () => import("./pages/settings/index"),
|
||||
},
|
||||
{
|
||||
path: "rsshub",
|
||||
lazy: () => import("./pages/settings/rsshub"),
|
||||
},
|
||||
{
|
||||
path: "profile",
|
||||
lazy: () => import("./pages/settings/profile"),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "add",
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
lazy: () => import("./pages/add/index"),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "preview",
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
lazy: () => import("./pages/preview"),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
])
|
||||
@@ -17,7 +17,7 @@ a {
|
||||
@apply cursor-pointer;
|
||||
}
|
||||
|
||||
.dark {
|
||||
[data-theme="dark"] {
|
||||
color-scheme: dark;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
:root {
|
||||
--fo-vibrancy-foreground: theme(colors.zinc.500);
|
||||
--fo-vibrancy-background: theme(colors.native.active/10);
|
||||
|
||||
--fo-item-active: theme(colors.native.active/0.4);
|
||||
--fo-item-hover: theme(colors.native.active/0.2);
|
||||
|
||||
--fo-tooltip-background: theme(colors.zinc.50/0.8);
|
||||
--fo-tooltip-foreground: theme(colors.neutral.950);
|
||||
}
|
||||
|
||||
[data-theme="dark"] {
|
||||
--fo-vibrancy-foreground: theme(colors.zinc.400);
|
||||
/* --fo-vibrancy-background: theme(colors.zinc.600/10); */
|
||||
--fo-vibrancy-background: theme(colors.native.active/10);
|
||||
|
||||
--fo-item-active: theme(colors.neutral.700/0.4);
|
||||
--fo-item-hover: theme(colors.native.active/0.2);
|
||||
|
||||
--fo-tooltip-background: theme(colors.zinc.800/0.8);
|
||||
--fo-tooltip-foreground: theme(colors.zinc.100);
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "./tailwind.css";
|
||||
@import "./font.css";
|
||||
@import "./base.css";
|
||||
@import "./colors.css";
|
||||
@@ -37,7 +37,7 @@
|
||||
--radius: 0.5rem;
|
||||
}
|
||||
|
||||
.dark {
|
||||
[data-theme="dark"] {
|
||||
--background: 0, 0%, 11.8%;
|
||||
--foreground: 0 0% 98%;
|
||||
|
||||
+21
-3
@@ -1,10 +1,13 @@
|
||||
const { iconsPlugin, getIconCollections } = require("@egoist/tailwindcss-icons")
|
||||
const {
|
||||
iconsPlugin,
|
||||
getIconCollections,
|
||||
} = require("@egoist/tailwindcss-icons")
|
||||
|
||||
require("./cssAsPlugin")
|
||||
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
darkMode: ["class"],
|
||||
darkMode: ["class", "[data-theme=\"dark\"]"],
|
||||
content: ["./src/**/*.{ts,tsx}"],
|
||||
prefix: "",
|
||||
theme: {
|
||||
@@ -54,6 +57,21 @@ module.exports = {
|
||||
DEFAULT: "hsl(var(--native))",
|
||||
active: "hsl(var(--native-active))",
|
||||
},
|
||||
|
||||
theme: {
|
||||
vibrancyFg: "var(--fo-vibrancy-foreground)",
|
||||
vibrancyBg: "var(--fo-vibrancy-background)",
|
||||
|
||||
item: {
|
||||
active: "var(--fo-item-active)",
|
||||
hover: "var(--fo-item-hover)",
|
||||
},
|
||||
|
||||
tooltip: {
|
||||
background: "var(--fo-tooltip-background)",
|
||||
foreground: "var(--fo-tooltip-foreground)",
|
||||
},
|
||||
},
|
||||
},
|
||||
borderRadius: {
|
||||
lg: "var(--radius)",
|
||||
@@ -90,6 +108,6 @@ module.exports = {
|
||||
}),
|
||||
require("tailwindcss-animate"),
|
||||
require("@tailwindcss/typography"),
|
||||
require("./src/renderer/src/assets/tailwind-extend.css"),
|
||||
require("./src/renderer/src/styles/tailwind-extend.css"),
|
||||
],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user