From 52c98c47329f07e14da201ce263365560b2e1943 Mon Sep 17 00:00:00 2001
From: HoberMin <102784200+HoberMin@users.noreply.github.com>
Date: Sun, 14 Jul 2024 15:57:14 +0900
Subject: [PATCH] =?UTF-8?q?refactor:=20social=20=ED=8E=98=EC=9D=B4?=
=?UTF-8?q?=EC=A7=80=20=EB=A0=88=EC=9D=B4=EC=95=84=EC=9B=83=20=EC=88=98?=
=?UTF-8?q?=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/app/social/[userId]/followees/layout.tsx | 18 ------------------
src/app/social/followees/layout.tsx | 18 ------------------
src/app/social/followers/layout.tsx | 18 ------------------
.../social/{[userId]/followers => }/layout.tsx | 13 ++++++++++++-
4 files changed, 12 insertions(+), 55 deletions(-)
delete mode 100644 src/app/social/[userId]/followees/layout.tsx
delete mode 100644 src/app/social/followees/layout.tsx
delete mode 100644 src/app/social/followers/layout.tsx
rename src/app/social/{[userId]/followers => }/layout.tsx (59%)
diff --git a/src/app/social/[userId]/followees/layout.tsx b/src/app/social/[userId]/followees/layout.tsx
deleted file mode 100644
index cdb3ce2c..00000000
--- a/src/app/social/[userId]/followees/layout.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import { PropsWithChildren } from 'react';
-
-import TopBar from '@/src/components/Topbar';
-
-const FolloweesLayout = ({ children }: PropsWithChildren) => {
- return (
- <>
-
-
- 팔로잉
-
-
-
{children}
- >
- );
-};
-
-export default FolloweesLayout;
diff --git a/src/app/social/followees/layout.tsx b/src/app/social/followees/layout.tsx
deleted file mode 100644
index cdb3ce2c..00000000
--- a/src/app/social/followees/layout.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import { PropsWithChildren } from 'react';
-
-import TopBar from '@/src/components/Topbar';
-
-const FolloweesLayout = ({ children }: PropsWithChildren) => {
- return (
- <>
-
-
- 팔로잉
-
-
- {children}
- >
- );
-};
-
-export default FolloweesLayout;
diff --git a/src/app/social/followers/layout.tsx b/src/app/social/followers/layout.tsx
deleted file mode 100644
index e4e3b304..00000000
--- a/src/app/social/followers/layout.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import { PropsWithChildren } from 'react';
-
-import TopBar from '@/src/components/Topbar';
-
-const FollowersLayout = ({ children }: PropsWithChildren) => {
- return (
- <>
-
-
- 팔로워
-
-
- {children}
- >
- );
-};
-
-export default FollowersLayout;
diff --git a/src/app/social/[userId]/followers/layout.tsx b/src/app/social/layout.tsx
similarity index 59%
rename from src/app/social/[userId]/followers/layout.tsx
rename to src/app/social/layout.tsx
index e4e3b304..bfe321de 100644
--- a/src/app/social/[userId]/followers/layout.tsx
+++ b/src/app/social/layout.tsx
@@ -1,13 +1,24 @@
+'use client';
+
import { PropsWithChildren } from 'react';
+import { usePathname } from 'next/navigation';
+
import TopBar from '@/src/components/Topbar';
+const pathDict = {
+ followers: '팔로워',
+ followees: '팔로잉',
+};
+
const FollowersLayout = ({ children }: PropsWithChildren) => {
+ const a = usePathname()?.split('/').pop() as keyof typeof pathDict;
+
return (
<>
- 팔로워
+ {pathDict[a]}
{children}