Skip to content

Commit d26d7da

Browse files
committed
Feat: 메인 페이지 업로드 부분 유저 이미지 연결#65
1 parent 30f9242 commit d26d7da

File tree

6 files changed

+16
-42
lines changed

6 files changed

+16
-42
lines changed

components/pages/main/Feed/FeedHeader/Location.tsx

-31
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
export default function Title() {
1+
export default function Title({ nickname }: { nickname: string | undefined }) {
22
return (
33
<div className="header1">
4-
<span className="text-primary-300">수박이</span> 좋은 하루 되세요!
4+
<span className="text-primary-300">{nickname}</span> 좋은 하루 되세요!
55
</div>
66
);
77
}

components/pages/main/Feed/FeedHeader/Upload.tsx

+9-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ import Avatar from '../../../../ui/Avatar';
77
import Button from '../../../../ui/Button';
88
import FlexBox from '../../../../ui/FlexBox';
99

10-
export default function Upload() {
10+
export default function Upload({
11+
userImage,
12+
nickname,
13+
}: {
14+
userImage: string | undefined;
15+
nickname: string | undefined;
16+
}) {
1117
const [postText, setPostText] = useState('');
1218
const [isUploading, setIsUploading] = useState(false);
1319

@@ -47,8 +53,8 @@ export default function Upload() {
4753
<FlexBox justify="between" className="w-full gap-[24px]">
4854
<Avatar
4955
size="xxl"
50-
image="/Feed/desktop/tempUserProfilePic.svg"
51-
name="수박이"
56+
image={userImage}
57+
name={nickname ?? '로그인하세요'}
5258
/>
5359
<div className="relative w-full">
5460
<textarea

components/pages/main/Feed/FeedHeader/index.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
import FlexBox from '@/components/ui/FlexBox';
2+
import useGetUserInfo from '@/hooks/queries/useGetUserInfo';
23
import Title from './Title';
3-
import Location from './Location';
44
import Upload from './Upload';
55

66
export default function FeedHeader() {
7+
const { data } = useGetUserInfo();
78
return (
89
<FlexBox
910
direction="column"
1011
align="start"
1112
justify="between"
1213
className="w-full gap-5 "
1314
>
14-
<Title />
15+
<Title nickname={data?.nickname} />
1516
<FlexBox
1617
direction="column"
1718
align="start"
1819
justify="between"
1920
className="w-full gap-4"
2021
>
21-
<Location />
22-
<Upload />
22+
<Upload userImage={data?.imageUrl} nickname={data?.nickname} />
2323
</FlexBox>
2424
</FlexBox>
2525
);

components/ui/Avatar/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Image from 'next/image';
22

33
interface AvatarType {
4-
image: string;
4+
image: string | undefined;
55
name: string;
66
size?: 'small' | 'base' | 'large' | 'xl' | 'xxl';
77
}

components/ui/BoardCard/FeedBoardCard.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export default function FeedBoardCard({
1010
board: Board;
1111
setShowModal: Dispatch<SetStateAction<boolean>>;
1212
}) {
13-
// const { data: commentList } = useGetShortCommentList(boardId);
1413
return (
1514
<FlexBox
1615
direction="column"

0 commit comments

Comments
 (0)