new menu added, layout corrected in some places

This commit is contained in:
coolcoala
2025-07-19 03:47:25 +03:00
parent 27bcc5f4f8
commit 2ba5c4e706
16 changed files with 966 additions and 408 deletions

View File

@@ -5,6 +5,9 @@ import { UpdateViewer } from "../setting/mods/update-viewer";
import { DialogRef } from "../base";
import { useVerge } from "@/hooks/use-verge";
import { Button } from "@/components/ui/button";
import { t } from "i18next";
import {Download, RefreshCw} from "lucide-react";
import { useSidebar } from "../ui/sidebar";
interface Props {
className?: string;
@@ -14,6 +17,7 @@ export const UpdateButton = (props: Props) => {
const { className } = props;
const { verge } = useVerge();
const { auto_check_update } = verge || {};
const { state: sidebarState } = useSidebar();
const viewerRef = useRef<DialogRef>(null);
@@ -32,15 +36,26 @@ export const UpdateButton = (props: Props) => {
return (
<>
<UpdateViewer ref={viewerRef} />
<Button
variant="destructive"
size="sm"
className={className}
onClick={() => viewerRef.current?.open()}
>
New
</Button>
{sidebarState === 'collapsed' ? (
<Button
variant="outline"
size="icon"
className={className}
onClick={() => viewerRef.current?.open()}
>
<Download />
</Button>
) : (
<Button
variant="outline"
size="lg"
className={className}
onClick={() => viewerRef.current?.open()}
>
<Download />
{t("New update")}
</Button>
)}
</>
);
};