toast 메시지 추가
alert 글로벌화 loading 글로벌화
This commit is contained in:
@@ -29,13 +29,15 @@ import LandInfoSearchBar, { useLandInfoSearch } from '../../components/ServiceMa
|
||||
import { TableSkeleton } from '../../components/Skeleton/TableSkeleton';
|
||||
import OwnerChangeModal from '../../components/ServiceManage/modal/OwnerChangeModal';
|
||||
import { opLandInfoStatusType } from '../../assets/data/options';
|
||||
import { useAlert } from '../../context/AlertProvider';
|
||||
import { alertTypes } from '../../assets/data/types';
|
||||
|
||||
const LandInfoView = () => {
|
||||
const token = sessionStorage.getItem('token');
|
||||
const navigate = useNavigate();
|
||||
const userInfo = useRecoilValue(authList);
|
||||
const { t } = useTranslation();
|
||||
const tableRef = useRef(null);
|
||||
const {showToast} = useAlert();
|
||||
|
||||
const [detailData, setDetailData] = useState({});
|
||||
|
||||
@@ -48,7 +50,6 @@ const LandInfoView = () => {
|
||||
deleteConfirm: 'hidden',
|
||||
deleteComplete: 'hidden'
|
||||
});
|
||||
const [alertMsg, setAlertMsg] = useState('');
|
||||
const [modalType, setModalType] = useState('regist');
|
||||
|
||||
const {
|
||||
@@ -80,7 +81,7 @@ const LandInfoView = () => {
|
||||
setModalType('regist');
|
||||
const selectRow = selectedRows[0];
|
||||
if(!selectRow.owned) {
|
||||
setAlertMsg(t('LAND_OWNED_CHANGES_WARNING'))
|
||||
showToast('LAND_OWNED_CHANGES_WARNING', {type:alertTypes.warning});
|
||||
return;
|
||||
}
|
||||
const owner_changes = selectRow.owner_changes;
|
||||
@@ -147,15 +148,12 @@ const LandInfoView = () => {
|
||||
// // fetchData(option);
|
||||
// window.location.reload();
|
||||
// break;
|
||||
case "warning":
|
||||
setAlertMsg('')
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const handleDetailView = () => {
|
||||
handleModalClose('detail');
|
||||
handleSearch();
|
||||
handleSearch(updateSearchParams);
|
||||
removeSelectedRows();
|
||||
}
|
||||
|
||||
@@ -235,14 +233,12 @@ const LandInfoView = () => {
|
||||
</>
|
||||
}
|
||||
|
||||
|
||||
<OwnerChangeModal modalType={modalType} detailView={modalState.detailModal} handleDetailView={() => handleDetailView()} content={detailData} setDetailData={setDetailData} />
|
||||
|
||||
<DynamicModal
|
||||
modalType={modalTypes.completed}
|
||||
view={alertMsg ? 'view' : 'hidden'}
|
||||
modalText={alertMsg}
|
||||
handleSubmit={() => handleModalSubmit('warning')}
|
||||
<OwnerChangeModal
|
||||
modalType={modalType}
|
||||
detailView={modalState.detailModal}
|
||||
handleDetailView={() => handleDetailView()}
|
||||
content={detailData}
|
||||
setDetailData={setDetailData}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user