Skip to content

Commit

Permalink
Refactor/#98: 피드 아이디어 카드에서 세부 스킬 대신 대표 스킬 노출 (#99)
Browse files Browse the repository at this point in the history
* refactor: IdeaCard에 대해 세부 스킬에서 대표스킬로 API 변경 사항 대응

* refactor: 회원 탈퇴 문구 보완
  • Loading branch information
semnil5202 authored Apr 14, 2024
1 parent 64e49b2 commit 8964802
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const CardList = () => {
const profile = {
profileImageUrl: idea.memberResponse.profileImageUrl,
nickname: idea.memberResponse.nickname,
skills: idea.memberResponse.skills,
mainSkill: idea.memberResponse.mainSkill,
isBookmarked: idea.isBookmarked,
createdAt: idea.createdAt,
};
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Feed/hooks/queries/useBestIdeasQuery.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useSuspenseInfiniteQuery, useSuspenseQuery } from '@tanstack/react-query';
import { useSuspenseInfiniteQuery } from '@tanstack/react-query';

import { http } from '../../../../api/http';
import { BestIdea } from '../../types';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Feed/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type MemberResponse = {
id: number;
profileImageUrl: string;
nickname: string;
skills: string[];
mainSkill: string;
};

export type Idea = {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Profile/More.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const More = () => {
};

const handleDeleteAccount = async () => {
const isDelete = await openConfirm({ content: '정말 탈퇴하시겠습니까?' });
const isDelete = await openConfirm({ content: '정말 탈퇴하시겠습니까? 회원 정보가 즉시 삭제됩니다.' });
if (!isDelete) return;

deleteAccount();
Expand Down
3 changes: 1 addition & 2 deletions src/pages/Profile/components/MyProfile/BookmarkSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ const BookmarkSection = () => {
const profile = {
profileImageUrl: idea.memberResponse.profileImageUrl,
nickname: idea.memberResponse.nickname,
skills: idea.memberResponse.skills,
mainSkill: idea.memberResponse.mainSkill,
isBookmarked: idea.isBookmarked,
createdAt: idea.createdAt,
};

const content = {
canEdit: isMine,
branches: idea.branches,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Profile/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export interface MemberResponse {
id: number;
profileImageUrl: string;
nickname: string;
skills: string[];
mainSkill: string;
}
export interface BookmarkedIdea {
id: number;
Expand Down
4 changes: 2 additions & 2 deletions src/pages/WriteEdit/hooks/mutations/usePutIdea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { useNavigate } from 'react-router-dom';

import { http } from '../../../../api/http';

import type { PutIdeaRequest } from '../../types';
import type { PutIdeasRequest } from '../../types';

const _putIdea = ({ ideaId, idea }: { ideaId: number; idea: PutIdeaRequest }) => {
const _putIdea = ({ ideaId, idea }: { ideaId: number; idea: PutIdeasRequest }) => {
return http.put(`/ideas/${ideaId}`, idea);
};

Expand Down
2 changes: 1 addition & 1 deletion src/pages/WriteEdit/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// 글쓰기 요청 body 타입
export type PostIdeasRequest = {
export type PutIdeasRequest = {
title: string; // 제목
introduce: string; // 소개
branchIds: number[]; // 분야
Expand Down
2 changes: 1 addition & 1 deletion src/pages/components/NewIdeaCard/NewIdeaCardContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export interface NewIdeaCardContextType {
profile?: {
profileImageUrl: string;
nickname: string;
skills: string[];
mainSkill: string;
isBookmarked: boolean;
createdAt: string;
};
Expand Down
18 changes: 8 additions & 10 deletions src/pages/components/NewIdeaCard/compound/Profile/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
Text,
TextDivider,
} from 'concept-be-design-system';
import { Fragment, MouseEventHandler } from 'react';
import { MouseEventHandler } from 'react';

import { useDeleteBookmarkIdea } from '../../../../Feed/hooks/mutations/useDeleteBookmarkIdea';
import { usePostBookmarkIdea } from '../../../../Feed/hooks/mutations/usePostBookmarkIdea';
Expand All @@ -23,7 +23,7 @@ type Props = {

const Profile = ({ onClickProfile }: Props) => {
const id = useIdeaIdContext();
const { profileImageUrl, nickname, skills, isBookmarked, createdAt } = useProfileContext();
const { profileImageUrl, nickname, mainSkill, isBookmarked, createdAt } = useProfileContext();
const { postBookmarkIdea } = usePostBookmarkIdea();
const { deleteBookmarkIdea } = useDeleteBookmarkIdea();

Expand Down Expand Up @@ -56,14 +56,12 @@ const Profile = ({ onClickProfile }: Props) => {
<Spacer size={7} />

<Flex maxWidth={200} wrap="wrap" alignItems="center" gap={4}>
{skills.map((skill) => (
<Fragment key={skill}>
<FixedSizeText font="suit12r" color="b9">
{skill}
</FixedSizeText>
<TextDivider left={2} right={2} color="l2" />
</Fragment>
))}
<FixedSizeText font="suit12r" color="b9">
{mainSkill}
</FixedSizeText>

<TextDivider left={2} right={2} color="l2" />

<Text font="suit12r" color="b9">
{formatCommentDate(createdAt)}
</Text>
Expand Down

0 comments on commit 8964802

Please sign in to comment.