-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSettings.jsx
109 lines (106 loc) · 4.35 KB
/
Settings.jsx
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
const { React } = require('powercord/webpack');
const { Category, SwitchItem, TextInput, SelectInput } = require('powercord/components/settings');
module.exports = class Settings extends React.PureComponent {
constructor(props) {
super(props);
this.state = {
looks: false,
things: false
}
}
render() {
const { getSetting, toggleSetting, updateSetting } = this.props;
return (
<>
<Category
name="Toggles"
description="Here you can change what shows up in the invite."
opened={this.state.things}
onChange={() => this.setState({things:!this.state.things})}
>
<SwitchItem
value={getSetting("banner", true)}
onChange={() => toggleSetting("banner")}
>
Server Banner (If available)
</SwitchItem>
<SwitchItem
value={getSetting("avatar", true)}
onChange={() => toggleSetting("avatar")}
>
Inviter PFP
</SwitchItem>
<SwitchItem
value={getSetting("nsfw", true)}
onChange={() => toggleSetting("nsfw")}
>
NSFW warning
</SwitchItem>
<SwitchItem
value={getSetting("boost", true)}
onChange={() => toggleSetting("boost")}
>
Server Boost level indicator
</SwitchItem>
<SwitchItem
value={getSetting("verification", true)}
onChange={() => toggleSetting("verification")}
>
Verification level indicator
</SwitchItem>
<SwitchItem
value={getSetting("force-member-count", false)}
onChange={() => toggleSetting("force-member-count")}
note="When enabled, the member count replaces the channel."
>
Force Member Count
</SwitchItem>
</Category>
<Category
name={"Customization"}
description={"Here you can change what stuff looks like."}
opened={this.state.looks}
onChange={() => this.setState({looks:!this.state.looks})}
>
<TextInput
defaultValue={getSetting("borderradius", 28)}
placeholder={28}
required={false}
onChange={(val) => {
if (!isNaN(val) && isFinite(val) && /^\d+$/.test(val))
updateSetting("borderradius", Number(val));
if (!val) updateSetting("borderradius", 28);
}}
>
Border Radius (Changes how round everything looks) (Only accepts
numbers)
</TextInput>
<SelectInput
value={getSetting("position", "banner-right")}
options={[
{
value: "banner-left",
label: "Banner Left",
},
{
value: "banner-middle",
label: "Banner Middle",
},
{
value: "banner-right",
label: "Banner Right",
},
{
value: "join-button",
label: "Join Button",
},
]}
onChange={(res) => updateSetting("position", res.value)}
>
Select where the icons get displayed
</SelectInput>
</Category>
</>
)
}
}