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

[Fix] : 자잘한 UI 이슈들 해결 #114

Merged
merged 5 commits into from
Sep 4, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,13 @@ const JoinRegularMemberBottomSheet = ({
text={<Text typo="label1">{recruitmentPeriod}</Text>}
/>
<Button
disabled={currentRecruitment ? true : false}
onClick={() => {
joinRegularMember(currentRecruitment.recruitmentId);
}}>
지원하러 가기
{currentRecruitment
? '정회원 가입 조건을 완료해주세요'
: '지원하러 가기'}
</Button>
</BottomSheetContent>
</BottomSheet>
Expand Down
15 changes: 10 additions & 5 deletions src/components/myPage/ApproveBox.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import Box from 'wowds-ui/Box';
import styled from '@emotion/styled';
import { CurrentRecruitmentType } from '@/apis/member/memberType';
import {
CurrentMembershipType,
CurrentRecruitmentType
} from '@/apis/member/memberType';
import {
convertRecruitmentPeriod,
convertRecruitmentName
Expand All @@ -13,14 +16,16 @@ type BoxStatusType = 'default' | 'success' | 'error';

export const ApproveBox = ({
role,
currentRecruitment
currentRecruitment,
currentMembership
}: {
role: UserRoleType;
currentRecruitment: CurrentRecruitmentType;
currentMembership?: CurrentMembershipType;
}) => {
const { handleBottomSheet } = useBottomSheet();

if (!currentRecruitment) {
if (!currentRecruitment && role !== 'REGULAR') {
return (
<Box
variant="warn"
Expand Down Expand Up @@ -48,7 +53,7 @@ export const ApproveBox = ({
ASSOCIATE: {
title: `${convertRecruitmentName(currentRecruitment.name, currentRecruitment.roundTypeValue)}`,
description: `${convertRecruitmentPeriod(currentRecruitment.period)}`,
boxVariant: 'arrow',
boxVariant: currentMembership ? 'text' : 'arrow',
status: 'error'
},
REGULAR: {
Expand All @@ -63,7 +68,7 @@ export const ApproveBox = ({
return (
<BoxWrapper
onClick={() => {
if (role === 'ASSOCIATE') handleBottomSheet();
if (role === 'ASSOCIATE' && !currentMembership) handleBottomSheet();
else if (role === 'REGULAR') {
window.location.href = 'https://study.gdschongik.com/';
} else {
Expand Down
15 changes: 12 additions & 3 deletions src/components/myPage/JoinStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,23 @@ import styled from '@emotion/styled';
import MemberStatusInfoBox from '@/components/myPage/MemberStatusInfoBox';
import { ApproveBox } from './ApproveBox';
import { Text, Flex, Space } from '../common/Wrapper';
import { CurrentRecruitmentType } from '@/apis/member/memberType';
import {
CurrentMembershipType,
CurrentRecruitmentType
} from '@/apis/member/memberType';
import MemberStatusStepper from './MemberStatusStepper';
import { User, UserRoleType } from '@/types/user';

const JoinStatus = ({
role,
currentRecruitmentRound,
member
member,
currentMembership
}: {
role: UserRoleType;
currentRecruitmentRound: CurrentRecruitmentType;
member: User;
currentMembership?: CurrentMembershipType;
}) => {
const [openInfo, setOpenInfo] = useState(false);
const helpButtonRef = useRef<HTMLDivElement>(null);
Expand Down Expand Up @@ -50,7 +55,11 @@ const JoinStatus = ({
<Space height={40} />
<MemberStatusStepper member={member} />
<Space height={20} />
<ApproveBox role={role} currentRecruitment={currentRecruitmentRound} />
<ApproveBox
role={role}
currentRecruitment={currentRecruitmentRound}
currentMembership={currentMembership}
/>
</Flex>
);
};
Expand Down
4 changes: 2 additions & 2 deletions src/components/signup/EmailInputField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const EmailInputField = ({ control }: DepartmentSelectProps) => {
render={({ field, fieldState }) => (
<TextFieldWrapper>
<TextField
style={{ minWidth: '100%' }}
style={{ minWidth: '100%', flex: 1, maxWidth: '150px' }}
label="이메일"
error={fieldState.invalid}
ref={field.ref}
Expand Down Expand Up @@ -69,7 +69,7 @@ const EmailInputField = ({ control }: DepartmentSelectProps) => {
{customEmail ? (
<TextFieldWrapper>
<TextField
style={{ minWidth: '100%' }}
style={{ minWidth: '100%', flex: 1, maxWidth: '150px' }}
label="도메인"
error={fieldState.invalid}
ref={field.ref}
Expand Down
3 changes: 3 additions & 0 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 @@ -40,6 +42,7 @@ export const Dashboard = () => {
<JoinStatus
role={member.role}
currentRecruitmentRound={currentRecruitmentRound}
currentMembership={currentMembership}
member={member}
/>
</Flex>
Expand Down
Loading