Skip to content

Commit

Permalink
๐Ÿ”€ Add Postpage Myapplication modal
Browse files Browse the repository at this point in the history
#262 ๊ณต๊ณ  ์ƒ์„ธํŽ˜์ด์ง€ ๋‚˜์˜ ์ง€์›์„œ๋ณด๊ธฐ ์ž„์‹œ ๋ชจ๋‹ฌ ์ถ”๊ฐ€
  • Loading branch information
sseuldev authored Sep 27, 2024
2 parents bca67af + e0d77c7 commit dcd5e43
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 56 deletions.
7 changes: 3 additions & 4 deletions gongjakso/src/features/modal/ApplyModal.styled.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,12 @@ export const MainTitle = styled.div`
font-size: 1.5rem;
font-family: 'PreBold';
letter-spacing: 0.5px;
margin-bottom: 30px;
margin-bottom: 1rem;
`;

// ํ…์ŠคํŠธ ์ „์ฒด ํ‹€
export const DetailBox = styled.div`
padding: 15px;
margin-top: 0.8rem;
position: relative;
`;

Expand All @@ -63,7 +62,7 @@ export const DetailBox2 = styled.div`
`;

export const SubTitle = styled.p`
font-size: ${({ theme }) => theme.fontSize.l};
font-size: ${({ theme }) => theme.fontSize.lg};
font-family: 'PreBold';
`;

