-
-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathgeneral_settings.js
More file actions
47 lines (39 loc) · 1.28 KB
/
general_settings.js
File metadata and controls
47 lines (39 loc) · 1.28 KB
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
import React from 'react'
import SettingEditor from './setting_editor';
import ModelBinding from './model_binding';
import ServiceContext from './service_context';
class GeneralSettings extends React.PureComponent
{
constructor(props, context)
{
super(props, context);
this.state = this.getStateFromModel();
}
getStateFromModel()
{
const { showPlaybackInfo } = this.context.settingsModel;
return {
showPlaybackInfo
};
}
render()
{
const model = this.context.settingsModel;
const { showPlaybackInfo } = this.state;
return (
<form>
<SettingEditor settingKey='windowTitleExpression' />
<SettingEditor settingKey='fullWidth' />
<SettingEditor settingKey='fontSize' />
<SettingEditor settingKey='inputMode' />
<SettingEditor settingKey='showPlaybackInfo' />
<SettingEditor settingKey='playbackInfoExpression' disabled={!showPlaybackInfo} />
<SettingEditor settingKey='enableNotification' />
</form>
);
}
}
GeneralSettings.contextType = ServiceContext;
export default ModelBinding(GeneralSettings, {
settingsModel: 'showPlaybackInfoChange',
});