Skip to content

Commit

Permalink
Merge pull request #77 from SH5H/jsconvert
Browse files Browse the repository at this point in the history
Convert JS to TS
  • Loading branch information
vmatsiiako authored Dec 6, 2022
2 parents 1e16a18 + 9e73b34 commit baacc31
Show file tree
Hide file tree
Showing 12 changed files with 299 additions and 219 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
import React from "react";
import { useState } from "react";
import React, { useState } from "react";
import { useRouter } from "next/router";
import {
faCircle,
faCircleExclamation,
faE,
faEye,
faEyeSlash,
} from "@fortawesome/free-solid-svg-icons";
import { faCircle, faEye, faEyeSlash } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";

import guidGenerator from "../utilities/randomId";
import Error from "./Error";

const InputField = (props) => {
interface InputFieldProps {
static?: boolean;
label: string;
type: string;
value: string;
placeholder?: string;
isRequired: boolean;
disabled?: boolean;
error?: boolean;
text?: string;
name?: string;
blurred?: boolean;
errorText?: string;
onChangeHandler: (value: string) => void;
}

const InputField = (props: InputFieldProps) => {
const [passwordVisible, setPasswordVisible] = useState(false);
const router = useRouter();

Expand Down Expand Up @@ -67,7 +75,7 @@ const InputField = (props) => {
>
<input
onChange={(e) => props.onChangeHandler(e.target.value)}
type={passwordVisible == false ? props.type : "text"}
type={passwordVisible === false ? props.type : "text"}
placeholder={props.placeholder}
value={props.value}
required={props.isRequired}
Expand Down
Loading

0 comments on commit baacc31

Please sign in to comment.