wr: Toaster 상위로 위치 변경
This commit is contained in:
@@ -44,7 +44,6 @@ import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import moment from "moment";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { useForm, useWatch } from "react-hook-form";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
import { z } from "zod";
|
||||
|
||||
|
||||
@@ -771,7 +770,6 @@ export default function CoMatRvw() {
|
||||
</div>
|
||||
</div>
|
||||
</ContentsDiv>
|
||||
<Toaster position="top-center" />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button, Label } from "@common/components/ui";
|
||||
import { useAlertStore } from "@/src/shared/lib";
|
||||
import { useEffect, useState } from "react";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import * as XLSX from "xlsx";
|
||||
|
||||
@@ -357,7 +356,6 @@ export default function RuseCaseMng() {
|
||||
</div>
|
||||
</div>
|
||||
</ContentsDiv>
|
||||
<Toaster position="top-center" />
|
||||
{/* 엑셀 등록 모달 */}
|
||||
<UiModal
|
||||
open={isExcelOpen}
|
||||
|
||||
@@ -30,7 +30,6 @@ import { Button, Label } from "@common/components/ui";
|
||||
import { useAlertStore } from "@/src/shared/lib";
|
||||
import moment from "moment";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
export default function RuseRvwHstry() {
|
||||
const {
|
||||
@@ -351,7 +350,6 @@ export default function RuseRvwHstry() {
|
||||
</ListDiv>
|
||||
</div>
|
||||
</div>
|
||||
<Toaster position="top-center" />
|
||||
</ContentsDiv>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ import type { DemandCompType } from "@common/business_components/ui/sdmInsertFor
|
||||
import { Button } from "@common/components/ui";
|
||||
import moment from "moment";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
// import toast, { Toaster } from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useAlertStore } from "@/src/shared/lib";
|
||||
import { useConfirm } from "@frontend-opensource/use-react-hooks";
|
||||
@@ -374,7 +373,6 @@ export default function CoSttn() {
|
||||
}
|
||||
></UiModal>
|
||||
</ContentsDiv>
|
||||
{/* <Toaster position="top-center" /> */}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button, Label, ScrollArea } from "@common/components/ui";
|
||||
import { useAlertStore } from "@/src/shared/lib";
|
||||
import { useEffect, useState, useRef } from "react";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
|
||||
export default function DrgtSttn() {
|
||||
const { code, drgt, drgtSearch, drgtModalSearch, drgtInit } = useWrStore((state) => state);
|
||||
@@ -292,7 +291,6 @@ export default function DrgtSttn() {
|
||||
bodyClass={"w-[50vw] max-w-none h-[80vh]"}
|
||||
body={<DrgtDetailModal data={drgtModal.data as customDrgt[]} />}
|
||||
/>
|
||||
<Toaster position="top-center" />
|
||||
</ContentsDiv>
|
||||
</>
|
||||
)
|
||||
|
||||
@@ -29,7 +29,6 @@ import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button } from "@common/components/ui";
|
||||
import { useAlertStore } from "@/src/shared/lib";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function LdrmntCoSttn() {
|
||||
@@ -290,7 +289,6 @@ export default function LdrmntCoSttn() {
|
||||
bodyClass={"w-[40vw] max-w-none"}
|
||||
body={<CoRegExcel isModal={(isOpen) => setIsExcelOpen({ isModal: isOpen })} />}
|
||||
/>
|
||||
<Toaster position="top-center"></Toaster>
|
||||
</div>
|
||||
</ContentsDiv>
|
||||
</>
|
||||
|
||||
@@ -18,7 +18,6 @@ import {
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button } from "@common/components";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
|
||||
export default function Home() {
|
||||
const {
|
||||
@@ -183,7 +182,6 @@ export default function Home() {
|
||||
}}
|
||||
/>
|
||||
|
||||
<Toaster position="top-center" />
|
||||
</ContentsDiv>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -30,7 +30,7 @@ import { btnClass } from "@/app/store/common/code";
|
||||
import { Tabs, TabsList, TabsTrigger, TabsContent } from "@common/components";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { confirmToast, tableData } from "@/components/lib/func/common";
|
||||
import { tableData } from "@/components/lib/func/common";
|
||||
import type {
|
||||
customPbnst,
|
||||
fcBizType,
|
||||
@@ -44,13 +44,13 @@ import {
|
||||
import { PbnstMngForm } from "@/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm";
|
||||
import { PbnstBuseForm } from "@/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm";
|
||||
import { PbnstRegModal } from "@/components/ui/modal/fcltReg/pbnstRegModal/pbnstRegModal";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
import { writeRgtrAndMdfr } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg";
|
||||
import { useFieldArray, useForm, type FieldErrors } from "react-hook-form"; // FieldErrors 타입 추가
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { z } from "zod";
|
||||
import { createDefaultPbnstItem } from "./utilsZod";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useConfirm } from "@frontend-opensource/use-react-hooks";
|
||||
import { useAlertStore } from "@/src/shared/lib";
|
||||
export default function PublicReuseFaciltyInsert() {
|
||||
const {
|
||||
@@ -67,6 +67,7 @@ export default function PublicReuseFaciltyInsert() {
|
||||
} = useWrStore((state) => state);
|
||||
|
||||
const { t } = useTranslation("base");
|
||||
const { confirm } = useConfirm();
|
||||
const alert = useAlertStore((state) => state.setMessage);
|
||||
const { pubFacHeadList, pbnstHasuResCount, pbnstHasuRes, pbnstRes } = pbnst;
|
||||
const { regAuthrtYn, mdfcnAuthrtYn, laeSeCd } = auth;
|
||||
@@ -137,30 +138,29 @@ export default function PublicReuseFaciltyInsert() {
|
||||
});
|
||||
|
||||
const handleConfirm = async () => {
|
||||
Promise.allSettled([
|
||||
const [resFclt, resBiz] = await Promise.allSettled([
|
||||
pbnstRuseFcltUpdate(pbnst as customPbnst[]),
|
||||
pbnstRuseBizUpdate(bizs),
|
||||
]).then(([resFclt, resBiz]) => {
|
||||
const isFcltSuccess = resFclt.status === "fulfilled";
|
||||
const isBizSuccess = resBiz.status === "fulfilled";
|
||||
if (isFcltSuccess && isBizSuccess) {
|
||||
alert("하수 재이용 시설 및 사업이 수정되었습니다.");
|
||||
// 메시지 표시, 페이지 이동 등
|
||||
} else {
|
||||
let message = "";
|
||||
// ✅ 각각 어떤 항목이 실패했는지도 로그/알림 처리
|
||||
if (!isFcltSuccess) {
|
||||
message = "하수재이용 시설 ";
|
||||
}
|
||||
if (!isBizSuccess) {
|
||||
message += "하수재이용 시설 사업 ";
|
||||
}
|
||||
alert(message + "오류 입니다 ");
|
||||
pubHasuInit("1", laeSeCd);
|
||||
]);
|
||||
const isFcltSuccess = resFclt.status === "fulfilled";
|
||||
const isBizSuccess = resBiz.status === "fulfilled";
|
||||
if (isFcltSuccess && isBizSuccess) {
|
||||
alert("하수 재이용 시설 및 사업이 수정되었습니다.");
|
||||
} else {
|
||||
let message = "";
|
||||
if (!isFcltSuccess) {
|
||||
message = "하수재이용 시설 ";
|
||||
}
|
||||
});
|
||||
if (!isBizSuccess) {
|
||||
message += "하수재이용 시설 사업 ";
|
||||
}
|
||||
alert(message + "오류 입니다 ");
|
||||
pubHasuInit("1", laeSeCd);
|
||||
}
|
||||
};
|
||||
confirmToast(t("isUpdatetMsg"), handleConfirm);
|
||||
if (await confirm(t("isUpdatetMsg"))) {
|
||||
await handleConfirm();
|
||||
}
|
||||
};
|
||||
|
||||
// 폼 유효성 검사 실패 시 호출될 함수
|
||||
@@ -330,9 +330,7 @@ export default function PublicReuseFaciltyInsert() {
|
||||
onClick={() => {
|
||||
// pbnstMngData([] as customPbnst[]);
|
||||
if (!selectRow) {
|
||||
alert(
|
||||
"재시용시설을 등록할 하수리시시설을 테이블에서 선택하고 등록버튼을 눌러주세요"
|
||||
);
|
||||
alert("재시용시설을 등록할 하수처리시설을 목록에서 선택하고\n 등록버튼을 눌러주세요");
|
||||
return;
|
||||
} else {
|
||||
appendPbnstRuseFclt();
|
||||
@@ -433,9 +431,7 @@ export default function PublicReuseFaciltyInsert() {
|
||||
onClick={() => {
|
||||
// pbnstMngData([] as customPbnst[]);
|
||||
if (!selectRow) {
|
||||
alert(
|
||||
"하수리시시설을 테이블을 선택하고 등록버튼을 눌러주세요"
|
||||
);
|
||||
alert("하수처리시설을 목록에서 선택하고\n 등록버튼을 눌러주세요");
|
||||
return;
|
||||
} else {
|
||||
appendPbnstRuseFclt();
|
||||
@@ -470,7 +466,6 @@ export default function PublicReuseFaciltyInsert() {
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<Toaster position="top-center" />
|
||||
</ContentsDiv>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -20,7 +20,6 @@ import {
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button } from "@common/components";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
|
||||
|
||||
|
||||
@@ -199,7 +198,6 @@ export default function Home() {
|
||||
}}
|
||||
/>
|
||||
|
||||
<Toaster position="top-center" />
|
||||
</ContentsDiv>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -20,7 +20,6 @@ import {
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button } from "@common/components";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
|
||||
|
||||
/**
|
||||
@@ -202,7 +201,6 @@ export default function Home() {
|
||||
}}
|
||||
/>
|
||||
|
||||
<Toaster position="top-center" />
|
||||
</ContentsDiv>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -34,7 +34,7 @@ import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { HeadMakeColSpan } from "@common/business_components/ui/table/HeadMakeColSpan";
|
||||
import { Button, Label } from "@common/components/ui";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import toast, { Toaster } from "react-hot-toast";
|
||||
import toast from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function HtdflSttn() {
|
||||
@@ -276,7 +276,6 @@ export default function HtdflSttn() {
|
||||
body={<SttnDetailModal type={"HTB"} formObj={detailModal.data} />}
|
||||
/>
|
||||
</ContentsDiv>
|
||||
<Toaster position="top-center" />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { HeadMakeColSpan } from "@common/business_components/ui/table/HeadMakeColSpan";
|
||||
import { Button, Label } from "@common/components/ui";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import toast, { Toaster } from "react-hot-toast";
|
||||
import toast from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
|
||||
@@ -270,7 +270,6 @@ export default function PbnstSttn() {
|
||||
}}
|
||||
/>
|
||||
</ContentsDiv>
|
||||
<Toaster position="top-center" />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { HeadMakeColSpan } from "@common/business_components/ui/table/HeadMakeColSpan";
|
||||
import { Button, Label } from "@common/components/ui";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import toast, { Toaster } from "react-hot-toast";
|
||||
import toast from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function RainSttn() {
|
||||
@@ -319,7 +319,6 @@ export default function RainSttn() {
|
||||
body={<SttnDetailModal type={"RNB"} formObj={detailModal.data} />}
|
||||
/>
|
||||
</ContentsDiv>
|
||||
<Toaster position="top-center" />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { HeadMakeColSpan } from "@common/business_components/ui/table/HeadMakeColSpan";
|
||||
import { Button, Label } from "@common/components/ui";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import toast, { Toaster } from "react-hot-toast";
|
||||
import toast from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function RswtSttn() {
|
||||
@@ -279,7 +279,6 @@ export default function RswtSttn() {
|
||||
/>
|
||||
|
||||
</ContentsDiv>
|
||||
<Toaster position="top-center" />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ import {
|
||||
TooltipTrigger,
|
||||
} from "@common/components/ui/tooltip";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import toast, { Toaster } from "react-hot-toast";
|
||||
import toast from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function Page() {
|
||||
@@ -434,7 +434,6 @@ export default function Page() {
|
||||
></ChkgdExcel>
|
||||
}
|
||||
/>
|
||||
<Toaster position="top-center" />
|
||||
</ContentsDiv>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ import {
|
||||
TableHeader,
|
||||
} from "@common/components/ui";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import toast, { Toaster } from "react-hot-toast";
|
||||
import toast from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { headMakeprfmnc } from "../chkgdnReg/TableHead";
|
||||
|
||||
@@ -381,7 +381,6 @@ export default function PrfmncPrfmncReg() {
|
||||
setIsExcelOPen({ ...isExcelOpen, isModal: false });
|
||||
}}
|
||||
></UiModal>
|
||||
<Toaster position="top-center" />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import {
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button, Label } from "@common/components/ui";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import toast, { Toaster } from "react-hot-toast";
|
||||
import toast from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function Page() {
|
||||
@@ -307,7 +307,6 @@ export default function Page() {
|
||||
/>
|
||||
}
|
||||
></UiModal>
|
||||
<Toaster position="top-center" />
|
||||
</ContentsDiv>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import { CHART_FORM, ContentsDiv, MainChart, ScrollArea, SearchBaseForm, SearchI
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Label, Table, TableBody, TableHeader } from "@common/components/ui";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import toast, { Toaster } from "react-hot-toast";
|
||||
import toast from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { headMakeprfmnc } from "../../prfmncReg/chkgdnReg/TableHead";
|
||||
|
||||
@@ -723,7 +723,6 @@ export default function PbnstPrfmncSttn() {
|
||||
</div>
|
||||
</div>
|
||||
</ContentsDiv>
|
||||
<Toaster position="top-center" />
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button } from "@common/components/ui";
|
||||
import { useEffect, useState } from "react";
|
||||
import toast, { Toaster } from "react-hot-toast";
|
||||
import toast from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function RswtStat() {
|
||||
@@ -296,7 +296,6 @@ export default function RswtStat() {
|
||||
</ListDiv>
|
||||
</div>
|
||||
</div>
|
||||
<Toaster position="top-center"></Toaster>
|
||||
</ContentsDiv>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -14,6 +14,7 @@ import { ConfirmDialog } from "../../shared/ui/confirm-dialog";
|
||||
// import "./globals.css";
|
||||
import i18next from "i18next";
|
||||
import { I18nextProvider } from "react-i18next";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
import koBase from "@/public/locales/ko/message.json";
|
||||
import { StoreProvider as WrStoreProvider } from "@/app/store";
|
||||
//import { LoginApi } from "@/src/entities/auth";
|
||||
@@ -54,6 +55,7 @@ const AppProvider = ({ children }: Readonly<{ children: React.ReactNode }>) => {
|
||||
<AlertDialog />
|
||||
<PromptDialog />
|
||||
<ConfirmDialog />
|
||||
<Toaster position="top-center" />
|
||||
</AuthWrapper>
|
||||
</ConfirmProvider>
|
||||
</PromptProvider>
|
||||
|
||||
Reference in New Issue
Block a user