-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #125 from MeeTeamNumdle/release-1.0
feat: 포트폴리오 관리 페이지 배포
- Loading branch information
Showing
15 changed files
with
268 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import styled from 'styled-components'; | ||
|
||
const TabMenuLayout = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
align-items: flex-end; | ||
`; | ||
|
||
const TabMenuList = styled.ul` | ||
display: flex; | ||
flex-direction: row; | ||
color: var(--State-unactive, var(--, #8e8e8e)); | ||
/* Body/body1/medium */ | ||
font-size: 1.6rem; | ||
font-weight: 500; | ||
line-height: 1.9rem; | ||
letter-spacing: 0.0032rem; | ||
`; | ||
|
||
const TabMenuItem = styled.li<{ $clicked?: boolean }>` | ||
display: flex; | ||
flex: 1; | ||
justify-content: center; | ||
align-items: center; | ||
width: 11.6rem; // width: clamp(45%, 11.6rem, 75%); | ||
height: 3.6rem; | ||
border-radius: 0.4rem 0.4rem 0rem 0rem; | ||
border: ${props => (props.$clicked ? '0.1rem solid #373f41' : '0.1rem solid #8E8E8E')}; | ||
border-bottom: ${props => (props.$clicked ? '0' : '0.1rem solid #373f41')}; | ||
background: ${props => !props.$clicked && '#F6F6F6'}; | ||
color: ${props => !props.$clicked && '#8E8E8E'}; | ||
cursor: pointer; | ||
`; | ||
|
||
const TabMenuLine = styled.hr` | ||
all: unset; | ||
display: flex; | ||
height: 0.1rem; | ||
background: #373f41; | ||
width: 100%; | ||
`; | ||
|
||
const S = { TabMenuLayout, TabMenuList, TabMenuItem, TabMenuLine }; | ||
|
||
export default S; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React, { useState } from 'react'; | ||
import S from './TabMenu.styled'; | ||
|
||
interface TabMenu { | ||
readonly tabList: string[]; | ||
} | ||
|
||
const TabMenu = ({ tabList }: TabMenu) => { | ||
const [tab, setTab] = useState(tabList[0]); | ||
|
||
const clickedHandler: React.MouseEventHandler<HTMLLIElement> = e => { | ||
const tab = e.target as HTMLButtonElement; | ||
if (!tab.textContent) { | ||
throw new Error('No Content'); | ||
} | ||
setTab(tab.textContent); | ||
}; | ||
|
||
return ( | ||
<S.TabMenuLayout> | ||
<S.TabMenuList> | ||
{tabList.map((currentTab, index) => ( | ||
<S.TabMenuItem onClick={clickedHandler} $clicked={currentTab === tab} key={index}> | ||
{currentTab} | ||
</S.TabMenuItem> | ||
))} | ||
</S.TabMenuList> | ||
<S.TabMenuLine /> | ||
</S.TabMenuLayout> | ||
); | ||
}; | ||
|
||
export default TabMenu; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
src/pages/portfolio/management/PortfolioManagementPage.styled.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import styled from 'styled-components'; | ||
|
||
const PortfolioManagementLayout = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
margin: 0 auto; | ||
// margin-bottom: 15rem; | ||
width: clamp(45%, 96rem, 75%); // width: 96rem; | ||
color: var(--Light-Black, #373f41); | ||
h2 { | ||
color: var(--Text-textColor1, #151515); | ||
/* Headline/h2 */ | ||
font-size: 2.4rem; | ||
font-weight: 700; | ||
line-height: 2.9rem; /* 120.833% */ | ||
letter-spacing: 0.0048rem; | ||
} | ||
`; | ||
|
||
const PortfolioManagementHeader = styled.header` | ||
display: flex; | ||
flex-direction: row; | ||
margin-top: 8rem; | ||
margin-bottom: 2rem; | ||
`; | ||
|
||
const PortfolioManagementGrid = styled.div` | ||
display: grid; | ||
// margin: 8rem 0; | ||
margin-top: 8rem; | ||
grid-template-columns: repeat(auto-fill, minmax(22.5rem, 1fr)); | ||
grid-auto-rows: minmax(12.7rem, auto); | ||
row-gap: 4rem; | ||
column-gap: 2rem; | ||
/* 스크롤바 숨기기 */ | ||
overflow-y: auto; | ||
-ms-overflow-style: none; /* IE and Edge */ | ||
scrollbar-width: none; /* Firefox */ | ||
&::-webkit-scrollbar { | ||
display: none; /* Chrome, Safari, Opera*/ | ||
`; | ||
|
||
const PortfolioManagementColumn = styled.div` | ||
position: fixed; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
left: 0; | ||
top: 0; | ||
width: 100%; | ||
height: 100%; | ||
color: var(--State-unactive, #8e8e8e); | ||
/* Headline/h3 */ | ||
font-size: 2rem; | ||
font-weight: 600; | ||
line-height: 2.4rem; /* 120% */ | ||
letter-spacing: 0.004rem; | ||
`; | ||
|
||
const S = { | ||
PortfolioManagementLayout, | ||
PortfolioManagementHeader, | ||
PortfolioManagementGrid, | ||
PortfolioManagementColumn, | ||
}; | ||
|
||
export default S; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import React, { useState } from 'react'; | ||
import S from './PortfolioManagementPage.styled'; | ||
import { Pagination, PortfolioCard, PrimaryBtn, TabMenu } from '../../../components'; | ||
import { useNavigate } from 'react-router-dom'; | ||
import { usePaginationPortfolioList } from '../../../hooks'; | ||
|
||
const tabList = ['전체']; | ||
|
||
const PortfolioManagementPage = () => { | ||
const navigate = useNavigate(); | ||
|
||
const [pageNumber, setPageNumber] = useState(1); | ||
const { data: portfolioList, isSuccess } = usePaginationPortfolioList(16, pageNumber); | ||
|
||
return ( | ||
isSuccess && ( | ||
<S.PortfolioManagementLayout> | ||
<S.PortfolioManagementHeader> | ||
<h2>포트폴리오</h2> | ||
<PrimaryBtn | ||
type='button' | ||
title='포트폴리오 작성' | ||
handleClick={() => navigate('/portfolio/edit')} | ||
/> | ||
</S.PortfolioManagementHeader> | ||
<TabMenu tabList={tabList} /> | ||
{!portfolioList?.portfolios.length ? ( | ||
<S.PortfolioManagementGrid> | ||
{portfolioList && | ||
portfolioList.portfolios?.map(portfolio => ( | ||
<PortfolioCard key={portfolio.id} {...portfolio} /> | ||
))} | ||
</S.PortfolioManagementGrid> | ||
) : ( | ||
<S.PortfolioManagementColumn>아직 작성한 포트폴리오가 없어요</S.PortfolioManagementColumn> | ||
)} | ||
<Pagination | ||
postsNum={portfolioList?.pageInfo.totalContents as number} | ||
postsPerPage={portfolioList?.pageInfo.size as number} | ||
currentPage={pageNumber} | ||
setCurrentPage={setPageNumber} | ||
/> | ||
</S.PortfolioManagementLayout> | ||
) | ||
); | ||
}; | ||
|
||
export default PortfolioManagementPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.