Skip to content

Commit

Permalink
Feat: 메인 페이지 업로드 부분 유저 이미지 연결#65
Browse files Browse the repository at this point in the history
  • Loading branch information
jiyeeeah committed Oct 19, 2023
1 parent 30f9242 commit d26d7da
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 42 deletions.
31 changes: 0 additions & 31 deletions components/pages/main/Feed/FeedHeader/Location.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions components/pages/main/Feed/FeedHeader/Title.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default function Title() {
export default function Title({ nickname }: { nickname: string | undefined }) {
return (
<div className="header1">
<span className="text-primary-300">수박이</span> 좋은 하루 되세요!
<span className="text-primary-300">{nickname}</span> 좋은 하루 되세요!
</div>
);
}
12 changes: 9 additions & 3 deletions components/pages/main/Feed/FeedHeader/Upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ import Avatar from '../../../../ui/Avatar';
import Button from '../../../../ui/Button';
import FlexBox from '../../../../ui/FlexBox';

export default function Upload() {
export default function Upload({
userImage,
nickname,
}: {
userImage: string | undefined;
nickname: string | undefined;
}) {
const [postText, setPostText] = useState('');
const [isUploading, setIsUploading] = useState(false);

Expand Down Expand Up @@ -47,8 +53,8 @@ export default function Upload() {
<FlexBox justify="between" className="w-full gap-[24px]">
<Avatar
size="xxl"
image="/Feed/desktop/tempUserProfilePic.svg"
name="수박이"
image={userImage}
name={nickname ?? '로그인하세요'}
/>
<div className="relative w-full">
<textarea
Expand Down
8 changes: 4 additions & 4 deletions components/pages/main/Feed/FeedHeader/index.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import FlexBox from '@/components/ui/FlexBox';
import useGetUserInfo from '@/hooks/queries/useGetUserInfo';
import Title from './Title';
import Location from './Location';
import Upload from './Upload';

export default function FeedHeader() {
const { data } = useGetUserInfo();
return (
<FlexBox
direction="column"
align="start"
justify="between"
className="w-full gap-5 "
>
<Title />
<Title nickname={data?.nickname} />
<FlexBox
direction="column"
align="start"
justify="between"
className="w-full gap-4"
>
<Location />
<Upload />
<Upload userImage={data?.imageUrl} nickname={data?.nickname} />
</FlexBox>
</FlexBox>
);
Expand Down
2 changes: 1 addition & 1 deletion components/ui/Avatar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Image from 'next/image';

interface AvatarType {
image: string;
image: string | undefined;
name: string;
size?: 'small' | 'base' | 'large' | 'xl' | 'xxl';
}
Expand Down
1 change: 0 additions & 1 deletion components/ui/BoardCard/FeedBoardCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export default function FeedBoardCard({
board: Board;
setShowModal: Dispatch<SetStateAction<boolean>>;
}) {
// const { data: commentList } = useGetShortCommentList(boardId);
return (
<FlexBox
direction="column"
Expand Down

0 comments on commit d26d7da

Please sign in to comment.