-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
39 lines (35 loc) · 1.04 KB
/
index.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
exports.decorateConfig = (config) => {
return Object.assign({}, config, {
css: `
${config.css || ''}
.tabs_nav.tabs_hiddenNav {
display: block;
}
.tabs_list {
margin-right: 36px;
}
.tab_new {
position: absolute;
top: 0;
right: 0;
width: 36px;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
font-size: large;
color: #fff;
}
`
});
};
exports.decorateTabs = (Tabs, { React }) => {
const newTab = () => window.rpc.emit('new');
return class extends Tabs {
render() {
const newTabButton = React.createElement('div', { className: 'tab_new', onClick: newTab }, '+');
const tabs = React.createElement(Tabs, Object.assign({}, this.props, { customChildren: newTabButton }));
return tabs;
}
};
};