Merge pull request #2255 from Marukome0743/lint-layouts

refactor: lint apps/components/layouts files
This commit is contained in:
Mauricio Siu
2025-08-02 00:27:09 -06:00
committed by GitHub
4 changed files with 19 additions and 30 deletions

View File

@@ -1,6 +1,6 @@
import { cn } from "@/lib/utils";
import Link from "next/link";
import type React from "react";
import { cn } from "@/lib/utils";
import { GithubIcon } from "../icons/data-tools-icons";
import { Logo } from "../shared/logo";
import { Button } from "../ui/button";

View File

@@ -1,4 +1,5 @@
"use client";
import type { inferRouterOutputs } from "@trpc/server";
import {
Activity,
BarChartHorizontalBigIcon,
@@ -29,10 +30,10 @@ import {
User,
Users,
} from "lucide-react";
import Link from "next/link";
import { usePathname } from "next/navigation";
import type * as React from "react";
import { useEffect, useState } from "react";
import { toast } from "sonner";
import {
Breadcrumb,
BreadcrumbItem,
@@ -77,10 +78,6 @@ import { authClient } from "@/lib/auth-client";
import { cn } from "@/lib/utils";
import type { AppRouter } from "@/server/api/root";
import { api } from "@/utils/api";
import type { inferRouterOutputs } from "@trpc/server";
import Link from "next/link";
import { useRouter } from "next/router";
import { toast } from "sonner";
import { AddOrganization } from "../dashboard/organization/handle-organization";
import { DialogAction } from "../shared/dialog-action";
import { Logo } from "../shared/logo";
@@ -770,9 +767,7 @@ export default function Page({ children }: Props) {
setIsLoaded(true);
}, []);
const router = useRouter();
const pathname = usePathname();
const _currentPath = router.pathname;
const { data: auth } = api.user.get.useQuery();
const { data: dokployVersion } = api.settings.getDokployVersion.useQuery();

View File

@@ -1,8 +1,7 @@
import { api } from "@/utils/api";
import type { IUpdateData } from "@dokploy/server/index";
import { Download } from "lucide-react";
import { useRouter } from "next/router";
import { useEffect, useRef, useState } from "react";
import { api } from "@/utils/api";
import UpdateServer from "../dashboard/settings/web-server/update-server";
import { Button } from "../ui/button";
import {
@@ -11,6 +10,7 @@ import {
TooltipProvider,
TooltipTrigger,
} from "../ui/tooltip";
const AUTO_CHECK_UPDATES_INTERVAL_MINUTES = 7;
export const UpdateServerButton = () => {
@@ -18,7 +18,6 @@ export const UpdateServerButton = () => {
latestVersion: null,
updateAvailable: false,
});
const _router = useRouter();
const { data: isCloud } = api.settings.isCloud.useQuery();
const { mutateAsync: getUpdateData } =
api.settings.getUpdateData.useMutation();
@@ -26,9 +25,6 @@ export const UpdateServerButton = () => {
const checkUpdatesIntervalRef = useRef<null | NodeJS.Timeout>(null);
if (isCloud) {
return null;
}
useEffect(() => {
// Handling of automatic check for server updates
if (isCloud) {
@@ -77,7 +73,7 @@ export const UpdateServerButton = () => {
};
}, []);
return updateData.updateAvailable ? (
return !isCloud && updateData.updateAvailable ? (
<div className="border-t pt-4">
<UpdateServer
updateData={updateData}

View File

@@ -1,3 +1,5 @@
import { ChevronsUpDown } from "lucide-react";
import { useRouter } from "next/router";
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
import {
DropdownMenu,
@@ -19,8 +21,6 @@ import { authClient } from "@/lib/auth-client";
import { Languages } from "@/lib/languages";
import { api } from "@/utils/api";
import useLocale from "@/utils/hooks/use-locale";
import { ChevronsUpDown } from "lucide-react";
import { useRouter } from "next/router";
import { ModeToggle } from "../ui/modeToggle";
import { SidebarMenuButton } from "../ui/sidebar";
@@ -122,18 +122,16 @@ export const UserNav = () => {
)}
</>
) : (
<>
{data?.role === "owner" && (
<DropdownMenuItem
className="cursor-pointer"
onClick={() => {
router.push("/dashboard/settings/servers");
}}
>
Servers
</DropdownMenuItem>
)}
</>
data?.role === "owner" && (
<DropdownMenuItem
className="cursor-pointer"
onClick={() => {
router.push("/dashboard/settings/servers");
}}
>
Servers
</DropdownMenuItem>
)
)}
</DropdownMenuGroup>
{isCloud && data?.role === "owner" && (