Skip to content

Commit

Permalink
chore: Release v0.0.1-alpha.9 (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod authored Aug 30, 2024
2 parents 88480e3 + 0cd1837 commit 361fef6
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 67 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CHANGELOG

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


### Bug Fixes
Expand Down Expand Up @@ -43,6 +43,7 @@
* copywrite ([8967d20](https://github.com/RSSNext/follow/commit/8967d20102bc1ad6f2f94b38909c7abfca6168d1))
* daily report animation ([ff16272](https://github.com/RSSNext/follow/commit/ff162722a927d3708f3d857626e6412ae35d3880))
* daily report link title ([0a58159](https://github.com/RSSNext/follow/commit/0a58159acd4fbc12e970f745f27e6488904a99d9))
* dark mode entry content color in electron ([06073d5](https://github.com/RSSNext/follow/commit/06073d53bc6e69867b3e6102c755e6bd1f9be9bf))
* date item layout animation ([e2fec9c](https://github.com/RSSNext/follow/commit/e2fec9c250b9641a645d0f24ec3f038a5b630cfd))
* **db:** remove remaining data if unfollow feed ([1edf560](https://github.com/RSSNext/follow/commit/1edf5605e9621219e6cdfc732f12e6464113f765))
* debug proxy inject env ([6b80cdc](https://github.com/RSSNext/follow/commit/6b80cdc6e7141913643f77a0b9a089333b86278d))
Expand Down Expand Up @@ -103,6 +104,7 @@
* only windows 11 can manually resize logic ([338803a](https://github.com/RSSNext/follow/commit/338803a18936c29fcea694c95baef1b3e8650980))
* optimize ai daily modal ([8872067](https://github.com/RSSNext/follow/commit/88720679df1371543c0feb5d3a48b7b7e664a20b))
* optimize code string parser ([b3d32d0](https://github.com/RSSNext/follow/commit/b3d32d09fd4d5b53ae1692ffdc154e8d37a77fdd))
* optimize invitation page ([5f93e4b](https://github.com/RSSNext/follow/commit/5f93e4baac340998b08aaa273e2185893fe88e92))
* optional response data for check new, fixed [#195](https://github.com/RSSNext/follow/issues/195) ([2c650b0](https://github.com/RSSNext/follow/commit/2c650b08ae031e18dbe4b25d9c124c3eb7ff4f9a))
* panel split color in dark mode ([3a0cfa1](https://github.com/RSSNext/follow/commit/3a0cfa1ebf794351d7f7b1132c0068a55ff2e9a6))
* peek modal header background color and copywrite ([b8be81b](https://github.com/RSSNext/follow/commit/b8be81b2105d2c229955a433af91c43f5286194a))
Expand Down Expand Up @@ -252,6 +254,7 @@
* toast when upgrade ([2a71bfc](https://github.com/RSSNext/follow/commit/2a71bfc0756011c0226c16ef53a755a47cf44acb))
* toc hoverable ([3be6f2b](https://github.com/RSSNext/follow/commit/3be6f2ba019cb914e8ff452065d252e01e7ae496))
* toc position calcation ([a7828d4](https://github.com/RSSNext/follow/commit/a7828d41e1e8e849a4f7df7e0c5e50c5d15a2491))
* update invitations ([84c7b46](https://github.com/RSSNext/follow/commit/84c7b46155c064eab1dbd030add4a00dee412469))
* update readwise logo ([c85460c](https://github.com/RSSNext/follow/commit/c85460c5bd13a3dadda1d4592b1ce6e434f4a8c6))
* update redirect page layout ([bca6276](https://github.com/RSSNext/follow/commit/bca627696eca663abb02483ffb5c98ed2dc0eebc))
* video player ([#225](https://github.com/RSSNext/follow/issues/225)) ([bb7d312](https://github.com/RSSNext/follow/commit/bb7d3127a9fe4543af12edfc49ce745e6ee7099e))
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Follow",
"type": "module",
"version": "0.0.1-alpha.8",
"version": "0.0.1-alpha.9",
"private": true,
"packageManager": "pnpm@9.7.1",
"description": "Next generation information browser",
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/components/ui/select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const SelectTrigger = React.forwardRef<
>
{children}
<SelectPrimitive.Icon asChild>
<i className="i-mingcute-down-line ml-2 size-4 opacity-50" />
<i className="i-mingcute-down-line ml-2 size-4 shrink-0 opacity-50" />
</SelectPrimitive.Icon>
</SelectPrimitive.Trigger>
))
Expand Down
6 changes: 2 additions & 4 deletions src/renderer/src/hooks/common/useDark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ const themeAtom = !window.electron ?
},
) :
atom("system" as ColorMode)
function useDarkElectron() {
return useAtomValue(themeAtom) === "dark"
}

function useDarkWebApp() {
const systemIsDark = useDarkQuery()
const mode = useAtomValue(themeAtom)
return mode === "dark" || (mode === "system" && systemIsDark)
}
export const useIsDark = window.electron ? useDarkElectron : useDarkWebApp
export const useIsDark = useDarkWebApp

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

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/modules/entry-content/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ const ContainerToc: FC = () => {
"max-h-[calc(100vh-100px)] overflow-auto scrollbar-none",

"@[500px]:-translate-x-12",
"@[700px]:-translate-x-8 @[800px]:-translate-x-16 @[900px]:translate-x-0 @[900px]:items-start",
"@[700px]:-translate-x-12 @[800px]:-translate-x-16 @[900px]:translate-x-0 @[900px]:items-start",
)}
/>
</div>
Expand Down
160 changes: 101 additions & 59 deletions src/renderer/src/modules/settings/tabs/invitations.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { Avatar, AvatarFallback, AvatarImage } from "@renderer/components/ui/avatar"
import { Button } from "@renderer/components/ui/button"
import {
Avatar,
AvatarFallback,
AvatarImage,
} from "@renderer/components/ui/avatar"
import { Button, MotionButtonBase } from "@renderer/components/ui/button"
import { CopyButton } from "@renderer/components/ui/code-highlighter"
import { ScrollArea } from "@renderer/components/ui/scroll-area"
import {
Table,
TableBody,
Expand All @@ -9,6 +14,7 @@ import {
TableHeader,
TableRow,
} from "@renderer/components/ui/table"
import { Tooltip, TooltipContent, TooltipTrigger } from "@renderer/components/ui/tooltip"
import { useAuthQuery } from "@renderer/hooks/common"
import { apiClient, getFetchErrorMessage } from "@renderer/lib/api-fetch"
import { usePresentUserProfileModal } from "@renderer/modules/profile/hooks"
Expand All @@ -27,73 +33,109 @@ export const SettingInvitations = () => {
async onError(err) {
toast.error(getFetchErrorMessage(err))
},
onSuccess() {
onSuccess(data) {
Queries.invitations.list().invalidate()
toast("🎉 New invitation generated")
toast("🎉 New invitation generated, invite code is copied")
navigator.clipboard.writeText(data.data)
},
})
const presentUserProfile = usePresentUserProfileModal("drawer")

return (
<>
<SettingsTitle />
<div className="mt-4">
<Button onClick={() => newInvitation.mutate()}>
New invitation
</Button>
<Table className="mt-4">
<TableHeader>
<TableRow className="[&_*]:!font-semibold">
<TableHead className="w-16 text-center" size="sm">
Code
</TableHead>
<TableHead className="text-center" size="sm">
Creation Time
</TableHead>
<TableHead className="text-center" size="sm">
Used by
</TableHead>
</TableRow>
</TableHeader>
<TableBody>
{invitations.data?.map((row) => (
<TableRow key={row.code}>
<TableCell align="center" size="sm">
<div className="group relative flex items-center justify-center gap-2">
<span>{row.code}</span>
<CopyButton
value={row.code}
className="absolute -right-6 p-0.5 opacity-0 group-hover:opacity-100"
/>
</div>
</TableCell>
<TableCell align="center" size="sm">
{row.createdAt && new Date(row.createdAt).toLocaleString()}
</TableCell>
<TableCell align="center" size="sm">
{row.users ? (
<div
onClick={() => {
presentUserProfile(row.users?.id)
}}
<div className="absolute inset-x-0 bottom-10 top-4 flex flex-col">
<Tooltip>
<TooltipTrigger>
<MotionButtonBase
type="button"
onClick={() => {
newInvitation.mutate()
}}
className="center absolute bottom-0 right-2 size-10 rounded-full bg-accent text-white drop-shadow"
>
<i className="i-mingcute-user-add-2-line size-4" />
</MotionButtonBase>
</TooltipTrigger>

<TooltipContent>
new invitation
</TooltipContent>
</Tooltip>
<ScrollArea.ScrollArea scrollbarClassName="w-1" rootClassName="flex grow">
{invitations.data?.length ? (
<Table className="mt-4">
<TableHeader className="border-b">
<TableRow className="[&_*]:!font-semibold">
<TableHead className="w-16 text-center" size="sm">
Code
</TableHead>
<TableHead className="text-center" size="sm">
Creation Time
</TableHead>
<TableHead className="text-center" size="sm">
Used by
</TableHead>
</TableRow>
</TableHeader>
<TableBody className="border-t-[12px] border-transparent">
{invitations.data?.map((row) => (
<TableRow key={row.code}>
<TableCell align="center" size="sm">
<div className="group relative flex items-center justify-center gap-2 font-mono">
<span>{row.code}</span>
<CopyButton
value={row.code}
className="absolute -right-6 p-1 opacity-0 group-hover:opacity-100 [&_i]:size-3"
/>
</div>
</TableCell>
<TableCell
align="center"
className="tabular-nums"
size="sm"
>
<Avatar className="aspect-square size-5 border border-border ring-1 ring-background">
<AvatarImage src={row.users?.image || undefined} />
<AvatarFallback>{row.users?.name?.slice(0, 2)}</AvatarFallback>
</Avatar>
</div>
) : "Not used"}
{row.createdAt &&
new Date(row.createdAt).toLocaleString()}
</TableCell>
<TableCell align="center" size="sm">
{row.users ? (
<div
onClick={() => {
presentUserProfile(row.users?.id)
}}
>
<Avatar className="aspect-square size-5 border border-border ring-1 ring-background">
<AvatarImage src={row.users?.image || undefined} />
<AvatarFallback>
{row.users?.name?.slice(0, 2)}
</AvatarFallback>
</Avatar>
</div>
) : (
"Not used"
)}
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
) : (
<div className="mt-36 w-full text-center text-sm text-zinc-400">
<p>No invitations</p>

</TableCell>
</TableRow>
))}
</TableBody>
</Table>
{!invitations.data?.length && (
<div className="my-2 w-full text-center text-sm text-zinc-400">
No invitations
</div>
)}
<div className="mt-6">
<Button
onClick={() => {
newInvitation.mutate()
}}
>
Create Invitation
</Button>
</div>
</div>
)}
</ScrollArea.ScrollArea>
</div>
</>
)
Expand Down

0 comments on commit 361fef6

Please sign in to comment.