Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ”€ Refactor/myParticipatedTeamBoxComponent [λ‚˜μ˜ μ°Έμ—¬ 기둝 νŒ€λ°•μŠ€ API μž¬μ—°κ²°] #298

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
47 changes: 20 additions & 27 deletions gongjakso/src/pages/TeamBox/TeamBox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ const TeamBox = ({
state => state.confirmModal,
);

const dynamicBorderColor =
// λ‚˜μ˜ μ°Έμ—¬ 기둝 -> ν™œλ™ 쀑: νŒŒλž€μƒ‰ / ν™œλ™ μ’…λ£Œ: 검정색
postContent?.status === 'ν™œλ™ 쀑' ? '#0054FF' : borderColor;

useEffect(() => {
const overlayVisibility = localStorage.getItem(
`overlayVisible-${postId}`,
Expand Down Expand Up @@ -133,19 +137,16 @@ const TeamBox = ({
return (
<S.Container>
<S.Box
$bordercolor={borderColor}
$bordercolor={dynamicBorderColor}
$showmoredetail={showMoreDetail.toString()}
>
<S.BoxTopDetail>
<S.MainBox>
<S.Title>{postContent?.title}</S.Title>
<S.subTitle>
{isMyParticipation === false &&
`| ${postContent?.leader_name} | ${postContent?.started_at}~${postContent?.finished_at} |`}
{isMyParticipation === true &&
`| ${postContent?.leader_name} | ${postContent?.started_at}~${postContent?.finished_at} |`}
{isMyParticipation === null &&
`| ${postContent?.leader_name} | ${postContent?.started_at} ~ ${postContent?.finished_at} |`}
| {postContent?.leader_name} |{' '}
{postContent?.started_at} ~{' '}
{postContent?.finished_at} |
</S.subTitle>
</S.MainBox>
{showSubBox ? (
Expand All @@ -169,7 +170,7 @@ const TeamBox = ({
</S.SubBox>
) : (
<S.ActivityStatus
$poststatus={postContent?.postStatus}
$status={postContent?.status}
$isleader={isLeader}
onClick={
isLeader
Expand All @@ -188,59 +189,51 @@ const TeamBox = ({
<S.BoxBottomDetail>
<S.MainBox>
{isMyParticipation ? (
<div></div>
) : isMyParticipation === null ? (
postContent?.recruit_part?.map(
(category, index) => {
return (
<S.RoundForm key={index}>
{getDisplayCategory(category)}
</S.RoundForm>
);
},
)
<S.RoundForm>
{getDisplayApplyCategory(
postContent?.apply_part,
)}
</S.RoundForm>
) : postContent?.applicant_id ? (
<S.RoundForm>
{getDisplayApplyCategory(
postContent?.apply_part,
)}
</S.RoundForm>
) : (
// λ‚΄κ°€ λͺ¨μ§‘ 쀑인 νŒ€
postContent?.recruit_part?.map(
(categoryList, index) => {
(category, index) => {
return (
<S.RoundForm key={index}>
{getDisplayCategory(categoryList)}
{getDisplayCategory(category)}
</S.RoundForm>
);
},
)
)}
</S.MainBox>
{/* {postContent?.status === 'EXTENSION' &&
{postContent?.status === 'λͺ¨μ§‘ μ—°μž₯' &&
isOverlayVisible && (
<>
<S.DeadlineOverlay $status={postContent.status}>
λͺ¨μ§‘이 μ—°μž₯λ˜μ—ˆμŠ΅λ‹ˆλ‹€.
</S.DeadlineOverlay>
<S.CloseImage onClick={hideOverlay} />
</>
)} */}
)}
{showWaitingJoin && (
<S.WaitingJoin $status={postContent?.status}>
{postContent?.status === 'ν•©λ₯˜ μ™„λ£Œ'
? 'ν•©λ₯˜ μ™„λ£Œ'
: postContent?.status === 'λ―Έμ„ λ°œ'
? 'λ―Έμ„ λ°œ'
: 'ν•©λ₯˜ λŒ€κΈ°μ€‘'}
{/*μˆ˜μ • ν•„μš”. status X*/}
{postContent?.status === 'CLOSE' && (
{postContent?.status === 'λͺ¨μ§‘ 마감' && (
<S.DeadlineOverlay $status={postContent.status}>
λͺ¨μ§‘이 λ§ˆκ°λ˜μ—ˆμŠ΅λ‹ˆλ‹€.
</S.DeadlineOverlay>
)}
{postContent?.status === 'CANCEL' && (
{postContent?.status === 'λͺ¨μ§‘ μ·¨μ†Œ' && (
<S.DeadlineOverlay $status={postContent.status}>
λͺ¨μ§‘이 μ·¨μ†Œλ˜μ—ˆμŠ΅λ‹ˆλ‹€.
</S.DeadlineOverlay>
Expand Down
12 changes: 3 additions & 9 deletions gongjakso/src/pages/TeamBox/TeamBoxStyled.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,19 +163,13 @@ export const ActivityStatus = styled.div`
display: flex;
align-items: center;
justify-content: center;
background: ${({ theme, $poststatus }) =>
$poststatus === 'ACTIVE' ? theme.box1 : theme.box2};
background: ${({ theme, $status }) =>
$status === 'ν™œλ™ 쀑' ? theme.box1 : theme.box2};
border-radius: 50px;
font-size: ${({ theme }) => theme.fontSize.md};
font-weight: 600;
text-align: center;
color: ${({ theme }) => theme.mainFont2};
cursor: ${({ $isleader, $poststatus }) =>
$isleader
? $poststatus === 'ACTIVE'
? 'pointer'
: 'not-allowed'
: 'not-allowed'};
`;

//검은색 λ‘₯κ·Ό ν‹€
Expand Down Expand Up @@ -213,7 +207,7 @@ export const DeadlineOverlay = styled.div`
border-radius: 13.5px;
font-size: ${({ theme }) => theme.fontSize.ll};
background: ${({ $status }) =>
$status === 'EXTENSION'
$status === 'λͺ¨μ§‘ μ—°μž₯'
? `rgba(0, 84, 255, 0.5)`
: `rgba(0, 0, 0, 0.5)`};
display: flex;
Expand Down