-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
252 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import { Card, CardContent, CardHeader, Stack, Typography } from '@mui/material' | ||
import Link from 'next/link' | ||
|
||
import { IJob } from '@/types/IJob' | ||
|
||
const JobCard = ({ title, writerName, createdAt, id }: IJob) => { | ||
return ( | ||
<Card | ||
sx={{ | ||
borderRadius: '0.75rem', | ||
borderWidth: '2px', | ||
borderStyle: 'solid', | ||
borderColor: 'background.tertiary', | ||
boxShadow: 'none', | ||
}} | ||
> | ||
<Link href={`/job/${id}`} style={{ textDecoration: 'none' }}> | ||
{/*<Box sx={{ position: 'relative' }}>*/} | ||
{/* <CuPhotoBox*/} | ||
{/* style={{*/} | ||
{/* width: '100%',*/} | ||
{/* height: '160px',*/} | ||
{/* position: 'relative',*/} | ||
{/* left: '-2px',*/} | ||
{/* top: '-2px',*/} | ||
{/* border: '2px solid',*/} | ||
{/* borderBottom: 'none',*/} | ||
{/* borderColor: 'background.tertiary',*/} | ||
{/* borderBottomLeftRadius: '0.75rem',*/} | ||
{/* borderBottomRightRadius: '0.75rem',*/} | ||
{/* }}*/} | ||
{/* src={undefined}*/} | ||
{/* alt="userImage"*/} | ||
{/* />*/} | ||
{/*</Box>*/} | ||
</Link> | ||
<CardHeader | ||
title={ | ||
<Typography | ||
variant="Body2" | ||
color="text.alternative" | ||
sx={{ | ||
display: '-webkit-box', | ||
WebkitLineClamp: 1, | ||
WebkitBoxOrient: 'vertical', | ||
overflow: 'hidden', | ||
textOverflow: 'ellipsis', | ||
}} | ||
> | ||
{writerName} | ||
</Typography> | ||
} | ||
/> | ||
<Link href={`/job/${id}`} style={{ textDecoration: 'none' }}> | ||
<CardContent | ||
sx={{ | ||
'&:last-child': { | ||
paddingBottom: '1rem !important', | ||
}, | ||
paddingY: 0, | ||
}} | ||
> | ||
<Stack> | ||
<Typography | ||
variant="Body1" | ||
color="text.normal" | ||
sx={{ | ||
overflow: 'hidden', | ||
textOverflow: 'ellipsis', | ||
display: '-webkit-box', | ||
WebkitBoxOrient: 'vertical', | ||
}} | ||
> | ||
{title} | ||
</Typography> | ||
<Typography variant="Body2" color="text.alternative"> | ||
{createdAt} | ||
</Typography> | ||
</Stack> | ||
</CardContent> | ||
</Link> | ||
</Card> | ||
) | ||
} | ||
|
||
export default JobCard |
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,108 @@ | ||
'use client' | ||
|
||
import { Container, Grid, Stack, Typography } from '@mui/material' | ||
import { containerStyle } from '@/app/panel/main-page/Mainpage.style' | ||
|
||
import NoDataDolphin from '@/components/NoDataDolphin' | ||
|
||
import { IPagination } from '@/types/IPagination' | ||
import { IJob } from '@/types/IJob' | ||
import JobCard from '@/app/job/JobCard' | ||
|
||
const data: IPagination<IJob[]> = { | ||
content: [ | ||
{ | ||
title: '6월의 인기 채용 공고', | ||
writerName: 'jujeon', | ||
createdAt: '2023-05-15', | ||
id: 1, | ||
}, | ||
{ | ||
title: '5월의 인기 채용 공고', | ||
writerName: 'jujeon', | ||
createdAt: '2023-06-01', | ||
id: 2, | ||
}, | ||
{ | ||
title: '4월의 인기 채용 공고', | ||
writerName: 'jujeon', | ||
createdAt: '2023-04-20', | ||
id: 3, | ||
}, | ||
// Add more IJob objects as needed | ||
], | ||
pageable: { | ||
sort: { | ||
empty: false, | ||
unsorted: false, | ||
sorted: true, | ||
}, | ||
offset: 0, | ||
pageNumber: 0, | ||
pageSize: 10, | ||
paged: true, | ||
unpaged: false, | ||
}, | ||
totalPages: 1, | ||
totalElements: 3, | ||
last: true, | ||
size: 10, | ||
number: 0, | ||
sort: { | ||
empty: false, | ||
unsorted: false, | ||
sorted: true, | ||
}, | ||
numberOfElements: 3, | ||
first: true, | ||
empty: false, | ||
} | ||
|
||
const JobInfo = () => { | ||
// const { data, isLoading, error } = useSWR<IPagination<IJob[]>>( | ||
// `${process.env.NEXT_PUBLIC_CSR_API}/api/v1/job?page=1&pageSize=10`, | ||
// defaultGetFetcher, | ||
// ) | ||
// const noContent = !isLoading | ||
// ? error | ||
// ? '에러 발생' | ||
// : data?.content?.length == 0 | ||
// ? '데이터가 없습니다' | ||
// : null | ||
// : null | ||
|
||
return ( | ||
<Container sx={containerStyle}> | ||
<Stack mt={'1rem'} mb={'0.5rem'} spacing={4}> | ||
<Typography variant={'Title1'} color={'text.strong'}> | ||
채용 공고 | ||
</Typography> | ||
</Stack> | ||
<Stack direction={'row'} spacing={4}> | ||
{data?.content.length === 0 ? ( | ||
<Stack | ||
width={'100%'} | ||
height={'100%'} | ||
justifyContent={'center'} | ||
alignItems={'center'} | ||
> | ||
<NoDataDolphin | ||
message={'데이터가 없습니다.'} | ||
backgroundColor={'background.primary'} | ||
/> | ||
</Stack> | ||
) : ( | ||
<Grid container spacing={'1rem'}> | ||
{data?.content?.map((job: IJob) => ( | ||
<Grid item key={job.id} sm={12} md={6} lg={4}> | ||
<JobCard {...job} /> | ||
</Grid> | ||
))} | ||
</Grid> | ||
)} | ||
</Stack> | ||
</Container> | ||
) | ||
} | ||
|
||
export default JobInfo |
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,10 @@ | ||
export interface IJob { | ||
title: string | ||
writerName: string | ||
createdAt: string | ||
id: number | ||
} | ||
|
||
export interface IJobDetail extends IJob { | ||
content: string | ||
} |