-
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 #95 from Clubber2024/feat/recruit-content-page
feat: 개별 모집글 페이지 및 페이징 css 수정
- Loading branch information
Showing
15 changed files
with
683 additions
and
139 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
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,55 @@ | ||
import styles from './adminRecruitList.module.css'; | ||
import { customAxios } from '../../../config/axios-config'; | ||
import { useEffect, useState } from 'react'; | ||
|
||
export default function AdminRecruitList() { | ||
const [PromoteData, setPromoteData] = useState([]); | ||
const [currentPage, setCurrentPage] = useState(1); | ||
const [totalPages, setTotalPages] = useState(0); | ||
const [pageSize, setPageSize] = useState(1); // 한 페이지에 표시할 항목 수 | ||
const [sort, setSort] = useState(['string']); // 정렬 기준 | ||
|
||
useEffect(() => { | ||
getPromoteData(currentPage); | ||
}, [currentPage]); | ||
|
||
const getPromoteData = async (page) => { | ||
try { | ||
const res = await customAxios.get(`/v1/admins/recruits`, { | ||
params: { | ||
page: page, | ||
size: pageSize, | ||
//sort: sort, | ||
}, | ||
}); | ||
if (res.data.success) { | ||
setPromoteData(res.data.data.content); | ||
setTotalPages(res.data.pagination.totalPages); | ||
console.log(res.data.data); | ||
} | ||
} catch (error) { | ||
console.error('Error fetching data : ', error); | ||
} | ||
}; | ||
|
||
const handlePageChange = (newPage) => { | ||
setCurrentPage(newPage); | ||
}; | ||
|
||
return ( | ||
<> | ||
<div className={styles.title}>모집글</div> | ||
<div className={styles.recruit_container} key={PromoteData.recruitId}> | ||
{PromoteData?.map((item) => ( | ||
<div className={styles.recruit_box}> | ||
<img src={item.images} alt="club_logo" className={styles.recruit_logo} /> | ||
<div className={styles.recruit_div}> | ||
<p className={styles.recruit_title}>{item.title}</p> | ||
<p className={styles.recruit_text}>{item.content}</p> | ||
</div> | ||
</div> | ||
))} | ||
</div> | ||
</> | ||
); | ||
} |
Oops, something went wrong.