Skip to content

Commit

Permalink
feat(home): use nextui input
Browse files Browse the repository at this point in the history
  • Loading branch information
escapedcat committed Nov 12, 2024
1 parent 70078b3 commit efef695
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/pages/Home/UnlockModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import {
ConfirmModal,
type Props as ConfirmModalProps,
} from "@/components/ConfirmModal";
import InputField from "@/components/InputField";
import { AppContext } from "@/context/app-context";
import useCapsLock from "@/hooks/use-caps-lock";
import { instance } from "@/utils/interceptor";
import { Input } from "@nextui-org/react";
import { useContext, useState } from "react";
import type { SubmitHandler } from "react-hook-form";
import { useForm } from "react-hook-form";
Expand Down Expand Up @@ -67,16 +67,21 @@ export default function UnlockModal({
{isCapsLockEnabled && <CapsLockWarning />}

<fieldset className="flex w-full flex-col gap-4">
<InputField
<Input
className="w-full"
classNames={{
inputWrapper:
"bg-tertiary group-data-[focus=true]:bg-tertiary group-data-[hover=true]:bg-tertiary",
}}
disabled={isLoading}
type="password"
label={t("forms.validation.unlock.pass_c")}
placeholder={t("forms.validation.unlock.pass_c")}
isInvalid={!!errors.passwordInput}
errorMessage={errors.passwordInput?.message}
{...register("passwordInput", {
required: t("forms.validation.unlock.required"),
})}
autoFocus
errorMessage={errors.passwordInput}
label={t("forms.validation.unlock.pass_c")}
placeholder={t("forms.validation.unlock.pass_c")}
type="password"
disabled={isLoading}
{...keyHandlers}
/>
</fieldset>
Expand Down

0 comments on commit efef695

Please sign in to comment.