-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSettings.jsx
69 lines (67 loc) · 2.43 KB
/
Settings.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
const { React } = require('powercord/webpack');
const { SwitchItem, TextInput } = require('powercord/components/settings');
module.exports = class Settings extends React.Component {
render () {
const { getSetting, toggleSetting, updateSetting } = this.props;
return (
<div>
<SwitchItem
note={'Use YeeLight lights with Lightify'}
value={getSetting('YeeLight', false)}
onChange={() => toggleSetting('YeeLight')}
>
Yeelight
</SwitchItem>
<SwitchItem
note={'Use Lifx lights with Lightify'}
value={getSetting('Lifx', false)}
onChange={() => toggleSetting('Lifx')}
>
Lifx
</SwitchItem>
<SwitchItem
note={'Turn on the light if the light is off'}
value={getSetting('AutoOn', true)}
onChange={() => toggleSetting('AutoOn')}
>
Auto-On
</SwitchItem>
<TextInput
note={'Set the IP address of the YeeLight light you want to use!'}
value={getSetting('BulbIP', '192.168.0.100')}
onChange={val => updateSetting('BulbIP', val)}
>
Yeelight Device IP
</TextInput>
<TextInput
note={'Enter the device name of the Lifx lamp you want to pulse!'}
value={getSetting('LifxName', 'MyCeilingLight')}
onChange={val => updateSetting('LifxName', val)}
>
Lifx Device Name
</TextInput>
<TextInput
note={'Set the brightness of the YeeLight light when it\'s pulsed.'}
value={getSetting('BulbBright', 100)}
onChange={(val) => updateSetting('BulbBright', (Number(val) && Number(val) >= 1) ? Number(val) : 1, 100)}
>
YeeLight Brightness
</TextInput>
<TextInput
note={'Set the color you want the light to flash when you get mentioned. For example, #00ff00 would make it green.'}
value={getSetting('BulbColor', '#7289DA')}
onChange={val => updateSetting('BulbColor', val)}
>
Lamp Color
</TextInput>
<TextInput
note={'Set the time the light needs to stay the mention color for when you are mentioned.'}
value={getSetting('BulbDuration', 250)}
onChange={(val) => updateSetting('BulbDuration', (Number(val) && Number(val) >= 1) ? Number(val) : 1)}
>
Pulse Duration
</TextInput>
</div>
);
}
};