1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-08-02 11:30:22 +02:00

add switch component

This commit is contained in:
Kushagra Gour
2018-08-14 23:56:46 +05:30
parent 53193bf56b
commit ec4ce2be29
2 changed files with 84 additions and 13 deletions

View File

@@ -1,5 +1,6 @@
import { h, Component } from 'preact';
import { editorThemes } from '../editorThemes';
import Switch from './Switch';
function CheckboxSetting({
title,
@@ -10,18 +11,19 @@ function CheckboxSetting({
showWhenExtension
}) {
return (
<label
class={`line ${showWhenExtension ? 'show-when-extension' : ''} `}
title={title}
>
<input
type="checkbox"
checked={pref}
onChange={onChange}
data-setting={name}
/>{' '}
{label}
</label>
// <label
// class={`line ${showWhenExtension ? 'show-when-extension' : ''} `}
// title={title}
// >
// <input
// type="checkbox"
// checked={pref}
// onChange={onChange}
// data-setting={name}
// />{' '}
// {label}
// </label>
<Switch checked={pref}>{label}</Switch>
);
}
export default class Settings extends Component {
@@ -208,7 +210,7 @@ export default class Settings extends Component {
</label>
</div>
</div>
<div class="ml-2 ml-0--mobile">
<div class="flex-grow ml-2 ml-0--mobile">
<CheckboxSetting
name="lineWrap"
title="Toggle wrapping of long sentences onto new line"