-
Notifications
You must be signed in to change notification settings - Fork 813
/
config.js
71 lines (61 loc) · 1.8 KB
/
config.js
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
70
71
import React from 'react';
import {Provider} from 'unstated';
import {ipcRenderer as ipc} from 'electron-better-ipc';
import {ConfigContainer} from '../containers';
import Config from '../components/config';
import WindowHeader from '../components/window-header';
const configContainer = new ConfigContainer();
export default class ConfigPage extends React.Component {
state = {pluginName: ''}
componentDidMount() {
ipc.answerMain('plugin', pluginName => {
configContainer.setPlugin(pluginName);
this.setState({pluginName: pluginName.replace(/^kap-/, '')});
});
}
render() {
const {pluginName} = this.state;
return (
<div className="root">
<div className="cover-window">
<Provider inject={[configContainer]}>
<WindowHeader title={pluginName}/>
<Config/>
</Provider>
</div>
<style jsx global>{`
html {
font-size: 62.5%;
}
html,
body,
.cover-window {
margin: 0;
width: 100vw;
height: 100vh;
font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
}
:root {
--background-color: #ffffff;
--button-color: var(--kap);
}
.dark .cover-window {
--background-color: #313234;
--button-color: #2182f0;
}
.cover-window {
background-color: var(--background-color);
z-index: -2;
display: flex;
flex-direction: column;
font-size: 1.4rem;
line-height: 1.5em;
-webkit-font-smoothing: antialiased;
letter-spacing: -.01rem;
cursor: default;
}
`}</style>
</div>
);
}
}