From 79b3d30c1eddcf1a5fd23644c2cd067e2fa3df36 Mon Sep 17 00:00:00 2001 From: karamvir Date: Mon, 24 Jul 2023 01:09:49 -0700 Subject: [PATCH] fixes --- frontend/src/components/header/index.tsx | 2 +- frontend/src/components/updates/update.tsx | 1 - frontend/src/layouts/layout.tsx | 16 +++++++++------- .../dashboard/components/recently-viewed.tsx | 2 +- frontend/src/resources/deployment/page.tsx | 6 +----- .../deployment/{components => }/util.tsx | 0 6 files changed, 12 insertions(+), 15 deletions(-) rename frontend/src/resources/deployment/{components => }/util.tsx (100%) diff --git a/frontend/src/components/header/index.tsx b/frontend/src/components/header/index.tsx index cba5645dd..ac1dfbd9e 100644 --- a/frontend/src/components/header/index.tsx +++ b/frontend/src/components/header/index.tsx @@ -6,7 +6,7 @@ import { Link, useLocation, useParams } from "react-router-dom"; import { useUser } from "@hooks"; import { ServerName } from "@pages/server"; -import { DeploymentName } from "@pages/deployment"; +import { DeploymentName } from "@resources/deployment/util"; export const Paths = () => { const path = useLocation().pathname.split("/")[1]; diff --git a/frontend/src/components/updates/update.tsx b/frontend/src/components/updates/update.tsx index e83d0696f..cd88342fd 100644 --- a/frontend/src/components/updates/update.tsx +++ b/frontend/src/components/updates/update.tsx @@ -22,7 +22,6 @@ import { CardHeader, CardTitle, } from "@ui/card"; -import { useRead } from "@hooks"; export const UpdateUser = ({ userId }: { userId: string }) => { // const { data } = useUpdateUser(userId); diff --git a/frontend/src/layouts/layout.tsx b/frontend/src/layouts/layout.tsx index fb03db999..649972321 100644 --- a/frontend/src/layouts/layout.tsx +++ b/frontend/src/layouts/layout.tsx @@ -1,16 +1,18 @@ import { Header } from "@components/header"; import { useUser } from "@hooks"; import { Toaster } from "@ui/toast"; -import { useLocation } from "react-router-dom"; -import { Outlet, useNavigate } from "react-router-dom"; +import { Outlet, useLocation, useNavigate } from "react-router-dom"; export const Layout = () => { - const { data, isError } = useUser(); - const navigate = useNavigate(); + const { isError } = useUser(); const path = useLocation().pathname; - // if (isError && (!path.includes("login") || !path.includes("signup"))) navigate("/login"); - - console.log(data); + const nav = useNavigate(); + if (isError && !path.includes("login")) nav("/login"); + // const navigate = useNavigate(); + // const path = useLocation().pathname; + // if (isError) return navigate("/login"); + // if ((isError && !path.includes("login")) || !path.includes("signup")) + // navigate("/login"); return ( <> diff --git a/frontend/src/pages/dashboard/components/recently-viewed.tsx b/frontend/src/pages/dashboard/components/recently-viewed.tsx index 84111b57b..a56ce4298 100644 --- a/frontend/src/pages/dashboard/components/recently-viewed.tsx +++ b/frontend/src/pages/dashboard/components/recently-viewed.tsx @@ -20,7 +20,7 @@ const NewButton = () => { return ( <> - +