Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…nto feat
  • Loading branch information
naraeng committed Feb 17, 2025
2 parents e213c37 + a8a8ec3 commit 250e12e
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 52 deletions.
18 changes: 14 additions & 4 deletions src/component/admin/EditPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,18 @@ export default function EditPage() {
},
});
console.log('setClub', response.data.data);

setClub(response.data.data);
setIntroCount(response.data.data.introduction.length);
setClubInfo(response.data.data.clubInfo);
setActiCount(response.data.data.clubInfo.activity.length);
{
response.data.data.clubInfo.activity !== null && response.data.data.clubInfo.activity.length > 0
? setActiCount(response.data.data.clubInfo.activity.length)
: setActiCount(0);
}

setImageUrl(response.data.data.imageUrl);
console.log('imageurl', imageUrl);
const clubID = response.data.data.clubId;
const intClubID = parseInt(clubID);
setClubId(clubID);
Expand All @@ -99,6 +106,7 @@ export default function EditPage() {
useEffect(() => {
getAdminClub();
}, []);
console.log('img', imageUrl);

const handleFileChange = async (event) => {
const file = event.target.files[0];
Expand All @@ -108,6 +116,7 @@ export default function EditPage() {
setImagePreview(URL.createObjectURL(file));
setExtension(file.name.split('.').pop().toUpperCase()); // 확장자 추출
};
console.log('ima', imageUrl);

const deleteImage = async () => {
if (!imageUrl) return;
Expand Down Expand Up @@ -149,7 +158,7 @@ export default function EditPage() {
}
);

setImageUrl(data.data.imageKey);
console.log('presignedUrl', data);

// 이미지 파일을 presigned URL로 업로드
await axios.put(data.data.presignedUrl, imageFile, {
Expand All @@ -158,7 +167,8 @@ export default function EditPage() {
},
});
patchEditClub(data.data.imageKey);
console.log('imagefile', imageFile);
setImageUrl(data.data.imageKey);
console.log('imagefile', imageUrl);
} catch (error) {
console.error('이미지 업로드 실패:', error);
alert('이미지 업로드에 실패했습니다.');
Expand Down Expand Up @@ -187,7 +197,7 @@ export default function EditPage() {
},
}
);
// console.log('res', response);
console.log('res', response);
setIsModalOpen(true);
} catch (error) {
console.log(error);
Expand Down
43 changes: 20 additions & 23 deletions src/component/recruit/RecruitList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,31 +49,28 @@ export default function RecruitList() {

return (
<>
<div className={styles.title}>모집글</div>
<div className={styles.recruit_container}>
{PromoteData?.map((item) => (
<div
className={styles.recruit_box}
key={item.recruitId}
onClick={() => onClickRecruit(item.recruitId)}
>
{item.title !== " " && item.content !== " " && (
<div className={styles.recruit_div}>
<p className={styles.recruit_title}>{item.title}</p>
<p className={styles.recruit_text}>{item.content}</p>
<div className={styles.recruit_list_total_div}>
<div className={styles.title}>모집글</div>
<div className={styles.recruit_container}>
{PromoteData?.map((item) => (
<div
className={styles.recruit_box}
key={item.recruitId}
onClick={() => onClickRecruit(item.recruitId)}
>
{item.title !== ' ' && item.content !== ' ' && (
<div className={styles.recruit_div}>
<p className={styles.recruit_title}>{item.title}</p>
<p className={styles.recruit_text}>{item.content}</p>
</div>
)}
{item.imageUrl && (
<img src={item.imageUrl} className={styles.recruit_logo} alt="recruit logo" />
)}
</div>
)}
{item.imageUrl && (
<img
src={item.imageUrl}
className={styles.recruit_logo}
alt="recruit logo"
/>
)}
</div>
))}
))}
</div>
</div>

<ReactPaginate
previousLabel={'<'}
nextLabel={'>'}
Expand Down
3 changes: 3 additions & 0 deletions src/component/recruit/recruitList.module.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
@media screen and (min-width: 768px) {
.recruit_list_total_div {
min-height: 150%;
}
.title {
font-family: Noto Sans;
font-size: 26px;
Expand Down
58 changes: 40 additions & 18 deletions src/component/search/search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,24 +67,46 @@ function Search() {

const renderData = (data) => {
const rows = [];
for (let i = 0; i < data.length; i += 4) {
const rowItems = data.slice(i, i + 4);
rows.push(
<div className={styles.container} key={i}>
{rowItems.map((club) => (
<SearchClub
key={club.clubId}
clubId={club.clubId}
imageUrl={club.imageUrl}
clubName={club.clubName}
introduction={club.introduction}
division={club.division}
department={club.department}
agreeToProvideInfo={club.agreeToProvideInfo}
/>
))}
</div>
);
if (window.innerWidth <= 768) {
for (let i = 0; i < data.length; i += 2) {
const rowItems = data.slice(i, i + 2);
rows.push(
<div className={styles.container} key={i}>
{rowItems.map((club) => (
<SearchClub
key={club.clubId}
clubId={club.clubId}
imageUrl={club.imageUrl}
clubName={club.clubName}
introduction={club.introduction}
division={club.division}
department={club.department}
agreeToProvideInfo={club.agreeToProvideInfo}
/>
))}
</div>
);
}
} else {
for (let i = 0; i < data.length; i += 4) {
const rowItems = data.slice(i, i + 4);
rows.push(
<div className={styles.container} key={i}>
{rowItems.map((club) => (
<SearchClub
key={club.clubId}
clubId={club.clubId}
imageUrl={club.imageUrl}
clubName={club.clubName}
introduction={club.introduction}
division={club.division}
department={club.department}
agreeToProvideInfo={club.agreeToProvideInfo}
/>
))}
</div>
);
}
}
return rows;
};
Expand Down
4 changes: 2 additions & 2 deletions src/component/search/search.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@
display: flex;
justify-content: center;
align-items: center;
padding-top: 20px;
padding-bottom: 20px;
/* padding-top: 20px; */
padding-bottom: 5%;
}

.warning_container {
Expand Down
13 changes: 11 additions & 2 deletions src/component/search/searchClub.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,22 @@
@media screen and (max-width: 769px) {
.rectangle {
position: relative;
width: 20%;
height: 21.6%;
width: 162px;
height: 210px;
border-radius: 10px;
background: #ffffff;
border: 1px solid #d9d9d9;
box-shadow: 0px 0px 5px 0px #00000033;
margin: 10px;
cursor: pointer;
}
.rectangle h3 {
background: #ffffff;
}

.rectangle p {
background: transparent;
}
.image {
width: 100%;
border-radius: 10px 10px 0px 0px;
Expand All @@ -93,6 +100,7 @@
font-weight: 600;
text-align: left;
padding: 0 0 0 3%;
border-radius: 10px;
}
.content {
width: 100%;
Expand All @@ -106,6 +114,7 @@
text-overflow: ellipsis;
white-space: nowrap;
overflow-y: auto;
border-radius: 10px;
}
.department {
font-family: Noto Sans KR;
Expand Down
6 changes: 3 additions & 3 deletions src/pages/detailPage.css
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
display: flex;
flex-direction: row;
align-items: center;
width: 80%;
width: 90%;
height: 150px;
justify-content: flex-start;
margin-top: 10px;
Expand Down Expand Up @@ -324,7 +324,7 @@
flex-direction: row;
align-items: center;
justify-content: space-evenly;
width: 70%;
width: 80%;
height: 36px;
background-color: #7bc8e04d;
}
Expand All @@ -333,7 +333,7 @@
display: flex;
flex-direction: column;
align-items: left;
width: 70%;
width: 80%;
margin: 2.5% 0 15% 0;
}

Expand Down

0 comments on commit 250e12e

Please sign in to comment.