This repository has been archived by the owner on Sep 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 89
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 #70 from MichaelYuhe/feat/beta-feature-flags
refactor: options page
- Loading branch information
Showing
2 changed files
with
170 additions
and
67 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,27 @@ | ||
export default function Switch({ | ||
isChecked, | ||
onChange, | ||
text, | ||
}: { | ||
isChecked: boolean; | ||
onChange: () => void; | ||
text: string; | ||
}) { | ||
return ( | ||
<div className="flex items-center mt-2"> | ||
<label className="relative inline-flex cursor-pointer items-center"> | ||
<input | ||
id="switch" | ||
type="checkbox" | ||
checked={isChecked} | ||
className="peer sr-only" | ||
onClick={onChange} | ||
/> | ||
<label htmlFor="switch" className="hidden"></label> | ||
<div className="peer h-6 w-11 rounded-full border bg-slate-200 after:absolute after:left-[2px] after:top-0.5 after:h-5 after:w-5 after:rounded-full after:border after:border-gray-300 after:bg-white after:transition-all after:content-[''] peer-checked:bg-primary peer-checked:after:translate-x-full peer-checked:after:border-white peer-focus:ring-green-300"></div> | ||
</label> | ||
|
||
<span className="ml-3 text-gray-900 text-sm">{text}</span> | ||
</div> | ||
); | ||
} |
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