Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 마이페이지 서브메뉴 탭 컴포넌트 생성 #6

Merged
merged 3 commits into from
Sep 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions public/img/MypageSubmenuIcons/logoutIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/img/MypageSubmenuIcons/myCommentIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions public/img/MypageSubmenuIcons/myQnaIcon.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: 3 additions & 0 deletions public/img/MypageSubmenuIcons/myScrapIcon.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: 3 additions & 0 deletions public/img/MypageSubmenuIcons/newsLetterIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/img/arrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 16 additions & 8 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import { CommentListBox } from 'components/Mypage/CommentListBox';
import { MyQnaListBox } from 'components/Mypage/MyQnaListBox';
import { ScrapListBox } from 'components/Mypage/ScrapListBox';
import { Waitingtab } from 'components/Mypage/WaitingTab';
import { SubMenuBox } from 'components/Mypage/SubMenuBox';
import React from 'react';

function App() {
Expand All @@ -14,10 +11,21 @@ function App() {
gap: 30,
}}
>
<Waitingtab />
<CommentListBox />
<ScrapListBox />
<MyQnaListBox />
<SubMenuBox count={5} icon="myQnaIcon">
내 질문
</SubMenuBox>
<SubMenuBox count={5} icon="myCommentIcon">
내 댓글
</SubMenuBox>
<SubMenuBox count={5} icon="myScrapIcon">
스크랩
</SubMenuBox>
<SubMenuBox count={-1} icon="newsLetterIcon">
뉴스레터 구독
</SubMenuBox>
<SubMenuBox count={-1} icon="logoutIcon">
로그아웃
</SubMenuBox>
</div>
);
}
Expand Down
3 changes: 2 additions & 1 deletion src/assets/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ export const Column = styled.div<{
export const MyPageBoxContainer = styled.div<{
height?: string;
padding?: string;
borderRadius?: number;
}>`
display: flex;
width: 100%;
height: ${({ height }) => (height ? height : 'fit-content')};
border-radius: 5px;
border-radius: ${({ borderRadius }) => (borderRadius ? borderRadius : 5)}px;
padding: ${({ padding }) => (padding ? padding : 0)};
background: ${Palette.White};
box-shadow: 1px 1px 4px 0px rgba(0, 0, 0, 0.1);
Expand Down
40 changes: 40 additions & 0 deletions src/components/Mypage/SubMenuBox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { MyPageBoxContainer, Row } from 'assets/common';
import { Palette } from 'styles/Palette';
import Typo from 'styles/Typo';

export const SubMenuBox = ({
children,
count,
icon,
}: {
children: React.ReactNode;
count?: number;
icon: string;
}) => {
return (
<MyPageBoxContainer borderRadius={10} height="75px" padding="25px 15px">
<Row
alignItems="center"
justifyContent="space-between"
style={{ width: '100%' }}
>
<Row gap={19}>
<img src={`/img/MypageSubmenuIcons/${icon}.svg`}></img>
<Typo.b1>{children}</Typo.b1>
</Row>
<Row gap={8}>
{count !== -1 ? (
<Row gap={3}>
<Typo.b2 color={Palette.Main}>{count}</Typo.b2>
<Typo.b2 color={Palette.Gray4}>개</Typo.b2>
</Row>
) : (
<></>
)}

<img src="/img/arrow.svg" />
</Row>
</Row>
</MyPageBoxContainer>
);
};