From e120e4b0cd6bdb471e4a3fa1efd051fd65350d73 Mon Sep 17 00:00:00 2001 From: Dev-CasperTheGhost <53900565+Dev-CasperTheGhost@users.noreply.github.com> Date: Sat, 15 Apr 2023 15:02:30 +0200 Subject: [PATCH] feat: updated switch field --- .../licenses/ManageLicensesFormFields.tsx | 59 ++++++++----------- .../modals/register-vehicle-modal.tsx | 30 +++++----- 2 files changed, 39 insertions(+), 50 deletions(-) diff --git a/apps/client/src/components/citizen/licenses/ManageLicensesFormFields.tsx b/apps/client/src/components/citizen/licenses/ManageLicensesFormFields.tsx index e743833d5..e26ef8ab3 100644 --- a/apps/client/src/components/citizen/licenses/ManageLicensesFormFields.tsx +++ b/apps/client/src/components/citizen/licenses/ManageLicensesFormFields.tsx @@ -8,10 +8,9 @@ import { FormField } from "components/form/FormField"; import { Select } from "components/form/Select"; import { filterLicenseType, filterLicenseTypes } from "lib/utils"; import { classNames } from "lib/classNames"; -import { Toggle } from "components/form/Toggle"; import type { LicenseInitialValues } from "./manage-licenses-modal"; import { FormRow } from "components/form/FormRow"; -import { DatePickerField } from "@snailycad/ui"; +import { DatePickerField, SwitchField } from "@snailycad/ui"; import { ValueSelectField } from "components/form/inputs/value-select-field"; export function createDefaultLicensesValues(citizen: Citizen | null): LicenseInitialValues { @@ -89,14 +88,12 @@ export function ManageLicensesFormFields({ isLeo, allowRemoval, flexType }: Prop
{isLeo ? ( - - - + setFieldValue("suspended.driverLicense", isSelected)} + > + {t("Leo.suspendDriversLicense")} + {values.suspended.driverLicense ? ( {isLeo ? ( - - - + setFieldValue("suspended.pilotLicense", isSelected)} + > + {t("Leo.suspendPilotLicense")} + {values.suspended.pilotLicense ? ( {isLeo ? ( - - - + setFieldValue("suspended.waterLicense", isSelected)} + > + {t("Leo.suspendWaterLicense")} + {values.suspended.waterLicense ? ( {isLeo ? ( - - - + setFieldValue("suspended.firearmsLicense", isSelected)} + > + {t("Leo.suspendFirearmsLicense")} + {values.suspended.firearmsLicense ? ( - - - + setFieldValue("reportedStolen", isSelected)} + > + {tVehicle("reportAsStolen")} + - - - + setFieldValue("reApplyForDmv", isSelected)} + isDisabled={vehicle.dmvStatus !== WhitelistStatus.DECLINED} + > + {tVehicle("reApplyForDmv")} + ) : null}