Expand Down Expand Up @@ -191,7 +190,7 @@ export const ApplyBtn = styled.button`
border-radius: 10px;
margin: 15px;
padding: 13px;
font-size: ${({ theme }) => theme.fontSize.m};
font-size: ${({ theme }) => theme.fontSize.md};
background: ${({ theme }) => theme.box1};
font-family: 'PreBold';
color: white;
Expand Down
99 changes: 53 additions & 46 deletions gongjakso/src/features/modal/ClickmyApply.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import * as S from './ApplyModal.styled';
import Close from '../../assets/images/Close.svg';
import { useEffect, useState } from 'react';
import { getMyApplication } from '../../service/apply_service';
import { getMyPortfolio } from '../../service/post_service';

const ClickmyApply = props => {
const [myApp, setmyApp] = useState([]);
const [category, setCategory] = useState([]);
const [stackCategory, setstackCategory] = useState([]);
const [portfolioData, setportfolioData] = useState([]);

// ์Šคํฌ๋กค ๋ฐฉ์ง€
useEffect(() => {
Expand All @@ -23,13 +23,17 @@ const ClickmyApply = props => {
}, []);

useEffect(() => {
getMyApplication(props.id).then(res => {
getMyApplication(props.applyId).then(res => {
setmyApp(res?.data);
setCategory(res?.data.category);
setstackCategory(res?.data.postStack);
// console.log(res?.data);
});
}, [props.id]);

// [GET] ๋‚ด ํฌํŠธํด๋ฆฌ์˜ค ๋ฆฌ์ŠคํŠธ ์กฐํšŒ API
getMyPortfolio().then(res => {
setportfolioData(res?.data);
});
}, [props.applyId]);

// console.log(portfolioData);

return (
<div>
Expand All @@ -44,65 +48,68 @@ const ClickmyApply = props => {
</S.Backbtn>

<S.MainTitle>
<p>{myApp?.memberName}</p>
<S.Major>{myApp?.major}</S.Major>
<p>{myApp?.applicant_name}</p>
<S.Major>{myApp?.applicant_phone}</S.Major>
<S.Major>{myApp?.applicant_major}</S.Major>
</S.MainTitle>
<S.DetailBox>
<S.SubTitle>์ง€์› ๋ถ„์•ผ</S.SubTitle>
<S.FormBox>
{category.map((item, i) => (
{myApp?.recruit_part?.map((item, i) => (
<S.RoundForm
key={i}
$isselected={item === myApp?.recruitPart}
$isselected={
item.position === myApp?.apply_part
}
style={{ cursor: 'default' }}
>
{item === 'PLAN' && '๊ธฐํš'}
{item === 'DESIGN' && '๋””์ž์ธ'}
{item === 'FE' && 'ํ”„๋ก ํŠธ์—”๋“œ'}
{item === 'BE' && '๋ฐฑ์—”๋“œ'}
{item === 'ETC' && '๊ธฐํƒ€'}
{item === 'LATER' && '์ถ”ํ›„์กฐ์ •'}
{item.position}
</S.RoundForm>
))}
</S.FormBox>
</S.DetailBox>

{/* ํ”„๋กœ์ ํŠธ์˜ ๊ฒฝ์šฐ */}
{props.type === true && (
<S.DetailBox>
<S.SubTitle>๊ธฐ์ˆ  ์Šคํƒ</S.SubTitle>
<S.FormBox>
{stackCategory.map((item, i) => (
<S.RoundForm
<S.DetailBox>
<S.SubTitle>๋‚˜์˜ ํฌํŠธํด๋ฆฌ์˜ค</S.SubTitle>
{/* <S.FormBox>
<S.RoundForm
$isselected={true}
style={{ cursor: 'default' }}
>
{myApp?.is_private
? '๋น„๊ณต๊ฐœ'
: myApp?.portfolio_name}
</S.RoundForm>
</S.FormBox> */}
<S.FormBox>
{myApp?.is_private ? (
<S.RoundForm
$isselected={true}
style={{ cursor: 'default' }}
>
๋น„๊ณต๊ฐœ
</S.RoundForm>
) : (
portfolioData?.map((item, i) => (
<S.PortForm
key={i}
$isselected={myApp?.applyStack.includes(
item,
)}
$isselected={
item.PortfolioName ===
myApp?.portfolio_name
}
style={{ cursor: 'default' }}
>
{item === 'REACT' && 'React'}
{item === 'TYPESCRIPT' && 'TypeScript'}
{item === 'JAVASCRIPT' && 'JavaScript'}
{item === 'NEXTJS' && 'Next.js'}
{item === 'NODEJS' && 'Node.js'}
{item === 'JAVA' && 'Java'}
{item === 'SPRING' && 'Spring'}
{item === 'KOTLIN' && 'Kotlin'}
{item === 'SWIFT' && 'Swift'}
{item === 'FLUTTER' && 'Flutter'}
{item === 'ETC' && 'etc'}
</S.RoundForm>
))}
</S.FormBox>
</S.DetailBox>
)}
{item.PortfolioName}
</S.PortForm>
))
)}
</S.FormBox>
</S.DetailBox>

<S.DetailBox2>
<S.SubTitle>์ง€์› ์ด์œ </S.SubTitle>
<S.TextBox>
<S.Content $h="220px">
{myApp?.application}
</S.Content>
<S.Content $h="200px">{myApp?.body}</S.Content>
</S.TextBox>
</S.DetailBox2>
</S.Modal>
Expand Down
2 changes: 1 addition & 1 deletion gongjakso/src/features/modal/Completed.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const Completed = props => {
<S.Background2>
<S.Modal
$w="700px"
$h="460px"
$h="400px"
$bc={({ theme }) => theme.box1}
>
<S.MainTitle>'{props.title}' ํŒ€ ์ง€์›ํ•˜๊ธฐ</S.MainTitle>
Expand Down
8 changes: 6 additions & 2 deletions gongjakso/src/pages/DetailPage/DetailPageContest.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,11 @@ const DetailPageContest = () => {
return (
<>
{myAppOpen ? (
<ClickmyApply id={postId} setOpen={setmyAppOpen} type={false} />
<ClickmyApply
applyId={userId}
setOpen={setmyAppOpen}
type={false}
/>
) : null}

{/* ์ง€์›ํ•˜๊ธฐ ๋ชจ๋‹ฌ */}
Expand Down Expand Up @@ -306,7 +310,7 @@ const DetailPageContest = () => {

<S.ApplyBtn
onClick={() => {
// setmyAppOpen(true);
setmyAppOpen(true);
}}
>
์ง€์›์„œ ๋ณด๊ธฐ
Expand Down
9 changes: 6 additions & 3 deletions gongjakso/src/service/apply_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,20 @@ export const patchOpen = async apply_id => {
}
};

export const getMyApplication = async postid => {
const reqURL = `apply/my/${postid}`;
// [GET] ๋‚˜์˜ ์ง€์›์„œ ๋ณด๊ธฐ API
export const getMyApplication = async apply_id => {
const reqURL = `apply/${apply_id}`;

try {
const response = await axiosInstance.get(reqURL);
const response = await axiosInstanceV2.get(reqURL);
console.log(response);
return response.data;
} catch (error) {
console.log(error);
}
};

// [DELETE] ๊ณต๊ณ  ์ƒ์„ธํŽ˜์ด์ง€ ์ง€์› ์ทจ์†Œ API
export const applyCancel = async apply_id => {
const reqURL = `apply/${apply_id}`;

Expand Down
1 change: 1 addition & 0 deletions gongjakso/src/service/post_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const getPostDetail = async (contest_id, team_id) => {

try {
const response = await axiosInstanceV2.get(reqURL);
console.log(response);
return response.data;
} catch (error) {
console.log(error);
Expand Down

0 comments on commit dcd5e43

Please sign in to comment.