Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 2, 2024
1 parent c8a5b4b commit fe492d1
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 38 deletions.
58 changes: 32 additions & 26 deletions src/pages/fi/LapseApplicationDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,39 +17,45 @@ export function LapseApplicationDialog({ open, handleClose }: LapseApplicationDi
const application = applicationContext.state.data;
const { isLoading, lapseApplicationMutation } = useLapseApplication();


const rootElement = document.getElementById("root-app");

return (
<Dialog fullWidth maxWidth="sm" container={rootElement} open={open} onClose={handleClose}>
<Box
component="form"
className="flex flex-col py-7 px-8"
autoComplete="off"
>
<Title type="section" label={t("Confirm you want to mark this application as lapsed")} className="mb-4" />

<div>{t("Are you sure you want to mark this application as lapsed? This action can't be undone. The application won't be listed in your application list anymore and you won't be able to approve or reject the application.")}</div>

<div className="mt-4 grid grid-cols-1 gap-4 md:flex md:justify-end md:gap-0">
<div>
<Button
primary={false}
disabled={isLoading}
className="md:mr-4"
label={t("Cancel")}
onClick={handleClose}
/>
</div>

<div>
<Button label={t("Lapse")} disabled={isLoading} onClick={() => {if(application?.id) {lapseApplicationMutation(application?.id)}}}/>
</div>
<Box component="form" className="flex flex-col py-7 px-8" autoComplete="off">
<Title type="section" label={t("Confirm you want to mark this application as lapsed")} className="mb-4" />

<div>
{t(
"Are you sure you want to mark this application as lapsed? This action can't be undone. The application won't be listed in your application list anymore and you won't be able to approve or reject the application.",
)}
</div>

<div className="mt-4 grid grid-cols-1 gap-4 md:flex md:justify-end md:gap-0">
<div>
<Button
primary={false}
disabled={isLoading}
className="md:mr-4"
label={t("Cancel")}
onClick={handleClose}
/>
</div>

<div>
<Button
label={t("Lapse")}
disabled={isLoading}
onClick={() => {
if (application?.id) {
lapseApplicationMutation(application?.id);
}
}}
/>
</div>
</Box>
</div>
</Box>
</Dialog>
);
}

export default LapseApplicationDialog;

27 changes: 16 additions & 11 deletions src/pages/fi/StageFive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ import Text from "src/stories/text/Text";
import Title from "src/stories/title/Title";

import Approve from "../../assets/icons/approve.svg";
import Reject from "../../assets/icons/reject.svg";
import Lapse from "../../assets/icons/lapse.svg";
import Reject from "../../assets/icons/reject.svg";
import CreditProductReview from "../../components/CreditProductReview";
import useApproveApplication from "../../hooks/useApproveApplication";
import useLangContext from "../../hooks/useLangContext";
import { type ApproveApplicationInput, type FormApprovedInput, approveSchema } from "../../schemas/application";
import RejectApplicationDialog from "./RejectApplicationDialog";
import LapseApplicationDialog from "./LapseApplicationDialog";
import RejectApplicationDialog from "./RejectApplicationDialog";

export function StageFive() {
const t = useT();
Expand All @@ -31,7 +31,6 @@ export function StageFive() {
const [openDialog, setOpenDialog] = useState<boolean>(false);
const [openLapseDialog, setOpenLapseDialog] = useState<boolean>(false);


const langContext = useLangContext();
const StepImage = langContext.state.selected.startsWith("en") ? StepImageEN : StepImageES;

Expand Down Expand Up @@ -131,21 +130,27 @@ export function StageFive() {
<Button primary={false} className="md:mr-4" label={t("Go Back")} onClick={onGoBackHandler} />
</div>

<div>
<Button className="md:mr-4" icon={Approve} label={t("Approve")} type="submit" disabled={isLoading} />
</div>

<div>
<Button
className="md:mr-4"
icon={Approve}
label={t("Approve")}
type="submit"
label={t("Reject")}
icon={Reject}
onClick={onRejectApplication}
disabled={isLoading}
/>
</div>

<div>
<Button className="md:mr-4" label={t("Reject")} icon={Reject} onClick={onRejectApplication} disabled={isLoading} />
</div>
<div>
<Button className="md:mr-4" label={t("Lapse")} icon={Lapse} onClick={onLapseApplication} disabled={isLoading} />
<Button
className="md:mr-4"
label={t("Lapse")}
icon={Lapse}
onClick={onLapseApplication}
disabled={isLoading}
/>
</div>
</div>
<Text className="mb-10 text-m font-light">
Expand Down
2 changes: 1 addition & 1 deletion src/routes/AppRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import SecureApplicationContextProvider from "src/providers/SecureApplicationCon
import StateContextProvider from "src/providers/StateContextProvider";
import ProtectedRoute from "src/routes/ProtectedRoute";

import StageFiveLapsed from "src/pages/fi/StageFiveLapsed";
import { USER_TYPES } from "../constants";
import PageLayout from "../layout/PageLayout";
import SecureApplicationLayout from "../layout/SecureApplicationLayout";
Expand All @@ -52,7 +53,6 @@ import Applications from "../pages/ocp/Applications";
import { LoadCreditProduct } from "../pages/ocp/CreditProductForm";
import { LenderForm, LoadLender } from "../pages/ocp/LenderForm";
import Settings from "../pages/ocp/Settings";
import StageFiveLapsed from "src/pages/fi/StageFiveLapsed";

// Create a React Query client
const queryClient = new QueryClient({
Expand Down

0 comments on commit fe492d1

Please sign in to comment.