@@ -7,15 +7,15 @@ import Cropper from 'react-easy-crop';
7
7
import { FormProvider , useForm } from 'react-hook-form' ;
8
8
import { useTheme } from 'styled-components' ;
9
9
import { useCropImage } from '../../hooks/useCropImage' ;
10
- import { CourseNameByKey , Status } from '../../types' ;
10
+ import { CourseNameByKey , CourseNameByKeyTeam , Status } from '../../types' ;
11
11
import { getCroppedImg } from '../../utils/cropImage' ;
12
12
import { Input } from '../Input' ;
13
13
import { Logo } from '../Logo' ;
14
14
import { Typography } from '../Typography' ;
15
15
import { FileIcon } from './components/FileIcon' ;
16
16
import * as S from './styles' ;
17
17
18
- export const IdCardForm = ( ) => {
18
+ export const IdCardForm = ( props : { team ?: boolean } ) => {
19
19
const router = useRouter ( ) ;
20
20
const theme = useTheme ( ) ;
21
21
const [ imagePreview , setImagePreview ] = useState ( null ) ;
@@ -37,6 +37,12 @@ export const IdCardForm = () => {
37
37
38
38
const handleSubmit = ( { email, ...rest } : Record < string , string > ) => {
39
39
setCookies ( 'nagato' , JSON . stringify ( { ...rest } ) ) ;
40
+
41
+ if ( props . team ) {
42
+ router . push ( `/id-card/time/${ rest . name } ` ) ;
43
+ return ;
44
+ }
45
+
40
46
router . push ( `/id-card/${ email } ` ) ;
41
47
return ;
42
48
@@ -150,11 +156,23 @@ export const IdCardForm = () => {
150
156
id = "course"
151
157
color = { theme . palette . design . white }
152
158
>
153
- { Object . entries ( CourseNameByKey ) . map ( ( [ key , value ] ) => (
154
- < option key = { key } value = { value } >
155
- { value }
156
- </ option >
157
- ) ) }
159
+ { props . team ? (
160
+ < >
161
+ { Object . entries ( CourseNameByKeyTeam ) . map ( ( [ key , value ] ) => (
162
+ < option key = { key } value = { value } >
163
+ { value }
164
+ </ option >
165
+ ) ) }
166
+ </ >
167
+ ) : (
168
+ < >
169
+ { Object . entries ( CourseNameByKey ) . map ( ( [ key , value ] ) => (
170
+ < option key = { key } value = { value } >
171
+ { value }
172
+ </ option >
173
+ ) ) }
174
+ </ >
175
+ ) }
158
176
</ Select >
159
177
</ >
160
178
< Input
0 commit comments