diff --git a/globals/settings.js b/globals/settings.js index e96c7d6f..20b4af10 100755 --- a/globals/settings.js +++ b/globals/settings.js @@ -1,34 +1,32 @@ -module.exports = [ +import * as Icons from 'components/Icons' + +export default [ { id: 'session_noexpire', + icon: , type: 'switch', title: 'No expire session', description: 'Force the app to not expire any session... [Developer]', }, { id: 'search_ontype', + icon: , type: 'switch', title: 'Detect input on search bar', - description: - 'Force the app to automaticly search when a type input is detected... [Developer]', + description: 'Force the app to automaticly search when a type input is detected... [Developer]', }, { id: 'post_hidebar', + icon: , type: 'switch', title: 'Auto hide postbar', - description: 'Force the app to dont hide the post actions (likes, comments ...etc) automaticly... [Developer]', + description: 'Force the app to hide the post actions (likes, comments ...etc) automaticly... [Developer]', }, { id: 'verbosity', + icon: , type: 'switch', title: 'Enable core verbosity', description: 'Show all console logs... [Developer]', - }, - { - id: 'overlay_loosefocus', - type: 'switch', - title: 'Overlay loose focus', - description: 'Close the overlay when loose focus', - }, - + } ] diff --git a/globals/sidebar_menu.js b/globals/sidebar_menu.js index b4e0e18b..1751d121 100644 --- a/globals/sidebar_menu.js +++ b/globals/sidebar_menu.js @@ -46,13 +46,38 @@ export default [ } }, { - id: 'notifications', - title: 'Notifications', - icon: , + id: 'rooms', + title: 'Rooms', + icon: , attributes: { require: 'login' } }, + { + id: 'workshop', + title: 'Workshop', + icon: , + attributes: { + require: 'login' + } + }, + { + id: 'streams', + title: 'Streams', + icon: , + attributes: { + require: 'login' + } + }, + { + id: 'debug', + title: 'Debug', + icon: , + attributes: { + position: "bottom", + require: "dev" + } + }, { id: 'settings', title: 'Settings', diff --git a/main/index.js b/main/index.js index abd5a257..4169839a 100644 --- a/main/index.js +++ b/main/index.js @@ -7,6 +7,7 @@ const { dialog, shell, screen, + BrowserView, globalShortcut } = require('electron'); const path = require('path'); @@ -37,17 +38,22 @@ if (!gotTheLock) { function createWindow() { mainWindow = new BrowserWindow({ + title: packagejson.title, icon: path.join(__dirname, './icon.png'), width: 1100, height: 700, - minWidth: 1100, - minHeight: 700, + minWidth: 1256, + minHeight: 755, show: true, frame: false, transparent: false, + hasShadow: true, + //webgl: true, visualEffectState: "followWindow", backgroundColor: '#00ffffff', webPreferences: { + //enableRemoteModule: true, + enableBlinkFeatures: true, experimentalFeatures: true, nodeIntegration: true, // Disable in dev since I think hot reload is messing with it @@ -103,7 +109,10 @@ function createWindow() { }, { label: 'Reload', - click: () => ipcMain.invoke("appRestart") + click: () => { + app.relaunch(); + mainWindow.close(); + } }, { label: 'Close app', @@ -117,7 +126,6 @@ function createWindow() { tray.on('double-click', () => mainWindow.show()); mainWindow.loadURL(app_path); - if (is.dev()) { mainWindow.webContents.openDevTools(); } @@ -137,7 +145,7 @@ app.on('ready', () => { if (is.dev()) { loadWindow = new BrowserWindow({ width: 700, - height: 600, + height: 500, frame: false, resizable: false, center: true, diff --git a/main/partials/WindowAppBar.css b/main/partials/WindowAppBar.css new file mode 100644 index 00000000..aa77b63e --- /dev/null +++ b/main/partials/WindowAppBar.css @@ -0,0 +1,30 @@ +.WindowAppBar { + -webkit-app-region: drag; + position: relative; + vertical-align: top; + width: 100%; + height: 25px; + z-index: 5000; + background-color: #2d2d2d; +} + +.WindowControl { + float: right; + height: 100%; + padding: 0 20px 0 0; + transition: all 140ms linear; + color: #747474; +} + +.anticon{ + margin: 0 15px 0 15px; + display: inline-block; + color: inherit; + font-style: normal; + vertical-align: middle; + text-align: center; +} + +.WindowControl:hover{ + color: #ffffff; +} \ No newline at end of file diff --git a/main/partials/WindowAppBar.html b/main/partials/WindowAppBar.html new file mode 100644 index 00000000..7ed2737f --- /dev/null +++ b/main/partials/WindowAppBar.html @@ -0,0 +1,25 @@ + + + + + + + + + +
+
+ + + + + + + + + +
+
+ + + \ No newline at end of file diff --git a/main/statics/loading.css b/main/statics/loading.css index 649da376..b6284ab5 100644 --- a/main/statics/loading.css +++ b/main/statics/loading.css @@ -1,33 +1,49 @@ -body { - background-color: transparent; - border-radius: 12px; - resize: none; - font-family: 'Alata', sans-serif; -} -.wrapper { - display: flex; - align-items: center; - justify-content: center; - flex-direction: column; - background-color: #222222; - color: #efefef; - border-radius: 12px; - text-align: center; - padding: 20px; -} -.bouncy-logo { - width: 400px; - height: 400px; - margin: 0 auto; - position: relative; + body { + background-color: transparent; + border-radius: 12px; + font-family: 'Alata', sans-serif; + width: 100vw; + height: 100vh; + overflow: hidden; + user-select: none; + -webkit-app-region: drag; } - .bouncy-logo .ball img { - position: absolute; - height: 200px; + + .wrapper { + position: absolute; + top: 0; + right: 0; + + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + background-color: #efefef; + color: #2d2d2d; + border-radius: 12px; + text-align: center; + + width: 100%; + height: 100%; + } + + .bouncy-logo{ + width: 100%; + height: auto; + margin: auto; + } + + .bouncy-logo .ball { + height: auto; + width: 100%; + transform: translate(-10px, 0); + } + + .bouncy-logo .ball svg { width: 200px; - top: 0; - left: 43%; - transform: translate(-50%, 0); + height: 200px; + margin: auto; + -webkit-animation-direction: alternate; -webkit-animation-duration: 1s; -webkit-animation-name: my-bounce; @@ -37,14 +53,17 @@ body { animation-name: my-bounce; animation-iteration-count: infinite; } + + .shadow{ + width: 100%; + height: auto; + } + .bouncy-logo .ball-shadow { - background: radial-gradient(50% 50%, #ccc 0%, transparent 100%); + margin: auto; + background: radial-gradient(50% 50%, rgba(204, 204, 204, 0.45) 0%, transparent 100%); height: 50px; width: 200px; - position: absolute; - top: 230px; - left: 50%; - transform: translate(-50%, 0); -webkit-animation-direction: alternate; -webkit-animation-duration: 1s; -webkit-animation-name: my-grow; @@ -59,24 +78,20 @@ body { from { width: 200px; height: 50px; - top: 230px; } to { width: 150px; height: 10px; - top: 240px; } } @keyframes my-grow { from { width: 200px; height: 50px; - top: 230px; } to { width: 150px; height: 10px; - top: 240px; } } @-webkit-keyframes my-bounce { diff --git a/main/statics/loading.html b/main/statics/loading.html index 94fa0747..039634a8 100644 --- a/main/statics/loading.html +++ b/main/statics/loading.html @@ -4,8 +4,19 @@
diff --git a/main/statics/loading_dev.html b/main/statics/loading_dev.html index b8b776cc..d45f8e69 100644 --- a/main/statics/loading_dev.html +++ b/main/statics/loading_dev.html @@ -4,8 +4,19 @@

Starting the development server...

diff --git a/package.json b/package.json index c30959e7..48e07be3 100755 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "UUID": "C8mVSr-4nmPp2-pr5Vrz-CU4kg4", "title": "Comty™", "DevBuild": true, - "version": "0.8.30", + "version": "0.9.1", "stage": "dev-pre", "description": "", "author": "RageStudio", @@ -74,8 +74,11 @@ "react-reveal": "^1.2.2", "react-scripts": "^3.4.1", "react-virtualized": "^9.21.2", + "redux-socket.io": "^1.4.0", + "redux-thunk": "^2.3.0", "simple-icons": "^3.3.0", "slash": "^3.0.0", + "socket.io-client": "^2.3.0", "stack-trace": "0.0.10", "store": "^2.0.12", "styled-components": "^5.1.1", diff --git a/src/components/About/index.less b/src/components/About/index.less index 5dd1b8b1..eef5c428 100644 --- a/src/components/About/index.less +++ b/src/components/About/index.less @@ -1,7 +1,7 @@ .aboutWrapper { margin: auto; max-width: 70vw; - width: 500px; + width: 450px; vertical-align: middle; position: relative; background-color: rgba(73, 72, 72, 0.349); diff --git a/src/components/Layout/Overlay/components/Card_Component.tsx b/src/components/Layout/Overlay/components/Card_Component.tsx index d51bbb41..6adfae9e 100644 --- a/src/components/Layout/Overlay/components/Card_Component.tsx +++ b/src/components/Layout/Overlay/components/Card_Component.tsx @@ -4,6 +4,7 @@ import * as Icons from 'components/Icons' import styles from '../index.less' export interface Card_Component_props { + style: object; type: string; children: any; } @@ -18,13 +19,14 @@ const Card_Component = (props: Card_Component_props) => { if (!props.type) frag = (props.children) return( -
+
{frag}
) } Card_Component.defaultProps = { + style: null, type: null, children:

Empty

} diff --git a/src/components/Layout/Overlay/index.less b/src/components/Layout/Overlay/index.less index cb3e34a0..c7466177 100644 --- a/src/components/Layout/Overlay/index.less +++ b/src/components/Layout/Overlay/index.less @@ -43,7 +43,7 @@ height: 100%; // 150px extra for left-sider - width: calc( 100% + 150px ); + width: 87%; backdrop-filter: blur(2px); &.mobile{ overflow-y: scroll; @@ -161,4 +161,11 @@ h2 { color: #ffffff; } + } + + + .mainElement { + > div { + margin: 30px 0; + } } \ No newline at end of file diff --git a/src/components/Layout/Overlay/index.tsx b/src/components/Layout/Overlay/index.tsx index 8bfb66a8..25633105 100644 --- a/src/components/Layout/Overlay/index.tsx +++ b/src/components/Layout/Overlay/index.tsx @@ -4,6 +4,7 @@ import { connect } from 'umi' import classnames from 'classnames' import styles from './index.less' import * as errorhandler from 'core/libs/errorhandler' +import * as antd from 'antd' import { Primary, @@ -95,8 +96,16 @@ export default class Overlay extends React.PureComponent { render() { - const { overlayElement, overlayActive } = this.props.app - + const { overlayElement, overlayActive, session_data, session_valid, session_uuid } = this.props.app + const mainElement = ( +
+
<__searchBar />
+
+ Banana + {session_valid?
@{session_data.username}#{session_uuid}
: null } +
+
+ ) const renderElement = () => { if (overlayElement && overlayActive) { @@ -116,7 +125,7 @@ export default class Overlay extends React.PureComponent { } return( -
<__searchBar />
} /> + ) } diff --git a/src/components/Layout/Sider/default/index.js b/src/components/Layout/Sider/default/index.js index 26ff8ba1..9c0b3a8a 100644 --- a/src/components/Layout/Sider/default/index.js +++ b/src/components/Layout/Sider/default/index.js @@ -34,7 +34,8 @@ export default class Sider_Default extends React.PureComponent {
div{ - padding: 0 6px; + padding: 0 14px; + svg{ + margin: 0!important; + padding: 0; + } } + > div:hover{ + background-color: rgba(54, 54, 54, 0.808); + color: #fdfdfd; + } + transition: all 150ms ease-in-out; +} + +.controls:hover{ + background-color: rgba(54, 54, 54, 0.705); } \ No newline at end of file diff --git a/src/components/Loader/Loader.js b/src/components/Loader/Loader.js index 132f9e48..866d0412 100755 --- a/src/components/Loader/Loader.js +++ b/src/components/Loader/Loader.js @@ -5,7 +5,6 @@ import styles from './Loader.less' const Loader = (loading) => { return (
- Loading...
diff --git a/src/components/Loader/Loader.less b/src/components/Loader/Loader.less index 5d5d7628..c2d7e234 100755 --- a/src/components/Loader/Loader.less +++ b/src/components/Loader/Loader.less @@ -1,26 +1,17 @@ @import '~theme/index.less'; .wrapper { - font-family: @__Global_general_font_family; - color: white; - line-height: 55px; - span{ - margin: 0 10px 0 auto; - } - + user-select: none; position: absolute; z-index: 1000; right: 0; bottom: 0; - width: 140px; - height: 55px; - display: flex; - flex-direction: row; - justify-content: space-around; + width: auto; + height: 29px; + + margin: 30px; background-color: #2d2d2dc2; border-radius: 28px; - margin: 10px; - &.end { animation: unshow 0.8s linear; @@ -32,11 +23,9 @@ } .newloader { - transform: translate(21px,27px) scale(0.3); - width: 0px; - height: 0px; - margin: 0 45px 0 0; - position: relative; + transform: scale(0.28); + width: 54px; + height: 23px; } .newloader>div { diff --git a/src/core/index.js b/src/core/index.js index bce10d70..39280711 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -408,3 +408,26 @@ export function get_value(source,key){ export function iatToString(iat){ return new Date(iat * 1000).toLocaleString() } + +export function extendIDCode(id){ + num.toString().padStart(4, "0"); + +} + +export function generateUUID( lenght = 6 ){ + let text = "" + const possibleChars = "abcdefghijklmnopqrstuvwxyz0123456789" + + for ( let i = 0; i < 6; i++ ) + text += possibleChars.charAt ( Math.floor ( Math.random () * possibleChars.length ) ) + + return text +} + + /** + * Generate a random string + * @returns {string} + */ +export function generateRandomId( length = 15 ){ + return Math.random ().toString ( 36 ).substring ( 0, length ); +} \ No newline at end of file diff --git a/src/layouts/PrimaryLayout.js b/src/layouts/PrimaryLayout.js index 028cf0a6..c6a615f5 100755 --- a/src/layouts/PrimaryLayout.js +++ b/src/layouts/PrimaryLayout.js @@ -88,7 +88,7 @@ class PrimaryLayout extends React.Component { {isActive(currentTheme['backgroundImage'])?
{ + let url = item; + let method = 'GET'; + const paramsArray = item.split(' '); + if (paramsArray.length === 2) { + method = paramsArray[0]; + url = paramsArray[1]; + } + return { + method, + url, + }; +}); + +let uuid = 2; + +export default class RequestPage extends React.Component { + paramsForm = React.createRef(); + bodyDataForm = React.createRef(); + + constructor(props) { + super(props); + this.state = { + // Default sets + method: 'GET', + url: '', + ParamsKeys: [1], + BodyKeys: [1], + result: null, + visible: true, + }; + } + + handleRequest = () => { + const { method, url } = this.state; + let params = {}; + let body = {}; + + this.paramsForm.current + .validateFields() + .then(values => { + if (values) { + for (let i in values) { + if (i.startsWith('check')) { + const index = i.match(/check\[(\d+)\]/)[1]; + const key = values[`key[${index}]`]; + params[key] = values[`value[${index}]`]; + } + } + } + }) + .catch(errorInfo => { + console.log(errorInfo); + }); + + this.bodyDataForm.current + .validateFields() + .then(values => { + if (values) { + for (let i in values) { + if (i.startsWith('check')) { + const index = i.match(/check\[(\d+)\]/)[1]; + const key = values[`key[${index}]`]; + body[key] = values[`value[${index}]`]; + } + } + } + }) + .catch(errorInfo => { + console.log(errorInfo); + }); + const frame = { + method, + endpoint: `${method} ${url}`, + body, + verbose: true + } + console.log(frame) + api_request(frame, (err, res) => { + this.setState({ + result: res, + }); + }) + }; + + handleClickListItem = ({ method, url }) => { + this.setState({ + method, + url, + keys: [uuid++], + result: null, + }); + }; + + handleInputChange = e => { + this.setState({ + url: e.target.value, + }); + }; + + handleSelectChange = method => { + this.setState({ + method, + }); + }; + + handleAddParam = () => { + const { ParamsKeys } = this.state; + const nextKeys = ParamsKeys.concat(uuid); + uuid++; + this.setState({ + ParamsKeys: nextKeys, + }); + }; + + handleAddBody = () => { + const { BodyKeys } = this.state; + const nextKeys = BodyKeys.concat(uuid); + uuid++; + this.setState({ + BodyKeys: nextKeys, + }); + }; + + handleRemoveParam = key => { + const { ParamsKeys } = this.state; + this.setState({ + ParamsKeys: ParamsKeys.filter(item => item !== key), + }); + }; + + handleRemoveBody = key => { + const { BodyKeys } = this.state; + this.setState({ + BodyKeys: BodyKeys.filter(item => item !== key), + }); + }; + + handleVisible = () => { + this.setState({ + visible: !this.state.visible, + }); + }; + + render() { + const { result, url, method, ParamsKeys, BodyKeys, visible } = this.state; + + return ( +
+ + + ( + + + + {item.method} + + + {item.url} + + )} + /> + + + + + + + + + + + + + + +
+
+ {ParamsKeys.map((key, index) => ( + + + + + + + + + + + + + + + + + + + + + ))} + + + + +
+
+ + + +
+
+ {BodyKeys.map((key, index) => ( + + + + + + + + + + + + + + + + + + + + + ))} + + + + +
+
+ +
+ +
{result}
+ +
+
+ ); + } +} diff --git a/src/pages/debug/api.less b/src/pages/debug/api.less new file mode 100644 index 00000000..2e80470c --- /dev/null +++ b/src/pages/debug/api.less @@ -0,0 +1,39 @@ +@import '~theme/index.less'; + +.result { + height: 700px; + width: 100%; + background: @hover-color; + border-color: #ddd; + padding: 16px; + margin-top: 16px; + word-break: break-word; + line-height: 2; + overflow: scroll; +} + +.requestList { + padding-right: 24px; + margin-bottom: 24px; + .listItem { + cursor: pointer; + padding-left: 8px; + &.lstItemActive { + background-color: @hover-color; + } + .background-hover(); + } +} + +.paramsBlock { + overflow: visible; + opacity: 1; + height: auto; + transition: opacity 0.3s; + &.hideParams { + width: 0; + height: 0; + opacity: 0; + overflow: hidden; + } +} diff --git a/src/pages/debug/core.js b/src/pages/debug/core.js new file mode 100644 index 00000000..4dab82dc --- /dev/null +++ b/src/pages/debug/core.js @@ -0,0 +1,14 @@ +import React from 'react' +import * as antd from 'antd' +import * as core from 'core' + +export default class CoreDebug extends React.Component { + render(){ + const handleGenerateUUID = () => { console.log(core.generateUUID()) } + return( +
+ handleGenerateUUID()} >generate uuid +
+ ) + } +} \ No newline at end of file diff --git a/src/pages/debug/index.js b/src/pages/debug/index.js index 0df6fbde..30dacf79 100644 --- a/src/pages/debug/index.js +++ b/src/pages/debug/index.js @@ -1,357 +1,93 @@ -import React from 'react'; -import {v3_request} from 'api'; -import { api_request } from 'core/libs/v3_model' -import { - Row, - Col, - Select, - Form, - Input, - Button, - List, - Tag, - Checkbox, -} from 'antd'; -import classnames from 'classnames'; -import { CloseOutlined } from '@ant-design/icons'; -import endpoints_list from 'config/endpoints'; +import React from 'react' +import { Menu } from 'antd' +import * as Icons from 'components/Icons' -import styles from './index.less'; +import styles from './index.less' -const { Option } = Select; -const InputGroup = Input.Group; -const methods = ['POST', 'GET', 'PUT', 'PATCH', 'DELETE']; +import ApiDebug from './api.js' +import AntdDebug from './antd.js' +import CoreDebug from './core.js' +import ThemeDebug from './theme.js' -const methodTagColor = { - GET: 'green', - POST: 'orange', - DELETE: 'red', - PUT: 'geekblue', -}; - -const requests = Object.values(endpoints_list).map(item => { - let url = item; - let method = 'GET'; - const paramsArray = item.split(' '); - if (paramsArray.length === 2) { - method = paramsArray[0]; - url = paramsArray[1]; - } - return { - method, - url, - }; -}); - -let uuid = 2; - -class RequestPage extends React.Component { - paramsForm = React.createRef(); - bodyDataForm = React.createRef(); - - constructor(props) { - super(props); - this.state = { - // Default sets - method: 'GET', - url: '', - ParamsKeys: [1], - BodyKeys: [1], - result: null, - visible: true, - }; - } - - handleRequest = () => { - const { method, url } = this.state; - let params = {}; - let body = {}; - - this.paramsForm.current - .validateFields() - .then(values => { - if (values) { - for (let i in values) { - if (i.startsWith('check')) { - const index = i.match(/check\[(\d+)\]/)[1]; - const key = values[`key[${index}]`]; - params[key] = values[`value[${index}]`]; - } - } - } - }) - .catch(errorInfo => { - console.log(errorInfo); - }); - - this.bodyDataForm.current - .validateFields() - .then(values => { - if (values) { - for (let i in values) { - if (i.startsWith('check')) { - const index = i.match(/check\[(\d+)\]/)[1]; - const key = values[`key[${index}]`]; - body[key] = values[`value[${index}]`]; - } - } - } - }) - .catch(errorInfo => { - console.log(errorInfo); - }); - const frame = { - method, - endpoint: `${method} ${url}`, - body, - verbose: true - } - console.log(frame) - api_request(frame, (err, res) => { - this.setState({ - result: res, - }); - }) - }; - - handleClickListItem = ({ method, url }) => { - this.setState({ - method, - url, - keys: [uuid++], - result: null, - }); - }; - - handleInputChange = e => { - this.setState({ - url: e.target.value, - }); - }; - - handleSelectChange = method => { - this.setState({ - method, - }); - }; - - handleAddParam = () => { - const { ParamsKeys } = this.state; - const nextKeys = ParamsKeys.concat(uuid); - uuid++; - this.setState({ - ParamsKeys: nextKeys, - }); - }; - - handleAddBody = () => { - const { BodyKeys } = this.state; - const nextKeys = BodyKeys.concat(uuid); - uuid++; - this.setState({ - BodyKeys: nextKeys, - }); - }; - - handleRemoveParam = key => { - const { ParamsKeys } = this.state; - this.setState({ - ParamsKeys: ParamsKeys.filter(item => item !== key), - }); - }; - - handleRemoveBody = key => { - const { BodyKeys } = this.state; - this.setState({ - BodyKeys: BodyKeys.filter(item => item !== key), - }); - }; - - handleVisible = () => { - this.setState({ - visible: !this.state.visible, - }); - }; - - render() { - const { result, url, method, ParamsKeys, BodyKeys, visible } = this.state; - - return ( -
- - - ( - - - - {item.method} - - - {item.url} - - )} - /> - - - - - - - - - - - - - - -
-
- {ParamsKeys.map((key, index) => ( - - - - - - - - - - - - - - - - - - - - - ))} - - - - -
-
- - - -
-
- {BodyKeys.map((key, index) => ( - - - - - - - - - - - - - - - - - - - - - ))} - - - - -
-
- -
- -
{result}
- -
-
- ); - } +const debbugers = { + apiDebug: , + antdDebug: , + coreDebug: , + themeDebug: } -export default RequestPage; +const { Item } = Menu +const menuMap = { + apiDebug: ( + + V3 Api + + ), + antdDebug: ( + + Antd + + ), + coreDebug: ( + + Core + + ), + themeDebug: ( + + Theme + + ), +} + +export default class Debug extends React.Component { + constructor(props) { + super(props) + this.state = { + selectKey: '', + } + } + + getMenu = () => { + return Object.keys(menuMap).map(item => ( + {menuMap[item]} + )) + } + + selectKey = key => { + this.setState({ + selectKey: key, + }) + } + + renderChildren = () => { + try { + if (!this.state.selectKey) { + return
Select an debugger
+ } + return debbugers[this.state.selectKey] + } catch (error) { + return
Select an debugger
+ } + } + + render() { + const { selectKey } = this.state + return ( +
+

+ Debuggers +

+ this.selectKey(key)} + > + {this.getMenu()} + + +
{this.renderChildren()}
+
+ ) + } +} \ No newline at end of file diff --git a/src/pages/debug/index.less b/src/pages/debug/index.less index 4ac56a59..0f4504a8 100644 --- a/src/pages/debug/index.less +++ b/src/pages/debug/index.less @@ -1,39 +1,47 @@ @import '~theme/index.less'; -.result { - height: 600px; +.main { + font-family: "Nunito", sans-serif; + margin: 20px 0 0; + display: flex; + flex-direction: column; width: 100%; - background: @hover-color; - border-color: #ddd; - padding: 16px; - margin-top: 16px; - word-break: break-word; - line-height: 2; - overflow: scroll; -} - -.requestList { - padding-right: 24px; - margin-bottom: 24px; - .listItem { - cursor: pointer; - padding-left: 8px; - &.lstItemActive { - background-color: @hover-color; - } - .background-hover(); - } -} - -.paramsBlock { - overflow: visible; - opacity: 1; height: auto; - transition: opacity 0.3s; - &.hideParams { - width: 0; - height: 0; - opacity: 0; - overflow: hidden; + overflow: auto; + color: @__Global_layout_color; + background-color: #ffffff; + padding: 15px; + border-radius: 10px; + + :global { + .ant-menu-inline { + color: @__Global_layout_color; + background-color: transparent; + border: none; + } + + .ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected { + font-weight: bold; + } + } + + .debuggerComponent { + padding: 15px; + } + + :global { + .ant-list-item { + padding-top: 7px; + padding-bottom: 7px; + } + + .ant-list-split .ant-list-item { + border-bottom: 0; + } + + .ant-list-item-meta-title { + color: rgba(0, 0, 0, 0.733); + font-size: 14px; + } } } diff --git a/src/pages/settings/components/base.js b/src/pages/settings/components/base.js index ed1a2cac..2fb5bedb 100755 --- a/src/pages/settings/components/base.js +++ b/src/pages/settings/components/base.js @@ -114,7 +114,7 @@ class Base extends Component { renderItem={item => ( {item.icon}{item.title}} description={item.description} /> {this.renderSetting(item)} diff --git a/src/pages/settings/components/electron/index.js b/src/pages/settings/components/electron/index.js new file mode 100644 index 00000000..d96a0895 --- /dev/null +++ b/src/pages/settings/components/electron/index.js @@ -0,0 +1,11 @@ +import React from 'react' + +export default class ElectronSettings extends React.Component{ + render(){ + return( +
+ Electron +
+ ) + } +} \ No newline at end of file diff --git a/src/pages/settings/components/theme/index.js b/src/pages/settings/components/theme/index.js index 47025421..ea3006c7 100644 --- a/src/pages/settings/components/theme/index.js +++ b/src/pages/settings/components/theme/index.js @@ -27,7 +27,7 @@ class ThemeConfigurator extends React.Component{ handleUpdate(payload){ if(!this.state.key || !this.props.dispatch) { - return onError.internal_proccess(`"Config key" or "Dispatcher" is missing`) + return onError.internal_proccess(`"Config key" or "App/Dispatcher" is missing`) } if (!payload) { payload = this.state.model @@ -128,8 +128,8 @@ class BackgroundImage extends ThemeConfigurator{ key: "backgroundImage", model: { active: false, opacity: null, src: null }, - textColor: this.rgbToScheme(getComputedStyle(document.getElementById("app")).color), - overlayColor: this.rgbToScheme(getComputedStyle(document.getElementById("app")).backgroundColor), + textColor: this.rgbToScheme(getComputedStyle(document.getElementById("root")).color), + overlayColor: this.rgbToScheme(getComputedStyle(document.getElementById("root")).backgroundColor), processing: null, customURL: '', diff --git a/src/pages/settings/index.js b/src/pages/settings/index.js index d2825821..139754d3 100755 --- a/src/pages/settings/index.js +++ b/src/pages/settings/index.js @@ -1,7 +1,6 @@ import React from 'react' import { Menu } from 'antd' import * as Icons from 'components/Icons' -import * as Feather from 'feather-reactjs' import styles from './style.less' @@ -13,50 +12,57 @@ import Base from './components/base.js' import AppAbout from './components/about.js' import Theme from './components/theme' -const { Item } = Menu -const menuMap = { - base: ( - - General - - ), - theme: ( - - Theme - - ), - sync: ( - - Sync™ - - ), - security: ( - - Security & Privacity - - ), - notification: ( - - Notification - - ), - earnings: ( - - Earnings - - ), - help: ( - - Help - - ), - about: ( - - About - - ), +const Settings = { + base: , + about: , + theme: , + earnings: , + security: , + notification: } + +const { Item } = Menu + +const menuList = [ + { + key: "base", + title: "General", + icons: , + }, + { + key: "app", + title: "Application", + icons: , + require: "embedded" + }, + { + key: "theme", + title: "Customization", + icons: , + }, + { + key: "security", + title: "Security & Privacity", + icons: , + }, + { + key: "notification", + title: "Notification", + icons: , + }, + { + key: "help", + title: "Help", + icons: , + }, + { + key: "about", + title: "About", + icons: , + }, +] + class GeneralSettings extends React.Component { constructor(props) { super(props) @@ -66,8 +72,10 @@ class GeneralSettings extends React.Component { } getMenu = () => { - return Object.keys(menuMap).map(item => ( - {menuMap[item]} + return menuList.map(item => ( + + {item.icons} {item.title} + )) } @@ -78,24 +86,11 @@ class GeneralSettings extends React.Component { } renderChildren = () => { - const { selectKey } = this.state - switch (selectKey) { - case 'base': - return - case 'security': - return - case 'theme': - return - case 'notification': - return - case 'about': - return - case 'earnings': - return - default: - break + if(this.state.selectKey){ + return Settings[this.state.selectKey] + }else{ +
Select an setting
} - return null } render() { diff --git a/src/pages/settings/style.less b/src/pages/settings/style.less index 877f1fb7..fda2b036 100755 --- a/src/pages/settings/style.less +++ b/src/pages/settings/style.less @@ -5,7 +5,7 @@ margin: 20px 0 0; display: flex; width: 100%; - height: 100%; + height: auto; overflow: auto; color: @__Global_layout_color; background-color: #ffffff; diff --git a/src/theme/base/index.less b/src/theme/base/index.less index 1d67ec96..e94d9e82 100644 --- a/src/theme/base/index.less +++ b/src/theme/base/index.less @@ -39,6 +39,7 @@ #root{ background-color: @AppTheme_global_background!important; + color: @AppTheme_global_color!important; } .app{ @@ -62,7 +63,6 @@ #app { -webkit-app-region: no-drag; overflow: hidden; - border-radius: 12px; position: absolute; bottom: 0; @@ -103,7 +103,7 @@ body { line-height: @base-line-height; font-family: @__Global_texted_font; - border-radius: 12px; + background-color: @AppTheme_global_background!important; } @media (max-width: @bp-small){ diff --git a/src/theme/base/layout/Primary_Layout.less b/src/theme/base/layout/Primary_Layout.less index c7b16d81..f20346da 100644 --- a/src/theme/base/layout/Primary_Layout.less +++ b/src/theme/base/layout/Primary_Layout.less @@ -3,5 +3,5 @@ @primary_layout_container_backgroud: @__Global_layout_backgroud; @primary_layout_container_border-rd: @__Global_layout_border-rd; -@primary_layout_content_padding: 25px; +@primary_layout_content_padding: 0 40px 20px 0;