Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
21 changes: 13 additions & 8 deletions src/components/common/sidebar/Sidebar.styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,17 @@ export const MenuList = styled.div`
width: 100%;
margin-top: 3rem;
`;
export const MenuItem = styled.div<{ $isActive: boolean }>`
display: flex;
export const MenuItem = styled.div<{
$isActive: boolean;
$isHidden?: boolean;
}>`
display: ${({ $isHidden }) => ($isHidden ? 'none' : 'flex')};
align-items: center;
padding: 0.625rem 1.25rem;
font-weight: 500;
color: #6d6d6d;
margin: 0.5rem 0;
background-color: ${({ $isActive }) =>
$isActive ? '#f9f9f9' : 'transparent'};

@media ${({ theme }) => theme.mediaQuery.tablet} {
font-size: 0.9rem;
}

&:hover {
background-color: #f9f9f9;
}
Expand All @@ -78,3 +75,11 @@ export const MenuItem = styled.div<{ $isActive: boolean }>`
export const IconWrapper = styled.div`
margin-right: 0.625rem;
`;
export const Label = styled.p`
font-weight: 500;
color: #6d6d6d;

@media ${({ theme }) => theme.mediaQuery.tablet} {
font-size: 0.9rem;
}
`;
22 changes: 14 additions & 8 deletions src/components/common/sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ interface MenuItem {
label: string;
path: string;
icon?: React.ReactNode;
isDone?: boolean;
}

interface SidebarProps {
Expand Down Expand Up @@ -47,14 +48,19 @@ const Sidebar = ({ menuItems, profileImage, nickname }: SidebarProps) => {
<span>{nickname ? nickname : ''}</span>
</S.AvartarContainer>
<S.MenuList>
{menuItems.map(({ label, path, icon }, index) => (
<NavLink key={path} to={path}>
<S.MenuItem $isActive={getActiveIndex() === index}>
{icon && <S.IconWrapper>{icon}</S.IconWrapper>}
{label}
</S.MenuItem>
</NavLink>
))}
{menuItems.map(({ label, path, icon, isDone = false }, index) => {
return (
<NavLink key={path} to={path}>
<S.MenuItem
$isActive={getActiveIndex() === index}
$isHidden={index === 2 && isDone}
>
{icon && <S.IconWrapper>{icon}</S.IconWrapper>}
{icon && <S.Label>{label}</S.Label>}
</S.MenuItem>
</NavLink>
);
})}
</S.MenuList>
</S.Container>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/manageProjects/CardList.styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styled from 'styled-components';
export const CardListWrapper = styled.div`
display: flex;
flex-wrap: wrap;
justify-content: center;
justify-content: start;
align-items: center;
gap: 20px;
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export const ItemWrapper = styled.li`
&:hover {
background-color: ${({ theme }) => theme.color.navy};
color: ${({ theme }) => theme.color.white};
transition: all 0.2s ease;
}

@media ${({ theme }) => theme.mediaQuery.tablet} {
Expand Down
3 changes: 2 additions & 1 deletion src/constants/sidebarItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
UserPlusIcon,
} from '@heroicons/react/24/outline';

export const applicantsMenuItems = (projectId: number) => {
export const applicantsMenuItems = (projectId: number, isDone?: boolean) => {
return [
{
label: '지원자 보기',
Expand All @@ -21,6 +21,7 @@ export const applicantsMenuItems = (projectId: number) => {
label: '공고 관리',
path: `${ROUTES.modifyProject}/${projectId}`,
icon: <PencilSquareIcon />,
isDone: isDone,
},
];
};
2 changes: 1 addition & 1 deletion src/mock/mockProjectDetail.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"authorId": 8,
"views": 1,
"isBeginner": true,
"isDone": false,
"isDone": true,
"recruitmentEndDate": "2025-02-15T00:00:00.000Z",
"recruitmentStartDate": "2025-01-06T00:00:00.000Z",
"createdAt": "2025-01-06T07:05:01.000Z",
Expand Down
60 changes: 60 additions & 0 deletions src/mock/mockProjectList.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,66 @@
"createdAt": "2025-01-06T21:19:21.000Z",
"updatedAt": "2025-01-06T21:19:21.000Z",
"ProjectSkillTag": [
{
"projectId": 68,
"skillTagId": 12,
"SkillTag": {
"id": 12,
"name": "Kotlin",
"img": "스킬 태그 이미지 주소",
"createdAt": "2025-01-02T15:09:19.000Z"
}
},
{
"projectId": 68,
"skillTagId": 12,
"SkillTag": {
"id": 12,
"name": "Kotlin",
"img": "스킬 태그 이미지 주소",
"createdAt": "2025-01-02T15:09:19.000Z"
}
},
{
"projectId": 68,
"skillTagId": 12,
"SkillTag": {
"id": 12,
"name": "Kotlin",
"img": "스킬 태그 이미지 주소",
"createdAt": "2025-01-02T15:09:19.000Z"
}
},
{
"projectId": 68,
"skillTagId": 12,
"SkillTag": {
"id": 12,
"name": "Kotlin",
"img": "스킬 태그 이미지 주소",
"createdAt": "2025-01-02T15:09:19.000Z"
}
},
{
"projectId": 68,
"skillTagId": 12,
"SkillTag": {
"id": 12,
"name": "Kotlin",
"img": "스킬 태그 이미지 주소",
"createdAt": "2025-01-02T15:09:19.000Z"
}
},
{
"projectId": 68,
"skillTagId": 12,
"SkillTag": {
"id": 12,
"name": "Kotlin",
"img": "스킬 태그 이미지 주소",
"createdAt": "2025-01-02T15:09:19.000Z"
}
},
{
"projectId": 68,
"skillTagId": 12,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const MyProjectVolunteersPass = () => {
handleModalOpen
);
const sidebarMenuItem = useMemo(
() => applicantsMenuItems(Number(projectId)),
[projectId]
() => applicantsMenuItems(Number(projectId), projectData?.isDone),
[projectId, projectData]
);

return (
Expand Down
4 changes: 2 additions & 2 deletions src/pages/manage/myProjectVolunteer/MyProjectVolunteer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ const MyProjectVolunteer = () => {
);

const sidebarMenuItem = useMemo(
() => applicantsMenuItems(Number(projectId)),
[projectId]
() => applicantsMenuItems(Number(projectId), projectData?.isDone),
[projectId, projectData]
);

const { applicantsData, isApplicantLoading } = useApllicantList(
Expand Down
Loading