Skip to content

Commit

Permalink
Add use client directive
Browse files Browse the repository at this point in the history
  • Loading branch information
ad956 committed Jul 28, 2024
1 parent c198fb1 commit 9459415
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/(pages)/admin/components/LoginForm/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { useState, useEffect } from "react";
import { Input, Button, Link, Card, Image } from "@nextui-org/react";
import { AiOutlineEyeInvisible, AiTwotoneEye } from "react-icons/ai";
Expand All @@ -16,13 +18,13 @@ export default function LoginForm() {
const [userData, setUserData] = useState({ email: "", role: "", action: "" });
const [loginDisabled, setLoginDisabled] = useState(true);

function handleEmailChange(e) {
function handleEmailChange(e: any) {
const error = FormValidator.validateEmail(e.target.value);
formValidator.setError("email", error);
setEmail(e.target.value);
}

function handlePasswordChange(e) {
function handlePasswordChange(e: any) {
const error = FormValidator.validatePassword(e.target.value);
formValidator.setError("password", error);
setPassword(e.target.value);
Expand All @@ -34,7 +36,7 @@ export default function LoginForm() {
setLoginDisabled(formValidator.hasErrors() || !email || !password);
}, [email, password]);

async function handleFormSubmit(e) {
async function handleFormSubmit(e: any) {
e.preventDefault();
const formData = new FormData(e.currentTarget);

Expand Down
2 changes: 2 additions & 0 deletions app/(pages)/admin/components/PinVerification/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { useState, useEffect } from "react";
import { Card, Input, Button } from "@nextui-org/react";

Expand Down

0 comments on commit 9459415

Please sign in to comment.