diff --git a/packages/admin/src/components/StudentForm.jsx b/packages/admin/src/components/StudentForm.jsx index 84fcb955..8d7e2c8d 100644 --- a/packages/admin/src/components/StudentForm.jsx +++ b/packages/admin/src/components/StudentForm.jsx @@ -95,6 +95,37 @@ function StudentForm({ studentData }) { } }; + useEffect(() => { + if (token && !studentData) { + setLoading(true); + + const headers = { + Accept: "*/*", + Authorization: `Bearer ${token}`, + "Content-Type": "application/json", + }; + + const requestDataSchool = { page: 0, filters: {} }; + + const apiCalls = [ + () => axios.post(schoolSearch, requestDataSchool, { headers }), + () => axios.post(getStateList, {}, { headers }), + ]; + + Promise.all(apiCalls.map(call => call())) + .then(([schoolResponse, stateResponse]) => { + if (schoolResponse) setData(schoolResponse.data.data); + if (stateResponse) setStateData(stateResponse.data.data); + }) + .catch(error => { + console.error(error); + }) + .finally(() => { + setLoading(false); + }); + } + }, [token]); + useEffect(() => { if (token && studentData) { setLoading(true); diff --git a/packages/admin/src/components/StudentForm.module.css b/packages/admin/src/components/StudentForm.module.css index 56e3fa85..30076fce 100644 --- a/packages/admin/src/components/StudentForm.module.css +++ b/packages/admin/src/components/StudentForm.module.css @@ -65,7 +65,7 @@ /* Style the Select Element */ .selectWrapper { - width: 104%; + width: 103%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; @@ -73,6 +73,11 @@ cursor: pointer; } +@media only screen and (max-width: 600px) { + .selectWrapper { + width: 108%; + } +} /* Style the Arrow Icon (in modern browsers) */ .select-wrapper select::after { content: "\25BC"; /* Unicode character for a down arrow */ diff --git a/packages/admin/src/components/StudentListView.jsx b/packages/admin/src/components/StudentListView.jsx index 1d201534..0717de3d 100644 --- a/packages/admin/src/components/StudentListView.jsx +++ b/packages/admin/src/components/StudentListView.jsx @@ -441,11 +441,12 @@ function StudentListView() { onRequestClose={handleClose} contentLabel="Edit Modal" ariaHideApp={false} + className={styles.formModal} > -