-
Theme
,
about:
,
+ keybinds:
,
theme:
,
- earnings:
,
+ plugins:
,
security:
,
notification:
,
app:
}
-
-const { Item } = Menu
-
const menuList = [
{
key: "base",
title: "General",
- icons:
,
+ icon:
,
},
{
key: "app",
title: "Application",
- icons:
,
+ icon:
,
require: "embedded"
},
+ {
+ key: "keybinds",
+ title: "Keybinds",
+ icon:
+ },
{
key: "theme",
title: "Customization",
- icons:
,
+ icon:
,
+ },
+ {
+ key: "plugins",
+ title: "Plugins",
+ icon:
,
},
{
key: "security",
title: "Security & Privacity",
- icons:
,
+ icon:
,
},
{
key: "notification",
title: "Notification",
- icons:
,
+ icon:
,
},
{
key: "help",
title: "Help",
- icons:
,
+ icon:
,
},
{
key: "about",
title: "About",
- icons:
,
- },
+ icon:
,
+ }
]
-import { connect } from 'umi';
-
@connect(({ app }) => ({ app }))
class GeneralSettings extends React.PureComponent {
- constructor(props) {
- super(props)
- this.state = {
- loading: true,
- selectKey: 'base',
- menus: []
- }
+ state = {
+ loading: true,
+ selectKey: 'base',
+ menus: []
}
requireQuery(require){
@@ -113,9 +118,9 @@ class GeneralSettings extends React.PureComponent {
getMenu() {
return this.state.menus.map(item => (
-
-
- {item.icons} {item.title}
-
+
+ {item.icon} {item.title}
+
))
}
selectKey = key => {
@@ -125,8 +130,17 @@ class GeneralSettings extends React.PureComponent {
}
renderChildren = () => {
+ let titlesArray = []
+ this.state.menus.forEach(e => {
+ titlesArray[e.key] = e
+ })
if(this.state.selectKey){
- return Settings[this.state.selectKey]
+ return <>
+
+
{titlesArray[this.state.selectKey].icon || null}{titlesArray[this.state.selectKey].title || null}
+
+ {Settings[this.state.selectKey]}
+ >
}else{
Select an setting
}
@@ -150,7 +164,7 @@ class GeneralSettings extends React.PureComponent {
diff --git a/src/pages/settings/style.less b/src/pages/settings/style.less
index fda2b036..ed38fe06 100755
--- a/src/pages/settings/style.less
+++ b/src/pages/settings/style.less
@@ -13,6 +13,7 @@
border-radius: 10px;
.leftMenu {
+ user-select: none;
width: 224px;
:global {
.ant-menu-inline {