Skip to content

Commit 361fef6

Browse files
authored
chore: Release v0.0.1-alpha.9 (#248)
2 parents 88480e3 + 0cd1837 commit 361fef6

File tree

6 files changed

+110
-67
lines changed

6 files changed

+110
-67
lines changed

CHANGELOG.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CHANGELOG
22

3-
## [0.0.1-alpha.8](https://github.com/RSSNext/follow/compare/v0.0.1-alpha.3...v0.0.1-alpha.8) (2024-08-30)
3+
## [0.0.1-alpha.9](https://github.com/RSSNext/follow/compare/v0.0.1-alpha.3...v0.0.1-alpha.9) (2024-08-30)
44

55

66
### Bug Fixes
@@ -43,6 +43,7 @@
4343
* copywrite ([8967d20](https://github.com/RSSNext/follow/commit/8967d20102bc1ad6f2f94b38909c7abfca6168d1))
4444
* daily report animation ([ff16272](https://github.com/RSSNext/follow/commit/ff162722a927d3708f3d857626e6412ae35d3880))
4545
* daily report link title ([0a58159](https://github.com/RSSNext/follow/commit/0a58159acd4fbc12e970f745f27e6488904a99d9))
46+
* dark mode entry content color in electron ([06073d5](https://github.com/RSSNext/follow/commit/06073d53bc6e69867b3e6102c755e6bd1f9be9bf))
4647
* date item layout animation ([e2fec9c](https://github.com/RSSNext/follow/commit/e2fec9c250b9641a645d0f24ec3f038a5b630cfd))
4748
* **db:** remove remaining data if unfollow feed ([1edf560](https://github.com/RSSNext/follow/commit/1edf5605e9621219e6cdfc732f12e6464113f765))
4849
* debug proxy inject env ([6b80cdc](https://github.com/RSSNext/follow/commit/6b80cdc6e7141913643f77a0b9a089333b86278d))
@@ -103,6 +104,7 @@
103104
* only windows 11 can manually resize logic ([338803a](https://github.com/RSSNext/follow/commit/338803a18936c29fcea694c95baef1b3e8650980))
104105
* optimize ai daily modal ([8872067](https://github.com/RSSNext/follow/commit/88720679df1371543c0feb5d3a48b7b7e664a20b))
105106
* optimize code string parser ([b3d32d0](https://github.com/RSSNext/follow/commit/b3d32d09fd4d5b53ae1692ffdc154e8d37a77fdd))
107+
* optimize invitation page ([5f93e4b](https://github.com/RSSNext/follow/commit/5f93e4baac340998b08aaa273e2185893fe88e92))
106108
* optional response data for check new, fixed [#195](https://github.com/RSSNext/follow/issues/195) ([2c650b0](https://github.com/RSSNext/follow/commit/2c650b08ae031e18dbe4b25d9c124c3eb7ff4f9a))
107109
* panel split color in dark mode ([3a0cfa1](https://github.com/RSSNext/follow/commit/3a0cfa1ebf794351d7f7b1132c0068a55ff2e9a6))
108110
* peek modal header background color and copywrite ([b8be81b](https://github.com/RSSNext/follow/commit/b8be81b2105d2c229955a433af91c43f5286194a))
@@ -252,6 +254,7 @@
252254
* toast when upgrade ([2a71bfc](https://github.com/RSSNext/follow/commit/2a71bfc0756011c0226c16ef53a755a47cf44acb))
253255
* toc hoverable ([3be6f2b](https://github.com/RSSNext/follow/commit/3be6f2ba019cb914e8ff452065d252e01e7ae496))
254256
* toc position calcation ([a7828d4](https://github.com/RSSNext/follow/commit/a7828d41e1e8e849a4f7df7e0c5e50c5d15a2491))
257+
* update invitations ([84c7b46](https://github.com/RSSNext/follow/commit/84c7b46155c064eab1dbd030add4a00dee412469))
255258
* update readwise logo ([c85460c](https://github.com/RSSNext/follow/commit/c85460c5bd13a3dadda1d4592b1ce6e434f4a8c6))
256259
* update redirect page layout ([bca6276](https://github.com/RSSNext/follow/commit/bca627696eca663abb02483ffb5c98ed2dc0eebc))
257260
* video player ([#225](https://github.com/RSSNext/follow/issues/225)) ([bb7d312](https://github.com/RSSNext/follow/commit/bb7d3127a9fe4543af12edfc49ce745e6ee7099e))

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "Follow",
33
"type": "module",
4-
"version": "0.0.1-alpha.8",
4+
"version": "0.0.1-alpha.9",
55
"private": true,
66
"packageManager": "pnpm@9.7.1",
77
"description": "Next generation information browser",

src/renderer/src/components/ui/select.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const SelectTrigger = React.forwardRef<
2727
>
2828
{children}
2929
<SelectPrimitive.Icon asChild>
30-
<i className="i-mingcute-down-line ml-2 size-4 opacity-50" />
30+
<i className="i-mingcute-down-line ml-2 size-4 shrink-0 opacity-50" />
3131
</SelectPrimitive.Icon>
3232
</SelectPrimitive.Trigger>
3333
))

src/renderer/src/hooks/common/useDark.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,13 @@ const themeAtom = !window.electron ?
1919
},
2020
) :
2121
atom("system" as ColorMode)
22-
function useDarkElectron() {
23-
return useAtomValue(themeAtom) === "dark"
24-
}
22+
2523
function useDarkWebApp() {
2624
const systemIsDark = useDarkQuery()
2725
const mode = useAtomValue(themeAtom)
2826
return mode === "dark" || (mode === "system" && systemIsDark)
2927
}
30-
export const useIsDark = window.electron ? useDarkElectron : useDarkWebApp
28+
export const useIsDark = useDarkWebApp
3129

3230
export const useThemeAtomValue = () => useAtomValue(themeAtom)
3331

src/renderer/src/modules/entry-content/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ const ContainerToc: FC = () => {
449449
"max-h-[calc(100vh-100px)] overflow-auto scrollbar-none",
450450

451451
"@[500px]:-translate-x-12",
452-
"@[700px]:-translate-x-8 @[800px]:-translate-x-16 @[900px]:translate-x-0 @[900px]:items-start",
452+
"@[700px]:-translate-x-12 @[800px]:-translate-x-16 @[900px]:translate-x-0 @[900px]:items-start",
453453
)}
454454
/>
455455
</div>

src/renderer/src/modules/settings/tabs/invitations.tsx

+101-59
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
import { Avatar, AvatarFallback, AvatarImage } from "@renderer/components/ui/avatar"
2-
import { Button } from "@renderer/components/ui/button"
1+
import {
2+
Avatar,
3+
AvatarFallback,
4+
AvatarImage,
5+
} from "@renderer/components/ui/avatar"
6+
import { Button, MotionButtonBase } from "@renderer/components/ui/button"
37
import { CopyButton } from "@renderer/components/ui/code-highlighter"
8+
import { ScrollArea } from "@renderer/components/ui/scroll-area"
49
import {
510
Table,
611
TableBody,
@@ -9,6 +14,7 @@ import {
914
TableHeader,
1015
TableRow,
1116
} from "@renderer/components/ui/table"
17+
import { Tooltip, TooltipContent, TooltipTrigger } from "@renderer/components/ui/tooltip"
1218
import { useAuthQuery } from "@renderer/hooks/common"
1319
import { apiClient, getFetchErrorMessage } from "@renderer/lib/api-fetch"
1420
import { usePresentUserProfileModal } from "@renderer/modules/profile/hooks"
@@ -27,73 +33,109 @@ export const SettingInvitations = () => {
2733
async onError(err) {
2834
toast.error(getFetchErrorMessage(err))
2935
},
30-
onSuccess() {
36+
onSuccess(data) {
3137
Queries.invitations.list().invalidate()
32-
toast("🎉 New invitation generated")
38+
toast("🎉 New invitation generated, invite code is copied")
39+
navigator.clipboard.writeText(data.data)
3340
},
3441
})
3542
const presentUserProfile = usePresentUserProfileModal("drawer")
3643

3744
return (
3845
<>
3946
<SettingsTitle />
40-
<div className="mt-4">
41-
<Button onClick={() => newInvitation.mutate()}>
42-
New invitation
43-
</Button>
44-
<Table className="mt-4">
45-
<TableHeader>
46-
<TableRow className="[&_*]:!font-semibold">
47-
<TableHead className="w-16 text-center" size="sm">
48-
Code
49-
</TableHead>
50-
<TableHead className="text-center" size="sm">
51-
Creation Time
52-
</TableHead>
53-
<TableHead className="text-center" size="sm">
54-
Used by
55-
</TableHead>
56-
</TableRow>
57-
</TableHeader>
58-
<TableBody>
59-
{invitations.data?.map((row) => (
60-
<TableRow key={row.code}>
61-
<TableCell align="center" size="sm">
62-
<div className="group relative flex items-center justify-center gap-2">
63-
<span>{row.code}</span>
64-
<CopyButton
65-
value={row.code}
66-
className="absolute -right-6 p-0.5 opacity-0 group-hover:opacity-100"
67-
/>
68-
</div>
69-
</TableCell>
70-
<TableCell align="center" size="sm">
71-
{row.createdAt && new Date(row.createdAt).toLocaleString()}
72-
</TableCell>
73-
<TableCell align="center" size="sm">
74-
{row.users ? (
75-
<div
76-
onClick={() => {
77-
presentUserProfile(row.users?.id)
78-
}}
47+
<div className="absolute inset-x-0 bottom-10 top-4 flex flex-col">
48+
<Tooltip>
49+
<TooltipTrigger>
50+
<MotionButtonBase
51+
type="button"
52+
onClick={() => {
53+
newInvitation.mutate()
54+
}}
55+
className="center absolute bottom-0 right-2 size-10 rounded-full bg-accent text-white drop-shadow"
56+
>
57+
<i className="i-mingcute-user-add-2-line size-4" />
58+
</MotionButtonBase>
59+
</TooltipTrigger>
60+
61+
<TooltipContent>
62+
new invitation
63+
</TooltipContent>
64+
</Tooltip>
65+
<ScrollArea.ScrollArea scrollbarClassName="w-1" rootClassName="flex grow">
66+
{invitations.data?.length ? (
67+
<Table className="mt-4">
68+
<TableHeader className="border-b">
69+
<TableRow className="[&_*]:!font-semibold">
70+
<TableHead className="w-16 text-center" size="sm">
71+
Code
72+
</TableHead>
73+
<TableHead className="text-center" size="sm">
74+
Creation Time
75+
</TableHead>
76+
<TableHead className="text-center" size="sm">
77+
Used by
78+
</TableHead>
79+
</TableRow>
80+
</TableHeader>
81+
<TableBody className="border-t-[12px] border-transparent">
82+
{invitations.data?.map((row) => (
83+
<TableRow key={row.code}>
84+
<TableCell align="center" size="sm">
85+
<div className="group relative flex items-center justify-center gap-2 font-mono">
86+
<span>{row.code}</span>
87+
<CopyButton
88+
value={row.code}
89+
className="absolute -right-6 p-1 opacity-0 group-hover:opacity-100 [&_i]:size-3"
90+
/>
91+
</div>
92+
</TableCell>
93+
<TableCell
94+
align="center"
95+
className="tabular-nums"
96+
size="sm"
7997
>
80-
<Avatar className="aspect-square size-5 border border-border ring-1 ring-background">
81-
<AvatarImage src={row.users?.image || undefined} />
82-
<AvatarFallback>{row.users?.name?.slice(0, 2)}</AvatarFallback>
83-
</Avatar>
84-
</div>
85-
) : "Not used"}
98+
{row.createdAt &&
99+
new Date(row.createdAt).toLocaleString()}
100+
</TableCell>
101+
<TableCell align="center" size="sm">
102+
{row.users ? (
103+
<div
104+
onClick={() => {
105+
presentUserProfile(row.users?.id)
106+
}}
107+
>
108+
<Avatar className="aspect-square size-5 border border-border ring-1 ring-background">
109+
<AvatarImage src={row.users?.image || undefined} />
110+
<AvatarFallback>
111+
{row.users?.name?.slice(0, 2)}
112+
</AvatarFallback>
113+
</Avatar>
114+
</div>
115+
) : (
116+
"Not used"
117+
)}
118+
</TableCell>
119+
</TableRow>
120+
))}
121+
</TableBody>
122+
</Table>
123+
) : (
124+
<div className="mt-36 w-full text-center text-sm text-zinc-400">
125+
<p>No invitations</p>
86126

87-
</TableCell>
88-
</TableRow>
89-
))}
90-
</TableBody>
91-
</Table>
92-
{!invitations.data?.length && (
93-
<div className="my-2 w-full text-center text-sm text-zinc-400">
94-
No invitations
95-
</div>
96-
)}
127+
<div className="mt-6">
128+
<Button
129+
onClick={() => {
130+
newInvitation.mutate()
131+
}}
132+
>
133+
Create Invitation
134+
</Button>
135+
</div>
136+
</div>
137+
)}
138+
</ScrollArea.ScrollArea>
97139
</div>
98140
</>
99141
)

0 commit comments

Comments
 (0)