diff --git a/config/index.js b/config/index.js index 17e82b29..774a5a97 100644 --- a/config/index.js +++ b/config/index.js @@ -19,7 +19,7 @@ module.exports = { session_data_storage: 'data', appTheme_container: 'app_theme', - appTheme_desiredContrast: 4.5, + appTheme_desiredContrast: 7, // Contrast level AA = 4.5, Level AAA = 7 // Reference: https://www.w3.org/WAI/WCAG21/quickref/?versions=2.0&showtechniques=143#qr-visual-audio-contrast-contrast @@ -58,6 +58,11 @@ module.exports = { post_hidebar: true, feed_autorefresh: false, + keybinds: { + nextElement: "J", + prevElement: "U", + createNew: "N" + } }, stricts: { diff --git a/package.json b/package.json index 932d1c04..f885b294 100755 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "electron-updater": "^4.3.4", "enquire-js": "^0.2.1", "feather-reactjs": "^2.0.13", + "heroicons": "^0.4.2", "html2canvas": "^1.0.0-rc.7", "jquery": "^3.5.1", "jsonwebtoken": "^8.5.1", @@ -60,6 +61,7 @@ "moment": "^2.28.0", "node-sass": "^4.13.1", "nprogress": "^0.2.0", + "package": "^1.0.1", "path-to-regexp": "^6.1.0", "platform": "^1.3.6", "radium": "^0.26.0", diff --git a/public/logo.svg b/public/logo.svg index 97bafc18..cda37e29 100755 --- a/public/logo.svg +++ b/public/logo.svg @@ -1,18 +1,22 @@ - + - - + + - - - - - - - - - - + + + + + + + + + + - + \ No newline at end of file diff --git a/src/components/Icons/custom.js b/src/components/Icons/custom.js index add1bb67..c1d9be1b 100644 --- a/src/components/Icons/custom.js +++ b/src/components/Icons/custom.js @@ -1 +1,13 @@ -export const VerifiedBadge = () => ( ) \ No newline at end of file +const marginedStyle = { width: "1em", height: "1em", marginRight: "10px", verticalAlign: "-0.125em" } + +export const verifiedBadge = () => +export const lightningBolt = () => +export const sparkles = () => +export const statusOnline = () => +export const fingerprint = () => +export const colorSwatch = () => +export const collection = () => +export const cubeTransparent = () => +export const keyRound = () => +export const searchCircles = () => +export const template = () => \ No newline at end of file diff --git a/src/components/Icons/index.js b/src/components/Icons/index.js index 352e82b1..72af797d 100644 --- a/src/components/Icons/index.js +++ b/src/components/Icons/index.js @@ -1,4 +1,4 @@ export * from 'feather-reactjs' export * from '@ant-design/icons' export * from './custom' -export * from '@icons-pack/react-simple-icons' \ No newline at end of file +export * from '@icons-pack/react-simple-icons' diff --git a/src/core/index.js b/src/core/index.js index cf9d7bb8..f2de3632 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -198,9 +198,9 @@ export function objectToArray(object) { const keys = Object.keys(object) const values = Object.values(object) - const lenght = keys.length + const sourceLength = keys.length - for (let i = 0; i < lenght; i++) { + for (let i = 0; i < sourceLength; i++) { let obj = {} obj.key = keys[i] obj.value = values[i] diff --git a/src/core/libs/style/index.js b/src/core/libs/style/index.js index c468e6e0..608f02b3 100644 --- a/src/core/libs/style/index.js +++ b/src/core/libs/style/index.js @@ -2,7 +2,6 @@ import store from 'store'; import { app_config } from 'config'; import verbosity from 'core/libs/verbosity' import * as errorHandlers from 'core/libs/errorhandler' -import * as core from 'core' const { appTheme_desiredContrast, appTheme_container } = app_config @@ -17,8 +16,6 @@ export const theme = { return errorHandlers.onError.invalid_data(error, "ThemeScheme") } return container - - }, set: (data) => { if (!data || data.length > 2) return false diff --git a/src/models/app.js b/src/models/app.js index 16a0938e..e5e480a7 100755 --- a/src/models/app.js +++ b/src/models/app.js @@ -29,7 +29,7 @@ export default { contextMenu: { visible: false, - fragment: "WooW, whats happening here!", + fragment: null, yPos: 0, xPos: 0 }, diff --git a/src/pages/settings/components/base.js b/src/pages/settings/components/base.js index cb5cfd60..011cf2de 100755 --- a/src/pages/settings/components/base.js +++ b/src/pages/settings/components/base.js @@ -107,9 +107,6 @@ class Base extends Component { return (
-

- Behaviors -

{ + if (!info) return null + return( +
+
umi{info.g_umi.version}
+
react{info.react_version}
+
{info.process.versions.v8}
+
{info.process.version}
+
{info.process.versions.electron}
+
Webpack
+
Socket.io
+
JS
+
TS
+
WebAssembly
+
OpenAI
+
+ ) +} + @connect(({ app }) => ({ app })) export default class ElectronSettings extends React.PureComponent{ @@ -17,7 +38,9 @@ export default class ElectronSettings extends React.PureComponent{ loading: false, info: { g_umi: window.g_umi, - process: window.process + process: window.process, + react_version: React.version, + deps: objectToArray(package_json.dependencies) } }) } @@ -26,48 +49,42 @@ export default class ElectronSettings extends React.PureComponent{ this.getInfo() } + render(){ - const { info } = this.state + const showAppTech = () => { + antd.Modal.info({ + title: package_json.title, + content: AppTech(this.state.info), + width: 550 + }) + } + + const showThirdParty = () => { + const generateList = () => { + return this.state.info.deps.map((e) => { + return( +
+ -> {e.key} {e.value.slice(1,e.value.length)} +
+ ) + }) + } + + antd.Modal.info({ + title: package_json.title, + content: generateList(), + width: 550 + }) + } + + if (this.state.loading){ + return + } return(
-

- Application Settings -

-
- { this.state.loading - ? - :
-
umi{info.g_umi.version}
-
react
-
{info.process.versions.v8}
-
{info.process.version}
-
{info.process.versions.electron}
-
{info.process.versions.openssl}
-
CCS3
-
Yarn
-
npm
-
.jpeg
-
JSON
-
WebGL
-
Auth0
-
Babel
-
Redux
-
Gitlab
-
jQuery
-
Webpack
-
Socket.io
-
JS
-
TS
-
WebAssembly
-
OpenAI
-
HP
-
Simple Icons
-
Google Chrome
-
VisualStudio Code
-
- } + showAppTech()}> App Technologies + showThirdParty()}> Third-Party
-
) } } \ No newline at end of file diff --git a/src/pages/settings/components/electron/index.less b/src/pages/settings/components/electron/index.less index 0a298fa6..808ab280 100644 --- a/src/pages/settings/components/electron/index.less +++ b/src/pages/settings/components/electron/index.less @@ -1,4 +1,5 @@ .versions{ + overflow: scroll; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); diff --git a/src/pages/settings/components/keybinds/index.js b/src/pages/settings/components/keybinds/index.js new file mode 100644 index 00000000..c2e116e5 --- /dev/null +++ b/src/pages/settings/components/keybinds/index.js @@ -0,0 +1,17 @@ +import React from 'react' +import * as Icons from 'components/Icons' +import * as antd from 'antd' +import verbosity from 'core/libs/verbosity' +import settings from 'core/libs/settings' +import {connect} from 'umi' + +@connect(({ app }) => ({ app })) +export default class Keybinds extends React.Component { + render() { + return <> + + + + } +} + diff --git a/src/pages/settings/components/notification/index.js b/src/pages/settings/components/notification/index.js index be05a377..2b712970 100755 --- a/src/pages/settings/components/notification/index.js +++ b/src/pages/settings/components/notification/index.js @@ -6,9 +6,7 @@ export default class NotificationView extends React.Component { render() { return (
-

- Notifications -

+
) } diff --git a/src/pages/settings/components/plugins/index.js b/src/pages/settings/components/plugins/index.js new file mode 100644 index 00000000..23344173 --- /dev/null +++ b/src/pages/settings/components/plugins/index.js @@ -0,0 +1,18 @@ +import React from 'react' +import * as Icons from 'components/Icons' +import * as antd from 'antd' +import verbosity from 'core/libs/verbosity' +import settings from 'core/libs/settings' +import {connect} from 'umi' + +@connect(({ app }) => ({ app })) +export default class Plugins extends React.Component { + render() { + return <> + + + + + } +} + diff --git a/src/pages/settings/components/security/index.js b/src/pages/settings/components/security/index.js index dc6047b5..ce0a704b 100755 --- a/src/pages/settings/components/security/index.js +++ b/src/pages/settings/components/security/index.js @@ -35,8 +35,6 @@ export default class SecurityView extends React.Component { render() { return (
-

- Your Security & Privacy
{this.renderChildren()}
-

) } diff --git a/src/pages/settings/components/theme/index.js b/src/pages/settings/components/theme/index.js index 055f9398..9dae9d41 100644 --- a/src/pages/settings/components/theme/index.js +++ b/src/pages/settings/components/theme/index.js @@ -289,7 +289,6 @@ export default class ThemeSettings extends React.Component{ const isActive = (key) => { return key? key.active : false } return(
-

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 { this.selectKey(key)} + onClick={({key}) => this.selectKey(key)} > {this.getMenu()} 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 {