From 33765f15a77a6d4a194110a81e1a86b8346f63b2 Mon Sep 17 00:00:00 2001 From: Dev-CasperTheGhost <53900565+Dev-CasperTheGhost@users.noreply.github.com> Date: Sat, 15 Apr 2023 15:41:24 +0200 Subject: [PATCH] feat: updated switch field --- .../citizen/weapons/register-weapon-modal.tsx | 21 ++++---- .../Manage911Call/add-unit-to-call-modal.tsx | 20 ++++--- .../dispatch/modals/tones-modal.tsx | 30 ++++++----- .../leo/incidents/manage-incident-modal.tsx | 53 +++++++++---------- .../manage-record/manage-record-modal.tsx | 27 +++++----- .../manage-seized-items-modal.tsx | 15 +++--- .../business/[id]/[employeeId]/manage.tsx | 2 +- .../ui/src/components/fields/switch-field.tsx | 8 ++- 8 files changed, 87 insertions(+), 89 deletions(-) diff --git a/apps/client/src/components/citizen/weapons/register-weapon-modal.tsx b/apps/client/src/components/citizen/weapons/register-weapon-modal.tsx index a9b5946bd..d927f3a62 100644 --- a/apps/client/src/components/citizen/weapons/register-weapon-modal.tsx +++ b/apps/client/src/components/citizen/weapons/register-weapon-modal.tsx @@ -3,7 +3,7 @@ import { Form, Formik, FormikHelpers } from "formik"; import { useRouter } from "next/router"; import { WEAPON_SCHEMA } from "@snailycad/schemas"; import { FormField } from "components/form/FormField"; -import { Loader, Input, Button, Item, AsyncListSearchField } from "@snailycad/ui"; +import { Loader, Input, Button, Item, AsyncListSearchField, SwitchField } from "@snailycad/ui"; import { Modal } from "components/modal/Modal"; import useFetch from "lib/useFetch"; import { useValues } from "src/context/ValuesContext"; @@ -23,7 +23,6 @@ import { filterLicenseType, filterLicenseTypes } from "lib/utils"; import { toastMessage } from "lib/toastMessage"; import { CitizenSuggestionsField } from "components/shared/CitizenSuggestionsField"; import type { PostCitizenWeaponData, PutCitizenWeaponData } from "@snailycad/types/api"; -import { Toggle } from "components/form/Toggle"; import { ValueSelectField } from "components/form/inputs/value-select-field"; interface Props { @@ -111,7 +110,7 @@ export function RegisterWeaponModal({ weapon, onClose, onCreate, onUpdate }: Pro className="w-[600px]" > - {({ handleChange, setValues, errors, values, isValid }) => ( + {({ handleChange, setFieldValue, setValues, errors, values, isValid }) => (
{CUSTOM_TEXTFIELD_VALUES ? ( @@ -174,14 +173,14 @@ export function RegisterWeaponModal({ weapon, onClose, onCreate, onUpdate }: Pro {weapon ? ( - - - + setFieldValue("reApplyForDmv", isSelected)} + isDisabled={weapon.bofStatus !== WhitelistStatus.DECLINED} + > + {tVehicle("reApplyForDmv")} + ) : null}