Skip to content

Commit

Permalink
feat: improve authentication forms (#605)
Browse files Browse the repository at this point in the history
  • Loading branch information
joaodiaslobo authored Dec 17, 2023
1 parent 4705974 commit 198f6f1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
19 changes: 12 additions & 7 deletions components/PasswordInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { forwardRef, useState } from "react";

import { InputBase, InputDefaultProps } from "@components/Input";

import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faEye, faEyeSlash } from "@fortawesome/free-solid-svg-icons";
import { EyeIcon, EyeOffIcon } from "@heroicons/react/solid";

export default forwardRef<HTMLInputElement, InputDefaultProps>(
function PasswordInput(
Expand Down Expand Up @@ -34,11 +33,17 @@ export default forwardRef<HTMLInputElement, InputDefaultProps>(
ref={ref}
{...rest}
/>
<FontAwesomeIcon
className="mx-2 cursor-pointer"
onClick={togglePasswordVisibility}
icon={isPasswordVisible ? faEyeSlash : faEye}
/>
{isPasswordVisible ? (
<EyeOffIcon
className="mx-2 h-5 cursor-pointer"
onClick={togglePasswordVisibility}
/>
) : (
<EyeIcon
className="mx-2 h-5 cursor-pointer"
onClick={togglePasswordVisibility}
/>
)}
</InputBase>
);
}
Expand Down
16 changes: 16 additions & 0 deletions styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,19 @@ canvas {
-webkit-text-stroke-color: currentColor;
-webkit-text-stroke-width: 0.25px;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
/* Revert text color */
-webkit-text-fill-color: white !important;
color: white !important;
caret-color: white !important;

/* Revert background color */
transition: background-color 5000s ease-in-out 0s;
}
input:autofill {
background: transparent !important;
}

0 comments on commit 198f6f1

Please sign in to comment.