-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b386862
commit 5a6389a
Showing
5 changed files
with
35 additions
and
27 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
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 |
---|---|---|
@@ -1,19 +1,21 @@ | ||
import "./flipswitch.scss"; | ||
|
||
const FlipSwitch = ({ value, onChange, checked, defaultChecked, label }) => ( | ||
<div className="flipSwitch"> | ||
<p>{label}</p> | ||
<label className="flipSwitchLabel"> | ||
<input | ||
type="checkbox" | ||
value={value} | ||
onChange={(e) => onChange(e.target.checked)} | ||
checked={checked} | ||
defaultChecked={defaultChecked} | ||
/> | ||
<span className="slider"></span> | ||
</label> | ||
</div> | ||
); | ||
const FlipSwitch = ({ value, onChange, checked, defaultChecked, label }) => (<> | ||
<div className="flipSwitch"> | ||
<p>{label}</p> | ||
</div> | ||
<div className="flipSwitch"> | ||
<label className="flipSwitchLabel"> | ||
<input | ||
type="checkbox" | ||
value={value} | ||
onChange={(e) => onChange(e.target.checked)} | ||
checked={checked} | ||
defaultChecked={defaultChecked} | ||
/> | ||
<span className="slider"></span> | ||
</label> | ||
</div> | ||
</>); | ||
|
||
export default FlipSwitch; |
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