@@ -7,14 +7,18 @@ import RegisteredList from './RegisteredList';
77import { useDispatch } from 'react-redux' ;
88import {
99 setCourseName ,
10+ setCuriTypeCdNm ,
1011 setModalName ,
12+ setSchDeptAlias ,
1113 setScheduleId ,
1214} from '@/store/modules/modalSlice' ;
1315import StartButton from '@components/CourseRegister/StartButton.tsx' ;
1416import { getCourseList , getRegisterdList , getWishlist } from '@/apis/api/course' ;
1517import { useAppSelector } from '@/store/hooks' ;
1618import { openModalHandler } from '../common/Modal/handlers/handler' ;
1719import { setEndCount } from '@/store/modules/courseRegisteredSlice' ;
20+ import RegisterInfo from './RegisterInfo' ;
21+ import { setIsConfirm } from '@/store/modules/dateModeSlice' ;
1822
1923const colData = [
2024 { name : 'action' , value : '신청' , initialWidth : 50 , enableFilters : false } ,
@@ -44,6 +48,7 @@ function CourseRegister() {
4448
4549 const dispatch = useDispatch ( ) ;
4650 const studentId = useAppSelector ( state => state . userInfo . username ) ;
51+ const isConfirm = useAppSelector ( state => state . dateMode . isConfirm ) ;
4752
4853 useEffect ( ( ) => {
4954 dispatch ( setEndCount ( false ) ) ;
@@ -95,32 +100,42 @@ function CourseRegister() {
95100 _action : string ,
96101 scheduleId : number | undefined ,
97102 curiNm : string | undefined ,
103+ schDeptAlias : string | undefined ,
104+ curiTypeCdNm : string | undefined ,
98105 ) => {
99- if ( scheduleId && curiNm ) {
106+ if ( scheduleId && curiNm && schDeptAlias && curiTypeCdNm ) {
100107 dispatch ( setScheduleId ( scheduleId ) ) ;
101108 dispatch ( setCourseName ( curiNm ) ) ;
102109 dispatch ( setModalName ( 'macro' ) ) ;
110+ dispatch ( setSchDeptAlias ( schDeptAlias ) ) ;
111+ dispatch ( setCuriTypeCdNm ( curiTypeCdNm ) ) ;
103112 }
104113 } ;
105114
106115 return (
107116 < >
108- < StartButton onClick = { handleStartButtonClick } />
109- < RegisterFilters
110- onSearch = { handleSearch }
111- isRegistrationStarted = { isRegistrationStarted }
112- />
113- < TableTitleWrap >
114- < TableTitle > 수강대상교과목</ TableTitle >
115- </ TableTitleWrap >
116- < Table
117- colData = { colData }
118- data = { list }
119- width = '100%'
120- height = '35rem'
121- onAction = { handleAction }
122- />
123- < RegisteredList list = { registeredList } refreshAll = { refreshAll } />
117+ { ! isConfirm ? (
118+ < RegisterInfo onClickNext = { ( ) => dispatch ( setIsConfirm ( ) ) } />
119+ ) : (
120+ < >
121+ < StartButton onClick = { handleStartButtonClick } />
122+ < RegisterFilters
123+ onSearch = { handleSearch }
124+ isRegistrationStarted = { isRegistrationStarted }
125+ />
126+ < TableTitleWrap >
127+ < TableTitle > 수강대상교과목</ TableTitle >
128+ </ TableTitleWrap >
129+ < Table
130+ colData = { colData }
131+ data = { list }
132+ width = '100%'
133+ height = '35rem'
134+ onAction = { handleAction }
135+ />
136+ < RegisteredList list = { registeredList } refreshAll = { refreshAll } />
137+ </ >
138+ ) }
124139 </ >
125140 ) ;
126141}
0 commit comments