RegisterPresenter.tsx
7.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
import React from 'react';
import * as styled from './RegisterStyled';
interface RegisterProps {
registerForm : {
userId : string;
password : string;
passwordCheck : string;
info : {
doctorLicense : string;
hospitalNm : string;
hospitalAddr : string;
contact : string;
doctorType : string;
doctorNm : string;
},
};
page : number;
error : string | null;
onGoBackPage : () => void;
onCancleRegister : () => void;
onSetUserId : React.ChangeEventHandler<HTMLInputElement>;
onSetPassword : React.ChangeEventHandler<HTMLInputElement>;
onSetPasswordCheck : React.ChangeEventHandler<HTMLInputElement>;
onSetDoctorLicense : React.ChangeEventHandler<HTMLInputElement>;
onSetHospitalNm : React.ChangeEventHandler<HTMLInputElement>;
onSetHospitalAddr : React.ChangeEventHandler<HTMLInputElement>;
onSetContact : React.ChangeEventHandler<HTMLInputElement>;
onSetDoctorType : React.ChangeEventHandler<HTMLInputElement>;
onSetDoctorNm : React.ChangeEventHandler<HTMLInputElement>;
onSubmitButton : () => void;
}
const RegisterPresenter = (props : RegisterProps) => {
return (
<styled.Container>
<styled.RegisterWrapper>
<styled.RegisterBackButtonWrapper>
<styled.RegisterBackButton
onClick = {props.onCancleRegister}
>
회원가입 취소
</styled.RegisterBackButton>
{
props.page > 1 ?
<styled.RegisterBackButton
onClick = {props.onGoBackPage}
>
이전
</styled.RegisterBackButton> : null
}
</styled.RegisterBackButtonWrapper>
<styled.RegisterTitle>회원 가입</styled.RegisterTitle>
<styled.RegisterInfo>* 의사만 회원가입이 가능합니다.</styled.RegisterInfo>
<styled.RegisterInfo style = {{fontSize : 10,}}>의사 인증을 위한 정보가 요구됩니다. 해당 정보는 인증을 위한 용도로만 사용됩니다.</styled.RegisterInfo>
{
props.page === 1 ?
<>
<styled.RegisterInputWrapper>
<styled.RegisterInputText>이메일</styled.RegisterInputText>
<styled.RegisterInput
placeholder = 'Email'
value = {props.registerForm.userId}
onChange = {props.onSetUserId}
/>
</styled.RegisterInputWrapper>
<styled.RegisterInputWrapper>
<styled.RegisterInputText>비밀번호</styled.RegisterInputText>
<styled.RegisterInput
placeholder = 'Password'
value = {props.registerForm.password}
onChange = {props.onSetPassword}
type = 'password'
/>
</styled.RegisterInputWrapper>
<styled.RegisterInputWrapper>
<styled.RegisterInputText>비밀번호 확인</styled.RegisterInputText>
<styled.RegisterInput
placeholder = 'Password Again'
value = {props.registerForm.passwordCheck}
onChange = {props.onSetPasswordCheck}
type = 'password'
/>
</styled.RegisterInputWrapper>
</> :
props.page === 2 ?
<>
<styled.RegisterInputWrapper>
<styled.RegisterInputText>의사 자격증 번호</styled.RegisterInputText>
<styled.RegisterInput
placeholder = "Doctor's License"
value = {props.registerForm.info.doctorLicense}
onChange = {props.onSetDoctorLicense}
/>
</styled.RegisterInputWrapper>
<styled.RegisterInputWrapper>
<styled.RegisterInputText>이름</styled.RegisterInputText>
<styled.RegisterInput
placeholder = 'Name'
value = {props.registerForm.info.doctorNm}
onChange = {props.onSetDoctorNm}
/>
</styled.RegisterInputWrapper>
<styled.RegisterInputWrapper>
<styled.RegisterInputText>연락처</styled.RegisterInputText>
<styled.RegisterInput
placeholder = 'Contact'
value = {props.registerForm.info.contact}
onChange = {props.onSetContact}
/>
</styled.RegisterInputWrapper>
</> :
props.page === 3 ?
<>
<styled.RegisterInputWrapper>
<styled.RegisterInputText>전문 분야</styled.RegisterInputText>
<styled.RegisterInput
placeholder = "Doctor's Type"
value = {props.registerForm.info.doctorType}
onChange = {props.onSetDoctorType}
/>
</styled.RegisterInputWrapper>
<styled.RegisterInputWrapper>
<styled.RegisterInputText>병원 이름</styled.RegisterInputText>
<styled.RegisterInput
placeholder = 'Hospital'
value = {props.registerForm.info.hospitalNm}
onChange = {props.onSetHospitalNm}
/>
</styled.RegisterInputWrapper>
<styled.RegisterInputWrapper>
<styled.RegisterInputText>병원 주소</styled.RegisterInputText>
<styled.RegisterInput
placeholder = 'Address'
value = {props.registerForm.info.hospitalAddr}
onChange = {props.onSetHospitalAddr}
/>
</styled.RegisterInputWrapper>
</> : null
}
<styled.RegisterButtonWrapper>
<styled.RegisterButton
onClick = {props.onSubmitButton}
>
{
props.page < 3 ? '다음' : '회원 가입'
}
</styled.RegisterButton>
</styled.RegisterButtonWrapper>
</styled.RegisterWrapper>
</styled.Container>
)
};
export default RegisterPresenter;