Skip to content

Commit

Permalink
[Feature]: 정회원 승급 시 와우클래스 바로가기 링크를 띄워줘요 (#113)
Browse files Browse the repository at this point in the history
* fix: 와우클래스 박스 생성

* fix: 정회원 가입 조건 regular일때 보이도록
  • Loading branch information
eugene028 authored Sep 4, 2024
1 parent 42f68cb commit ebefc66
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 20 deletions.
11 changes: 8 additions & 3 deletions src/components/myPage/ApproveBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,21 @@ export const ApproveBox = ({
status: 'error'
},
REGULAR: {
title: '모든 가입 절차를 완료했어요.',
boxVariant: 'text',
title: 'WOW CLASS',
description:
'GDSC Hongik의 스터디 서비스인 WOW CLASS를 이용할 수 있어요.',
boxVariant: 'arrow',
status: 'success'
}
};

return (
<BoxWrapper
onClick={() => {
if (role === 'ASSOCIATE') handleBottomSheet();
else {
else if (role === 'REGULAR') {
window.location.href = 'https://study.gdschongik.com/';
} else {
return;
}
}}>
Expand Down
47 changes: 32 additions & 15 deletions src/components/myPage/JoinRegularMember.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
import { Text, Flex } from '@/components/common/Wrapper';
import RoutePath from '@/routes/routePath';
import { Status } from '@/types/status';
import { User } from '@/types/user';
import { useNavigate } from 'react-router-dom';
import Box from 'wowds-ui/Box';

const JoinRegularMember = ({ paymentStatus }: { paymentStatus: Status }) => {
const JoinRegularMember = ({
paymentStatus,
member
}: {
paymentStatus?: Status;
member: User;
}) => {
const navigate = useNavigate();

const handleClickRoute = () => {
Expand All @@ -23,20 +30,30 @@ const JoinRegularMember = ({ paymentStatus }: { paymentStatus: Status }) => {
<Text typo="h2" color="textBlack">
정회원 가입 조건
</Text>
<Box
text={
paymentStatus === 'UNSATISFIED'
? '이번 학기 회비를 납부해주세요.'
: '이번 학기 회비를 납부했어요.'
}
variant={paymentStatus === 'UNSATISFIED' ? 'arrow' : 'text'}
status={paymentStatus === 'UNSATISFIED' ? 'error' : 'success'}
subText={
paymentStatus === 'UNSATISFIED'
? '카드·계좌이체 등 여러 결제수단을 지원해요.'
: undefined
}
/>
{paymentStatus ? (
<Box
text={
paymentStatus === 'UNSATISFIED'
? '이번 학기 회비를 납부해주세요.'
: '이번 학기 회비를 납부했어요.'
}
variant={paymentStatus === 'UNSATISFIED' ? 'arrow' : 'text'}
status={paymentStatus === 'UNSATISFIED' ? 'error' : 'success'}
subText={
paymentStatus === 'UNSATISFIED'
? '카드·계좌이체 등 여러 결제수단을 지원해요.'
: undefined
}
/>
) : (
member.role === 'REGULAR' && (
<Box
text="이번 학기 회비를 납부했어요."
variant="text"
status="success"
/>
)
)}
</Flex>
);
};
Expand Down
7 changes: 5 additions & 2 deletions src/pages/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export const Dashboard = () => {

const { member, currentRecruitmentRound, currentMembership } = data;

console.log(data);

return (
<div style={{ height: '100%' }}>
<Wrapper direction="column" justify="flex-start">
Expand All @@ -43,9 +45,10 @@ export const Dashboard = () => {
member={member}
/>
</Flex>
{currentMembership && (
{(currentMembership || member.role === 'REGULAR') && (
<JoinRegularMember
paymentStatus={currentMembership.regularRequirement.paymentStatus}
member={member}
paymentStatus={currentMembership?.regularRequirement.paymentStatus}
/>
)}
<AssociateRequirementCheck
Expand Down

0 comments on commit ebefc66

Please sign in to comment.