-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from HunnySajid/feat/auto-signin
feat: add auto signin functionality
- Loading branch information
Showing
6 changed files
with
155 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
const icon = ( | ||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<path | ||
d="M20 12C20 7.58172 16.4183 4 12 4M12 20C14.5264 20 16.7792 18.8289 18.2454 17" | ||
stroke="white" | ||
stroke-width="1.5" | ||
stroke-linecap="round" | ||
/> | ||
<path | ||
d="M4 12H14M14 12L11 9M14 12L11 15" | ||
stroke="white" | ||
stroke-width="1.5" | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
/> | ||
</svg> | ||
); | ||
|
||
export function CustomSwitch({ handleToggle, isChecked }): JSX.Element { | ||
// const [isChecked, setIsChecked] = useState(false); | ||
// const [selectedIcon, setSelectedIcon] = useState(icon); | ||
|
||
// const handleToggle = () => { | ||
// const updateChecked = !isChecked; | ||
// setIsChecked(updateChecked); | ||
// // setTimeout(() => { | ||
// // setSelectedIcon(updateChecked ? icon : icon); | ||
// // }, 250); | ||
// }; | ||
|
||
return ( | ||
<button | ||
className={`w-12 h-6 rounded-full flex items-center transition duration-300 focus:outline-none shadow bg-gray-light ${ | ||
isChecked ? "border border-green" : " " | ||
}`} | ||
onClick={handleToggle} | ||
> | ||
<div | ||
id="switch-toggle" | ||
className={` w-6 h-6 relative rounded-full transition duration-500 transform p-1 text-white ${ | ||
isChecked | ||
? "bg-green translate-x-full" | ||
: " bg-gray-light -translate-x-1" | ||
}`} | ||
> | ||
{icon} | ||
</div> | ||
</button> | ||
); | ||
} |
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
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