Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/#20/senior-to-junior' in…
Browse files Browse the repository at this point in the history
…to origin/feat/Competition/#23
  • Loading branch information
ftery0 committed Aug 20, 2024
2 parents 6e8e072 + 064f3d2 commit f1e697e
Show file tree
Hide file tree
Showing 10 changed files with 832 additions and 40 deletions.
4 changes: 4 additions & 0 deletions src/assets/imgs/markdown/deletetbn.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions src/components/common/page/index.style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import styled from "styled-components";

export const PaginationWrapper = styled.div`
display: flex;
justify-content: center;
align-items: center;
padding: 10px 0;
list-style-type: none;
button {
padding: 10px;
margin: 0 5px;
background: none;
border: none;
cursor: pointer;
font-size: 16px;
color: #777;
&:disabled {
color: #e0e0e0;
cursor: not-allowed;
}
}
.page-number {
padding: 10px;
margin: 0 5px;
cursor: pointer;
border-radius: 50%;
width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
color: #FFF;
font-family: 'Inter', sans-serif;
font-size: 16px;
font-style: normal;
font-weight: 700;
line-height: normal;
/* background-color: #555; */
color: #000;
&.active {
background-color: #0D6B23;
color: white;
}
}
`;
42 changes: 42 additions & 0 deletions src/components/common/page/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import React from 'react'
import * as S from 'src/components/common/page/index.style';

interface PaginationProps {
currentPage: number;
totalPages: number;
displayTotalPages: number;
onNextPage: () => void;
onPrevPage: () => void;
onPageClick: (page: number) => void;
}

const Pagination: React.FC<PaginationProps> = ({
currentPage,
totalPages,
displayTotalPages,
onNextPage,
onPrevPage,
onPageClick,
}) => {
return (
<S.PaginationWrapper>
<button onClick={onPrevPage} disabled={currentPage === 1}>
&larr;
</button>
{[...Array(displayTotalPages)].map((_, index) => (
<div
key={index}
className={`page-number ${currentPage === index + 1 ? 'active' : ''}`}
onClick={() => onPageClick(index + 1)}
>
{index + 1}
</div>
))}
<button onClick={onNextPage} disabled={currentPage === displayTotalPages}>
&rarr;
</button>
</S.PaginationWrapper>
);
};

export default Pagination;
4 changes: 2 additions & 2 deletions src/components/common/sidebar/index.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ export const MenuItem = styled.div<MenuItemProps>`
`;

export const MenuIcon = styled.img`
width: 14px;
height: 14px;
width: 24px;
height: 24px;
`;

export const MenuText = styled.span`
Expand Down
8 changes: 1 addition & 7 deletions src/components/home/markdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ const MarkdownEditor = () => {

const handleBackArrowClick = () => {
const path = location.pathname.split('/')[1];
if (path === 'portfolio') {
navigate('/portfolio');
} else if (path === 'seniortojunior') {
if (path === 'seniortojunior') {
navigate('/seniortojunior');
} else if (path === 'contest') {
navigate('/contest');
Expand All @@ -55,8 +53,6 @@ const MarkdownEditor = () => {
const getPageTitle = () => {
const path = location.pathname.split('/')[1];
switch (path) {
case 'portfolio':
return '포트폴리오';
case 'seniortojunior':
return '선배가 후배에게';
case 'contest':
Expand All @@ -69,8 +65,6 @@ const MarkdownEditor = () => {
const getPageIcon = () => {
const path = location.pathname.split('/')[1];
switch (path) {
case 'portfolio':
return Portfolio;
case 'seniortojunior':
return MentoMenti;
case 'contest':
Expand Down
Loading

0 comments on commit f1e697e

Please sign in to comment.