You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-27 23:28:38 +02:00
Desktop: Add config screen to add, remove or enable, disable plugins
This commit is contained in:
37
packages/app-desktop/gui/lib/ToggleButton/ToggleButton.tsx
Normal file
37
packages/app-desktop/gui/lib/ToggleButton/ToggleButton.tsx
Normal file
@ -0,0 +1,37 @@
|
||||
import { themeStyle } from '@joplin/lib/theme';
|
||||
import * as React from 'react';
|
||||
const ReactToggleButton = require('react-toggle-button');
|
||||
const Color = require('color');
|
||||
|
||||
interface Props {
|
||||
value: boolean;
|
||||
onToggle: Function;
|
||||
themeId: number;
|
||||
}
|
||||
|
||||
export default function(props: Props) {
|
||||
const theme = themeStyle(props.themeId);
|
||||
|
||||
return (
|
||||
<ReactToggleButton
|
||||
value={props.value}
|
||||
onToggle={props.onToggle}
|
||||
colors={{
|
||||
activeThumb: {
|
||||
base: Color(theme.color5).rgb().string(),
|
||||
},
|
||||
active: {
|
||||
base: Color(theme.backgroundColor5).alpha(0.7).rgb().string(),
|
||||
},
|
||||
}}
|
||||
trackStyle={{
|
||||
opacity: props.value ? 1 : 0.3,
|
||||
}}
|
||||
thumbStyle={{
|
||||
opacity: props.value ? 1 : 0.5,
|
||||
}}
|
||||
inactiveLabel=""
|
||||
activeLabel=""
|
||||
/>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user