Skip to content

Commit cb83aab

Browse files
committed
Fix: PostBase & Profile 일부 코드 흐름 수정
1 parent 8672062 commit cb83aab

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

src/pages/Post/PostBase/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ const PostBase: React.FC<PostBaseProps> = ({ onClickMenu }) => {
6262
const [activeTab, setActiveTab] = useState<'likes' | 'comments'>('likes'); // activeTab state
6363

6464
const { postId } = useParams<{ postId: string }>();
65+
const contentRef = useRef<HTMLDivElement>(null);
6566

6667
const nav = useNavigate();
6768

@@ -74,8 +75,6 @@ const PostBase: React.FC<PostBaseProps> = ({ onClickMenu }) => {
7475
nav(`/profile/${post?.user.id}`);
7576
};
7677

77-
const contentRef = useRef<HTMLDivElement>(null);
78-
7978
const toggleTextDisplay = () => {
8079
setShowFullText((prev) => !prev);
8180
};

src/pages/Profile/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ import {
4747
} from './styles';
4848

4949
const Profile: React.FC = () => {
50-
const { userId } = useParams<{ userId: string }>();
51-
const profileUserId = Number(userId);
52-
const currentUserId = getCurrentUserId();
53-
const otherUser = useRecoilValue(OtherUserAtom);
54-
5550
const [isLoading, setIsLoading] = useState<boolean>(true);
5651
const [posts, setPosts] = useState<UserPostSummary[]>([]);
5752
const [totalPosts, setTotalPosts] = useState<number>(0);
@@ -62,6 +57,11 @@ const Profile: React.FC = () => {
6257
const [modalContent, setModalContent] = useState('');
6358
const navigate = useNavigate();
6459

60+
const { userId } = useParams<{ userId: string }>();
61+
const profileUserId = Number(userId);
62+
const currentUserId = getCurrentUserId();
63+
const otherUser = useRecoilValue(OtherUserAtom);
64+
6565
const isMyPage = currentUserId === profileUserId;
6666

6767
useEffect(() => {

0 commit comments

Comments
 (0)