-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.tsx
38 lines (31 loc) · 1020 Bytes
/
index.tsx
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
import { UPlugin } from '@classes';
import { React } from '@webpack';
import { join } from 'path';
import { existsSync } from 'fs';
import { SettingsErrorBoundary } from './components/Settings';
const CodemirrorCSS = require('codemirror/lib/codemirror.css');
const MaterialCSS = require('codemirror/theme/material.css');
const quickCssPath = join(__dirname, 'quickcss.css');
export default class QuickCSS extends UPlugin {
public quickCss = existsSync(quickCssPath) ? require('./quickcss.css') : '';
start(): void {
CodemirrorCSS.attach();
MaterialCSS.attach();
if (this.quickCss !== '') this.quickCss.attach();
this.__uSettingsTabs = {
sections: [
{
section: 'QuickCSS',
label: 'QuickCSS settings',
element: (): React.ReactElement<SettingsErrorBoundary> => <SettingsErrorBoundary />
}
]
};
}
stop(): void {
CodemirrorCSS.detach();
MaterialCSS.detach();
this.quickCss.detach();
this.__uSettingsTabs = {};
}
}