File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 } ;
Original file line number Diff line number Diff line change @@ -47,11 +47,6 @@ import {
4747} from './styles' ;
4848
4949const 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 ( ( ) => {
You can’t perform that action at this time.
0 commit comments