Skip to content

Commit d029764

Browse files
author
Marukome0743
committed
refactor: lint apps/components/layouts files
1 parent 17e9154 commit d029764

4 files changed

Lines changed: 19 additions & 30 deletions

File tree

apps/dokploy/components/layouts/onboarding-layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { cn } from "@/lib/utils";
21
import Link from "next/link";
32
import type React from "react";
3+
import { cn } from "@/lib/utils";
44
import { GithubIcon } from "../icons/data-tools-icons";
55
import { Logo } from "../shared/logo";
66
import { Button } from "../ui/button";

apps/dokploy/components/layouts/side.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"use client";
2+
import type { inferRouterOutputs } from "@trpc/server";
23
import {
34
Activity,
45
BarChartHorizontalBigIcon,
@@ -29,10 +30,10 @@ import {
2930
User,
3031
Users,
3132
} from "lucide-react";
33+
import Link from "next/link";
3234
import { usePathname } from "next/navigation";
33-
import type * as React from "react";
3435
import { useEffect, useState } from "react";
35-
36+
import { toast } from "sonner";
3637
import {
3738
Breadcrumb,
3839
BreadcrumbItem,
@@ -77,10 +78,6 @@ import { authClient } from "@/lib/auth-client";
7778
import { cn } from "@/lib/utils";
7879
import type { AppRouter } from "@/server/api/root";
7980
import { api } from "@/utils/api";
80-
import type { inferRouterOutputs } from "@trpc/server";
81-
import Link from "next/link";
82-
import { useRouter } from "next/router";
83-
import { toast } from "sonner";
8481
import { AddOrganization } from "../dashboard/organization/handle-organization";
8582
import { DialogAction } from "../shared/dialog-action";
8683
import { Logo } from "../shared/logo";
@@ -770,9 +767,7 @@ export default function Page({ children }: Props) {
770767
setIsLoaded(true);
771768
}, []);
772769

773-
const router = useRouter();
774770
const pathname = usePathname();
775-
const _currentPath = router.pathname;
776771
const { data: auth } = api.user.get.useQuery();
777772
const { data: dokployVersion } = api.settings.getDokployVersion.useQuery();
778773

apps/dokploy/components/layouts/update-server.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { api } from "@/utils/api";
21
import type { IUpdateData } from "@dokploy/server/index";
32
import { Download } from "lucide-react";
4-
import { useRouter } from "next/router";
53
import { useEffect, useRef, useState } from "react";
4+
import { api } from "@/utils/api";
65
import UpdateServer from "../dashboard/settings/web-server/update-server";
76
import { Button } from "../ui/button";
87
import {
@@ -11,24 +10,21 @@ import {
1110
TooltipProvider,
1211
TooltipTrigger,
1312
} from "../ui/tooltip";
13+
1414
const AUTO_CHECK_UPDATES_INTERVAL_MINUTES = 7;
1515

1616
export const UpdateServerButton = () => {
1717
const [updateData, setUpdateData] = useState<IUpdateData>({
1818
latestVersion: null,
1919
updateAvailable: false,
2020
});
21-
const _router = useRouter();
2221
const { data: isCloud } = api.settings.isCloud.useQuery();
2322
const { mutateAsync: getUpdateData } =
2423
api.settings.getUpdateData.useMutation();
2524
const [isOpen, setIsOpen] = useState(false);
2625

2726
const checkUpdatesIntervalRef = useRef<null | NodeJS.Timeout>(null);
2827

29-
if (isCloud) {
30-
return null;
31-
}
3228
useEffect(() => {
3329
// Handling of automatic check for server updates
3430
if (isCloud) {
@@ -77,7 +73,7 @@ export const UpdateServerButton = () => {
7773
};
7874
}, []);
7975

80-
return updateData.updateAvailable ? (
76+
return !isCloud && updateData.updateAvailable ? (
8177
<div className="border-t pt-4">
8278
<UpdateServer
8379
updateData={updateData}

apps/dokploy/components/layouts/user-nav.tsx

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { ChevronsUpDown } from "lucide-react";
2+
import { useRouter } from "next/router";
13
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
24
import {
35
DropdownMenu,
@@ -19,8 +21,6 @@ import { authClient } from "@/lib/auth-client";
1921
import { Languages } from "@/lib/languages";
2022
import { api } from "@/utils/api";
2123
import useLocale from "@/utils/hooks/use-locale";
22-
import { ChevronsUpDown } from "lucide-react";
23-
import { useRouter } from "next/router";
2424
import { ModeToggle } from "../ui/modeToggle";
2525
import { SidebarMenuButton } from "../ui/sidebar";
2626

@@ -122,18 +122,16 @@ export const UserNav = () => {
122122
)}
123123
</>
124124
) : (
125-
<>
126-
{data?.role === "owner" && (
127-
<DropdownMenuItem
128-
className="cursor-pointer"
129-
onClick={() => {
130-
router.push("/dashboard/settings/servers");
131-
}}
132-
>
133-
Servers
134-
</DropdownMenuItem>
135-
)}
136-
</>
125+
data?.role === "owner" && (
126+
<DropdownMenuItem
127+
className="cursor-pointer"
128+
onClick={() => {
129+
router.push("/dashboard/settings/servers");
130+
}}
131+
>
132+
Servers
133+
</DropdownMenuItem>
134+
)
137135
)}
138136
</DropdownMenuGroup>
139137
{isCloud && data?.role === "owner" && (

0 commit comments

Comments
 (0)