Release v4.1 (#229)
* refactor: remove custom icon packs * fix: command not work on windows * fix: make open_window command async * feat: improve commands * feat: improve * refactor: column * feat: improve thread column * feat: improve * feat: add stories column * feat: improve * feat: add search column * feat: add reset password * feat: add subscription * refactor: settings * chore: improve commands * fix: crash on production * feat: use tauri store plugin for cache * feat: new icon * chore: update icon for windows * chore: improve some columns * chore: polish code
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
import { cn } from "@/commons";
|
||||
import { appSettings, cn } from "@/commons";
|
||||
import { Spinner } from "@/components";
|
||||
import { RepostIcon } from "@/components";
|
||||
import { LumeWindow } from "@/system";
|
||||
import { useRouteContext } from "@tanstack/react-router";
|
||||
import { Repeat } from "@phosphor-icons/react";
|
||||
import { useStore } from "@tanstack/react-store";
|
||||
import { Menu, MenuItem } from "@tauri-apps/api/menu";
|
||||
import { message } from "@tauri-apps/plugin-dialog";
|
||||
import { useCallback, useState } from "react";
|
||||
import { useNoteContext } from "../provider";
|
||||
|
||||
export function NoteRepost({ large = false }: { large?: boolean }) {
|
||||
const visible = useStore(appSettings, (state) => state.display_repost_button);
|
||||
const event = useNoteContext();
|
||||
const { settings } = useRouteContext({ strict: false });
|
||||
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [isRepost, setIsRepost] = useState(false);
|
||||
@@ -57,7 +57,7 @@ export function NoteRepost({ large = false }: { large?: boolean }) {
|
||||
await menu.popup().catch((e) => console.error(e));
|
||||
}, []);
|
||||
|
||||
if (!settings.display_repost_button) return null;
|
||||
if (!visible) return null;
|
||||
|
||||
return (
|
||||
<button
|
||||
@@ -73,7 +73,7 @@ export function NoteRepost({ large = false }: { large?: boolean }) {
|
||||
{loading ? (
|
||||
<Spinner className="size-4" />
|
||||
) : (
|
||||
<RepostIcon className={cn("size-4", isRepost ? "text-blue-500" : "")} />
|
||||
<Repeat className={cn("size-4", isRepost ? "text-blue-500" : "")} />
|
||||
)}
|
||||
{large ? "Repost" : null}
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user