forked from b00tc4mp/isdi-parttime-202403
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update README; create PasswordField component and apply at app; imple…
…ment custom alert; refactor invoiceInfo and deliveryInfo; #b00tc4mp#156
- Loading branch information
Showing
6 changed files
with
65 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
staff/jose-canto/project/FactuClient/src/components/PasswordField/index.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { useState } from "react" | ||
import { MdVisibility, MdVisibilityOff } from "react-icons/md" | ||
import Field from "../core/Field" | ||
|
||
const PasswordField = ({ id, placeholder }) => { | ||
const [showPassword, setShowPassword] = useState(false) | ||
|
||
const togglePasswordVisibility = () => { | ||
setShowPassword(!showPassword) | ||
} | ||
|
||
return ( | ||
<div className="relative"> | ||
<Field id={id} type={showPassword ? "text" : "password"} placeholder={placeholder} /> | ||
<span className="absolute left-[15.5rem] top-[2.1rem] cursor-pointer text-3xl" onClick={togglePasswordVisibility}> | ||
{showPassword ? <MdVisibilityOff /> : <MdVisibility />} | ||
</span> | ||
</div> | ||
) | ||
} | ||
|
||
export default PasswordField |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters