Skip to content

Commit e111f00

Browse files
committed
fix: 사이트 접속 안되는 문제 해결
1 parent 693e6c2 commit e111f00

File tree

4 files changed

+12
-21
lines changed

4 files changed

+12
-21
lines changed

apps/frontend/src/features/pageSidebar/ui/WorkspaceNav/index.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
interface WorkspaceNavProps {
2-
workspaceTitle: string;
3-
}
4-
5-
export function WorkspaceNav({ workspaceTitle }: WorkspaceNavProps) {
6-
// 빌드 에러 해결을 위한 임시 코드.
7-
console.log(workspaceTitle);
1+
// TODO: 워크스페이스 이름 받아야함
2+
export function WorkspaceNav() {
83
return (
94
<div className="flex flex-row items-center justify-center gap-2">
105
<h1 className="text-md font-semibold">{"환영합니다 👋🏻"}</h1>
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
import { useEffect } from "react";
22
import { useNavigate } from "@tanstack/react-router";
3-
import { useCurrentWorkspace } from "@/features/workspace/model/workspaceQuries";
4-
import { useGetUser } from "@/features/auth";
3+
4+
import { useCurrentWorkspace } from "../model/workspaceQuries";
55

66
export const useProtectedWorkspace = () => {
77
const navigate = useNavigate();
8-
const { isLoading: isUserLoading } = useGetUser();
98
const {
109
data: workspaceData,
1110
isLoading: isWorkspaceLoading,
1211
error,
1312
} = useCurrentWorkspace();
1413

1514
useEffect(() => {
16-
if (!isUserLoading && !isWorkspaceLoading && (error || !workspaceData)) {
15+
if (!isWorkspaceLoading && (error || !workspaceData)) {
1716
navigate({ to: "/" });
1817
}
19-
}, [isUserLoading, isWorkspaceLoading, workspaceData, error, navigate]);
18+
}, [isWorkspaceLoading, workspaceData, error, navigate]);
2019

2120
return {
22-
isLoading: isUserLoading || isWorkspaceLoading,
21+
isLoading: isWorkspaceLoading,
2322
workspaceData,
2423
};
2524
};

apps/frontend/src/shared/lib/useWorkspace.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ export function useWorkspace(): string {
66
(match) => match.routeId === "/workspace/$workspaceId",
77
);
88
const workspaceId = workspaceMatch?.params.workspaceId ?? "main";
9-
console.log(workspaceId);
109
return workspaceId;
1110
}

apps/frontend/src/widgets/TopNavView/ui/index.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,32 @@
11
import { Menu, X } from "lucide-react";
22

33
import { WorkspaceNav } from "@/features/pageSidebar";
4-
import { useUserWorkspace } from "@/features/workspace";
54
import { UserInfoView } from "@/widgets/UserInfoView";
65
import { Divider } from "@/shared/ui";
7-
import { useWorkspace } from "@/shared/lib";
86

97
interface TopNavProps {
108
onExpand: () => void;
119
isExpanded: boolean;
1210
}
1311
export function TopNavView({ onExpand, isExpanded }: TopNavProps) {
14-
const workspace = useWorkspace();
15-
const { data } = useUserWorkspace();
12+
/* const workspace = useWorkspace();
13+
const { data } = useUserWorkspace(); */
1614

17-
const getWorkspaceTitle = () => {
15+
/* const getWorkspaceTitle = () => {
1816
if (!workspace) return "공용 워크스페이스";
1917
2018
return (
2119
data?.workspaces.find((w) => w.workspaceId === workspace)?.title ??
2220
"로딩 중..."
2321
);
24-
};
22+
}; */
2523

2624
return (
2725
<div className="flex w-full flex-row items-center justify-between">
2826
<div className="flex flex-row items-center gap-2">
2927
<UserInfoView />
3028
<Divider direction="vertical" className="h-3" />
31-
<WorkspaceNav workspaceTitle={getWorkspaceTitle()} />
29+
<WorkspaceNav />
3230
</div>
3331
<div className="flex h-7 w-7 items-center justify-center">
3432
<button onClick={onExpand}>

0 commit comments

Comments
 (0)