Skip to content

Commit

Permalink
fix: 회원가입 선택 모달 사용자 경로 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
jikwan0327 committed Sep 17, 2023
1 parent c473cdb commit d0c1ff3
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 56 deletions.
45 changes: 39 additions & 6 deletions src/components/DivideSignup.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import React, { useState } from 'react';
import styled from '@emotion/styled';
import DivideSignupCard from './DivideSignupCard';
import { Stack, Text, theme } from '@team-entry/design_system';
import { Button, HStack, Stack, Text } from '@team-entry/design_system';
import { GoToAuthorization } from './GoToAuthorization';
import { Link } from 'react-router-dom';
import { useModal } from '@/hooks/useModal';

interface IDivideSignup {
setIsStudent: React.Dispatch<React.SetStateAction<boolean>>;
}

const DivideSignup = ({ setIsStudent }: IDivideSignup) => {
const [isClick, setIsClick] = useState(false);
const { render, close } = useModal();

if (isClick)
return <GoToAuthorization text="본인 인증후 회원가입을 진행해 주세요" />;
return (
Expand All @@ -27,10 +29,37 @@ const DivideSignup = ({ setIsStudent }: IDivideSignup) => {
학생 명의로 가입할 수 없나요?
</Text>
<Text
onClick={() => {
setIsClick(true);
setIsStudent(false);
}}
onClick={() =>
render({
title: '안내',
content:
'학부모 명의로 가입 시 원서 접수 서류에 \n 학부모 연락처가 입력됩니다.',
button: (
<HStack gap={10}>
<_SelectButton
kind="contained"
color="orange"
onClick={() => {
close();
setIsClick(true);
setIsStudent(false);
}}
>
진행
</_SelectButton>
<_SelectButton
kind="outlined"
color="black"
onClick={() => {
close();
}}
>
닫기
</_SelectButton>
</HStack>
),
})
}
color="orange500"
size="body1"
style={{ textDecoration: 'underline' }}
Expand All @@ -54,3 +83,7 @@ const Wrapper = styled.div`
height: 100%;
padding: 32px;
`;

const _SelectButton = styled(Button)`
width: 120px;
`;
61 changes: 11 additions & 50 deletions src/components/DivideSignupCard.tsx
Original file line number Diff line number Diff line change
@@ -1,75 +1,36 @@
/* eslint-disable object-curly-newline */
import React from 'react';
import SchoolBag from '@/assets/SchoolBag';
import Users from '@/assets/Users';
import styled from '@emotion/styled';
import { Text, Button, theme, HStack } from '@team-entry/design_system';
import { useModal } from '@/hooks/useModal';
import { Text, Button, theme } from '@team-entry/design_system';

interface IDivideSignupCard {
isStudent: boolean;
setIsStudent: React.Dispatch<React.SetStateAction<boolean>>;
setIsClick: React.Dispatch<React.SetStateAction<boolean>>;
}

const DivideSignupCard = ({
isStudent,
setIsStudent,
setIsClick,
}: IDivideSignupCard) => {
const { render, close } = useModal();
const DivideSignupCard = ({ setIsStudent, setIsClick }: IDivideSignupCard) => {
return (
<_Wrapper>
<_Container>
<_IconWrapper>{isStudent ? <SchoolBag /> : <Users />}</_IconWrapper>
<_IconWrapper>
<SchoolBag />
</_IconWrapper>
<Text size="title2" color="black">
{isStudent ? '학생 본인' : '학부모'}
학생 본인
</Text>
</_Container>
<Text size="body2" color="black" align="center">
{isStudent ? '학생 본인 명의로 ' : '학부모 명의로 '}
{'학생 본인 명의로 '}
Entry에 가입합니다
</Text>
<Button
kind="rounded"
color="orange"
onClick={
isStudent
? () => {
setIsClick(true);
setIsStudent(true);
}
: () =>
render({
title: '안내',
content:
'학부모 명의로 가입 시 원서 접수 서류에 \n 학부모 연락처가 입력됩니다.',
button: (
<HStack gap={10}>
<_SelectButton
kind="contained"
color="orange"
onClick={() => {
close();
setIsClick(true);
setIsStudent(false);
}}
>
진행
</_SelectButton>
<_SelectButton
kind="outlined"
color="black"
onClick={() => {
close();
}}
>
닫기
</_SelectButton>
</HStack>
),
})
}
onClick={() => {
setIsClick(true);
setIsStudent(true);
}}
>
가입
</Button>
Expand Down

0 comments on commit d0c1ff3

Please sign in to comment.