Skip to content

Commit

Permalink
fix: 유저 정보 데이터 저장 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
play3step committed Jul 1, 2024
1 parent eec96dd commit 3d12dd1
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
import { useSelector } from 'react-redux'

const UserInfoContainer = () => {
const userInfo = useSelector(state => state.user.user)

return (
<div className="rounded-md w-[280px] h-[136px] border border-black"></div>
<div className="rounded-md w-[280px] h-[136px] bg-neutrals-20 py-5 px-4">
<div className="flex items-center">
<img
src={userInfo.userInfo?.profileImage}
alt="유저 프로필"
className="w-[40px] h-[40px] rounded-full"
/>
<div className="flex flex-col ml-2">
<p>{userInfo.userInfo?.username}</p>
<p>{userInfo.userInfo?.userCode}</p>
</div>
</div>
</div>
)
}

Expand Down
4 changes: 2 additions & 2 deletions src/components/ListPage/MainContent/MainContentContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ const MainContentContainer = () => {
<div className="w-[1012px] h-[848px] rounded-lg shadow-md p-5 border border-black">
<div className="border border-black w-full h-full flex flex-col">
<MainTitle />
<SubTitle />
<SubTitle text="My Plan" />
<ItemContainer />
<SubTitle />
<SubTitle text="Team Plan" />
<ItemContainer />
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/ListPage/MainContent/atom/MainTitle.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const MainTitle = () => {
return (
<div className="w-full h-[80px] flex items-center pl-4 border border-black">
<div className="w-full h-[80px] flex items-center pl-4 bg-primary-200 text-neutrals-0">
Planding
</div>
)
Expand Down
4 changes: 2 additions & 2 deletions src/components/ListPage/MainContent/atom/SubTitle.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const SubTitle = () => {
const SubTitle = ({ text }) => {
return (
<div className="w-full h-[66px] flex items-center pl-4 border border-black">
My Plan
{text}
</div>
)
}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/ListPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const ListPage = () => {
nav(`/personal`)
}}>
<FavoritesContainer />
<MainContentContainer userInfo={userInfo} />
<InformationContainer />
<MainContentContainer />
<InformationContainer userInfo={userInfo} />
</div>
</div>
)
Expand Down
3 changes: 2 additions & 1 deletion src/services/User/userController.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ export const UserInfo = token => async dispatch => {
Authorization: `Bearer ${token}`
}
})
dispatch(userInfo(response.data))

dispatch(userInfo(response.data.data))
} catch (error) {
console.error('Error fetching user info:', error)
throw error
Expand Down

0 comments on commit 3d12dd1

Please sign in to comment.