Skip to content

Commit

Permalink
Feat/#157: QA 수정 사항 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
gonn-i committed Jan 24, 2025
2 parents 27c9a62 + 3480910 commit a9f56c3
Show file tree
Hide file tree
Showing 9 changed files with 216 additions and 34 deletions.
39 changes: 39 additions & 0 deletions public/svgs/Group 2085665069.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/apis/board/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface InfiniteQueryResponse {
pageParams: number[];
}

export const useBoardScrap = () => {
export const useBoardScrap = (handleModalOpen: () => void) => {
const userItem = localStorage.getItem('user');
const userData = userItem ? JSON.parse(userItem) : null;
const userId = userData?.accessToken || null;
Expand Down Expand Up @@ -39,6 +39,7 @@ export const useBoardScrap = () => {
if (context?.previousBoardList) {
queryClient.setQueryData(MYPAGE_QUERY_KEY.MY_FAVORITE_POST_LIST(userId), context.previousBoardList);
}
handleModalOpen();
},
onSettled: () => {
// 서버 동기화를 위해 캐시 무효화
Expand Down
142 changes: 142 additions & 0 deletions src/assets/svgs/Group2085665069.tsx

Large diffs are not rendered by default.

35 changes: 16 additions & 19 deletions src/assets/svgs/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
export { default as BlurLeft } from './BlurLeft';
export { default as Ellipse5276 } from './Ellipse5276';
export { default as Frame2087327349 } from './Frame2087327349';
export { default as Group2085664966 } from './Group2085664966';
export { default as Group2085665069 } from './Group2085665069';
export { default as ImgBanner } from './ImgBanner';
export { default as KakaoVector } from './KakaoVector';
export { default as LeftBlur } from './LeftBlur';
export { default as NotFill } from './NotFill';
export { default as PlusImg } from './PlusImg';
export { default as Rectangle161126186 } from './Rectangle161126186';
export { default as RightBlur } from './RightBlur';
export { default as Union } from './Union';
export { default as Backcards } from './Backcards';
export { default as Bigtext } from './Bigtext';
export { default as BlurLeft } from './BlurLeft';
export { default as BtnWritingArrowleft } from './BtnWritingArrowleft';
export { default as BtnWritingChipx56 } from './BtnWritingChipx56';
export { default as BtnWritingChipxIcon } from './BtnWritingChipxIcon';
Expand All @@ -12,18 +24,15 @@ export { default as CardPopList3 } from './CardPopList3';
export { default as CardPopList4 } from './CardPopList4';
export { default as CardPopList5 } from './CardPopList5';
export { default as DividerCommunityCmt } from './DividerCommunityCmt';
export { default as Ellipse5276 } from './Ellipse5276';
export { default as Frame2087327349 } from './Frame2087327349';
export { default as Free } from './Free';
export { default as Group2085664966 } from './Group2085664966';
export { default as Half } from './Half';
export { default as IcAddimgGray344 } from './IcAddimgGray344';
export { default as IcAlarmBlack24 } from './IcAlarmBlack24';
export { default as IcArrowDownBlack24Copy } from './IcArrowDownBlack24Copy';
export { default as IcArrowDownBlack24 } from './IcArrowDownBlack24';
export { default as IcArrowLeftBlack32 } from './IcArrowLeftBlack32';
export { default as IcArrowRightupWhite24 } from './IcArrowRightupWhite24';
export { default as IcArrowRightGray20 } from './IcArrowRightGray20';
export { default as IcArrowRightupWhite24 } from './IcArrowRightupWhite24';
export { default as IcBookmark } from './IcBookmark';
export { default as IcBookmark32 } from './IcBookmark32';
export { default as IcBookmarkGray24Dact } from './IcBookmarkGray24Dact';
Expand All @@ -50,18 +59,16 @@ export { default as IcToolcardPaid20 } from './IcToolcardPaid20';
export { default as IcToolcardPartiallypaid20 } from './IcToolcardPartiallypaid20';
export { default as IcWatchWhite40 } from './IcWatchWhite40';
export { default as Img } from './Img';
export { default as ImgBanner } from './ImgBanner';
export { default as ImgDetailFreetool98 } from './ImgDetailFreetool98';
export { default as ImgBannerAttached } from './ImgBannerAttached';
export { default as ImgDarudalogo40 } from './ImgDarudalogo40';
export { default as ImgDarudalogo50 } from './ImgDarudalogo50';
export { default as ImgModalcheck } from './ImgModalcheck';
export { default as ImgModalexit } from './ImgModalexit';
export { default as ImgModalexit2 } from './ImgModalexit2';
export { default as ImgPopupDelete84 } from './ImgPopupDelete84';
export { default as ImgPopupLogoutcheck84 } from './ImgPopupLogoutcheck84';

export { default as ImgPopupLogout84 } from './ImgPopupLogout84';

export { default as ImgPopupLogoutcheck84 } from './ImgPopupLogoutcheck84';
export { default as ImgPopupNonebookmark120 } from './ImgPopupNonebookmark120';
export { default as ImgPopupNonebookmarkMypost } from './ImgPopupNonebookmarkMypost';
export { default as ImgPopupNonebookmarkScrappost } from './ImgPopupNonebookmarkScrappost';
Expand All @@ -72,16 +79,6 @@ export { default as ImgSymbollogo } from './ImgSymbollogo';
export { default as ImgTextlogo } from './ImgTextlogo';
export { default as ImgTextlogo177 } from './ImgTextlogo177';
export { default as ImgUploadWhite48 } from './ImgUploadWhite48';

export { default as ImgDetailFreetool98 } from './ImgDetailFreetool98';
export { default as IsBooked } from './IsBooked';
export { default as KakaoVector } from './KakaoVector';
export { default as LeftBlur } from './LeftBlur';
export { default as NotFill } from './NotFill';

export { default as Paid } from './Paid';
export { default as PlusImg } from './PlusImg';
export { default as Rectangle161126186 } from './Rectangle161126186';
export { default as RightBlur } from './RightBlur';
export { default as Tooltip } from './Tooltip';
export { default as Union } from './Union';
3 changes: 0 additions & 3 deletions src/components/common/banner/ToolListBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ const ToolListBanner = ({ originTool, forCommunity = false, onToolSelect = () =>
isFree: false,
selectedTool: originTool?.toolId,
selectedCategory: originTool.toolName,
tools: originTool
? [{ toolId: originTool.toolId as number, toolName: originTool.toolName, toolLogo: originTool.toolLogo }]
: [],
}));
}
}, [originTool]);
Expand Down
8 changes: 6 additions & 2 deletions src/components/common/postCard/PostCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const Card = forwardRef<HTMLLIElement, CardDataProp>((props, ref) => {
const [clickedIdx, setClickedIdx] = useState(0);
const [isWarning, setIsWarning] = useState(false);
const [isImgModalOpen, setIsImgModalOpen] = useState(false);
const { isSuccess: isBookMarkSuccess, mutate: srapMutate } = useBoardScrap();
const { isSuccess: isBookMarkSuccess, mutate: srapMutate } = useBoardScrap(handleToastOpen);
const [isClicked, setIsClicked] = useState(isScraped);

useEffect(() => {
Expand Down Expand Up @@ -71,9 +71,13 @@ const Card = forwardRef<HTMLLIElement, CardDataProp>((props, ref) => {
srapMutate(boardId);
if (isBookMarkSuccess) {
setIsClicked((prev) => !prev);
} else {
}

const postOwner = localStorage.getItem('user');
if (postOwner == null || postOwner == undefined) {
handleWarnnig();
}

handleToastOpen();
};

Expand Down
2 changes: 1 addition & 1 deletion src/pages/community/Community.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const Community = () => {
<S.CommunityContainer>
<ToolListBanner forCommunity={true} onToolSelect={handleToolSelect} originTool={initialTool} />
<S.CardList>
{postList && postList.length > 1
{postList && postList.length >= 1
? postList?.map((post) => <Card key={`community-post-${post.boardId}`} post={post} />)
: !isLoading && (
<S.NonTool>
Expand Down
6 changes: 3 additions & 3 deletions src/pages/community/components/banner/Banner.styles.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ImgBannerAttached } from '@assets/svgs';
import { Group2085665069 } from '@assets/svgs';
import styled from '@emotion/styled';

export const BannerWrapper = styled.section`
Expand All @@ -10,8 +10,7 @@ export const BannerWrapper = styled.section`
background: ${({ theme }) => theme.colors.orange1};
`;

export const MainImgBanner = styled(ImgBannerAttached)`
width: 51.4rem;
export const MainImgBanner = styled(Group2085665069)`
margin: 2.6rem 0 0 21.6rem;
`;

Expand All @@ -23,6 +22,7 @@ export const BannerContainer = styled.div`
justify-content: center;
padding: 5.2rem 0 5.2rem 6.4rem;
`;

export const BannerTitle = styled.h1`
${({ theme }) => theme.fonts.body_20_b};
color: ${({ theme }) => theme.colors.white1};
Expand Down
12 changes: 7 additions & 5 deletions src/pages/signUp/apis/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ const signup = async (requestBody: SignupRequest): Promise<void> => {
// 성공 응답 처리
const data = response.data;

// 토큰 가져오기
localStorage.getItem(data.jwtTokenResponse.accessToken);
localStorage.getItem(data.jwtTokenResponse.refreshToken);
localStorage.getItem(data.email);
localStorage.getItem(data.nickname);
const user = {
accessToken: data.jwtTokenResponse.accessToken,
refreshToken: data.jwtTokenResponse.refreshToken,
nickname: data.nickname,
email: data.email,
};
localStorage.setItem('user', JSON.stringify(user));

alert('회원가입 성공! 메인 페이지로 이동합니다.');
window.location.href = '/';
Expand Down

0 comments on commit a9f56c3

Please sign in to comment.