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
|
// this part was mostly copied from an example
// Grab any variables you need
const react = Spicetify.React;
const reactDOM = Spicetify.ReactDOM;
const {
URI,
React: { useState, useEffect, useCallback },
Platform: { History },
} = Spicetify;
// this is called when the page is open
function render() {
startListener(); //I added this
enableBetterLib(); //And this
return react.createElement(Grid, { title: "Opened in the center pane" });
}
//builds components of the page
class Grid extends react.Component {
constructor(props) {
super(props);
Object.assign(this, props);
this.state = {
foo: "bar", //dont know what these do but its working so ill leave them be
data: "etc"
};
}
render() {
return react.createElement("section", {
className: "betterLibSection",
},
react.createElement("div",{
className: "betterLibBox"
},
react.createElement("div", {
className: "betterLibText",
},
react.createElement("h4", null, this.props.title),
),
)
);
}
}
|