-
Notifications
You must be signed in to change notification settings - Fork 324
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add global toggle to Preferences screen
- Loading branch information
Showing
4 changed files
with
40 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
'use strict' | ||
/* eslint-env browser, webextensions */ | ||
|
||
const browser = require('webextension-polyfill') | ||
const html = require('choo/html') | ||
|
||
function globalToggleForm ({ active, onOptionChange }) { | ||
const toggle = onOptionChange('active') | ||
return html` | ||
<form class="dib mb3"> | ||
<label for="active" class="dib pa3 pointer ${!active ? 'bg-aqua-muted br2' : ''}"> | ||
<input class="mr2 pointer" id="active" type="checkbox" onchange=${toggle} checked=${active} /> | ||
${browser.i18n.getMessage('panel_headerActiveToggleTitle')} | ||
</label> | ||
</form> | ||
` | ||
} | ||
|
||
module.exports = globalToggleForm |
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