From bc8124f2f22d0b95f8ffffa854d2d6a78c3b1a67 Mon Sep 17 00:00:00 2001 From: srgooglo <38926803+srgooglo@users.noreply.github.com> Date: Wed, 12 Feb 2020 16:50:51 +0100 Subject: [PATCH] 0.1.12 --- .umirc.js | 4 +- config/ycore.config.js | 1 + mock/route.js | 128 -------- package.json | 8 +- src/{ => @ycore}/ycore_style.scss | 0 src/{ => @ycore}/ycore_worker.js | 31 +- src/components/CustomIcons/index.js | 5 +- src/components/DropOption/DropOption.js | 9 +- src/components/Layout/Header.js | 45 ++- src/components/Layout/Header.less | 28 +- src/components/Layout/L_Sider.js | 190 ++++++++++++ src/components/Layout/L_Sider.less | 287 ++++++++++++++++++ src/components/Layout/Menu.js | 14 +- src/components/Layout/R_Sider.js | 172 ----------- src/components/Layout/R_Sider.less | 149 --------- src/components/Layout/index.js | 4 +- .../local_components/CustomMenu/index.js | 32 +- .../local_components/HeaderSearch/index.js | 41 +++ .../local_components/HeaderSearch/index.tsx | 148 --------- src/components/MainSidebar/index.js | 5 - src/components/UserProfile/index.js | 70 +++++ src/components/UserProfile/styles.less | 262 ++++++++++++++++ .../experimental/components/StatusBoxC.old.js | 6 +- src/components/YulioID/experimental/index.js | 16 +- src/components/YulioID/legacy/forms.js | 52 ++-- src/components/YulioID/legacy/index.js | 22 +- src/components/YulioID/legacy/legacy.js | 58 ++-- src/components/YulioID/legacy/ycore_sdcp.js | 10 +- src/components/index.js | 3 +- src/layouts/PrimaryLayout.js | 9 +- src/layouts/PrimaryLayout.less | 7 +- src/models/app.js | 2 +- src/pages/$page/index.js | 38 +++ src/pages/$page/index.less | 14 + src/pages/$page/model/detail.js | 50 +++ src/pages/404.js | 8 +- src/pages/s/$search/index.js | 62 ++++ src/pages/s/$search/styles.less | 7 + src/themes/fonty.css | 3 +- 39 files changed, 1182 insertions(+), 818 deletions(-) rename src/{ => @ycore}/ycore_style.scss (100%) rename src/{ => @ycore}/ycore_worker.js (95%) create mode 100644 src/components/Layout/L_Sider.js create mode 100644 src/components/Layout/L_Sider.less delete mode 100644 src/components/Layout/R_Sider.js delete mode 100644 src/components/Layout/R_Sider.less create mode 100644 src/components/Layout/local_components/HeaderSearch/index.js delete mode 100644 src/components/Layout/local_components/HeaderSearch/index.tsx create mode 100644 src/components/UserProfile/index.js create mode 100644 src/components/UserProfile/styles.less create mode 100644 src/pages/$page/index.js create mode 100644 src/pages/$page/index.less create mode 100644 src/pages/$page/model/detail.js create mode 100644 src/pages/s/$search/index.js create mode 100644 src/pages/s/$search/styles.less diff --git a/.umirc.js b/.umirc.js index bf2df3b6..da950f3a 100644 --- a/.umirc.js +++ b/.umirc.js @@ -63,8 +63,8 @@ export default { theme: './config/theme.config.js', // Webpack Configuration alias: { - ycore: resolve(__dirname, './src/ycore_worker.js'), - ycstyle: resolve(__dirname, './src/ycore_style.scss'), + ycore: resolve(__dirname, './src/@ycore/ycore_worker.js'), + ycstyle: resolve(__dirname, './src/@ycore/ycore_style.scss'), api: resolve(__dirname, './src/services/'), components: resolve(__dirname, './src/components'), config: resolve(__dirname, './config/ycore.config.js'), diff --git a/config/ycore.config.js b/config/ycore.config.js index e4b50416..22942ed1 100644 --- a/config/ycore.config.js +++ b/config/ycore.config.js @@ -26,6 +26,7 @@ module.exports = { openwheater_apiKey:'2acf34be0b8f033b89ba4de1e674d42a', }, Endpoints: { + search_endpoint: "https://api.ragestudio.net/RS-YIBTP/yid/search?access_token=", get_sessions: "https://api.ragestudio.net/RS-YIBTP/yid/session_id?access_token=", auth_endpoint: "https://api.ragestudio.net/RS-YIBTP/yid/auth", new_post: "https://api.ragestudio.net/RS-YIBTP/yid/new_post?access_token=", diff --git a/mock/route.js b/mock/route.js index 3d8f1cdf..bc8d31b2 100644 --- a/mock/route.js +++ b/mock/route.js @@ -15,134 +15,6 @@ const database = [ route: '/main', }, - // ACCOUNT SECTION - { - id: '2', - breadcrumbParentId: '1', - name: 'Account', - icon: 'user', - }, - { - id: '21', - breadcrumbParentId: '2', - menuParentId: '2', - name: 'YulioID™', - icon: 'user', - route: '/account', - }, - { - id: '22', - breadcrumbParentId: '2', - menuParentId: '2', - name: 'YulioPay™', - icon: 'wallet', - route: '/wallet', - }, - { - id: '23', - breadcrumbParentId: '2', - menuParentId: '2', - name: 'Vault', - icon: 'save', - route: '/account', - }, - - - // RESOURCES SECTION - { - id: '3', - breadcrumbParentId: '1', - name: 'Resources', - icon: 'compass', - }, - { - id: '31', - breadcrumbParentId: '3', - menuParentId: '3', - name: 'Marketplace', - icon: 'shopping-cart', - route: '/resources/marketplace', - }, - { - id: '32', - breadcrumbParentId: '3', - menuParentId: '3', - name: 'Apps', - icon: 'desktop', - route: '/resources/apps', - }, - { - id: '33', - breadcrumbParentId: '3', - menuParentId: '3', - name: 'Download Manager', - icon: 'build', - route: '/resources/dl', - }, - { - id: '34', - breadcrumbParentId: '3', - menuParentId: '3', - name: 'Other Services', - icon: 'compass', - route: '/resources/otherservices', - }, - - // CloudStudio - { - id: '4', - breadcrumbParentId: '1', - name: 'Cloud Studio', - icon: 'cloud', - }, - { - id: '42', - breadcrumbParentId: '4', - menuParentId: '4', - name: 'Workspaces', - icon: 'deployment-unit', - route: '/changelogs', - }, - { - id: '43', - breadcrumbParentId: '4', - menuParentId: '4', - name: 'Cloud Computing', - icon: 'cloud-server', - route: '/help', - }, - { - id: '44', - breadcrumbParentId: '4', - menuParentId: '4', - name: 'GIT', - icon: 'branches', - route: '/about', - }, - // Project Manager - { - id: '5', - breadcrumbParentId: '1', - name: 'Project Manager', - icon: 'team', - }, - { - id: '51', - breadcrumbParentId: '5', - menuParentId: '5', - name: 'Project Manager', - icon: 'reconciliation', - route: '/help', - }, - { - id: '52', - breadcrumbParentId: '5', - menuParentId: '5', - name: 'Teams', - icon: 'team', - route: '/changelogs', - }, - ] module.exports = { diff --git a/package.json b/package.json index b80b71f1..2db34dfd 100644 --- a/package.json +++ b/package.json @@ -1,17 +1,15 @@ { "name": "comty-development", - "version": "0.1.09", + "version": "0.1.10", "description": "", "main": "index.js", - "author": "", + "author": "RageStudio", "license": "ISC", "dependencies": { - "@ant-design/compatible": "0.0.1-rc.1", - "@ant-design/icons": "^2.1.1", "@ant-design/pro-layout": "^4.9.11", "@lingui/react": "^2.9.0", "ant-design-pro": "^2.3.2", - "antd": "^4.0.0-rc.0", + "antd": "^3.26.3", "autoprefixer": "7.1.6", "axios": "^0.18.0", "babel-core": "7.0.0-bridge.0", diff --git a/src/ycore_style.scss b/src/@ycore/ycore_style.scss similarity index 100% rename from src/ycore_style.scss rename to src/@ycore/ycore_style.scss diff --git a/src/ycore_worker.js b/src/@ycore/ycore_worker.js similarity index 95% rename from src/ycore_worker.js rename to src/@ycore/ycore_worker.js index 92a24e12..4281961b 100644 --- a/src/ycore_worker.js +++ b/src/@ycore/ycore_worker.js @@ -1,12 +1,11 @@ import Cookies from "ts-cookies"; import axios from "axios"; -import {SetControls, CloseControls} from "./components/Layout/Control" -import {secretOrKey} from "../config/keys.js" +import {SetControls, CloseControls} from ".././components/Layout/Control" +import {secretOrKey} from "../../config/keys.js" import * as antd from "antd" -import { func } from "prop-types"; var react = require("react"); -var package_json = require("../package.json"); +var package_json = require("../../package.json"); var jquery = require("jquery"); var uifx = require("uifx"); var config = require("config"); @@ -39,7 +38,7 @@ export const UIFxList = { notifyWarning: (ycore_worker.FXapiProvider + 'NotifyWarning.wav'), notifySuccess: (ycore_worker.FXapiProvider + 'notifySuccess.wav') }; -export const infoServer = (ycore_worker.ServerType + ' Server | v' + ycore_worker.ServerVersion); + export function notifyError(err){ antd.notification.error({ @@ -600,28 +599,6 @@ export function UIFxPY(value, customVLM) { beep.setVolume(VLM || customVLM).play(); } - -export function WeatherAPI() { - let city = 'pamplona'; - let country = 'spain'; - var Api_Key = yConfig.openwheater_apiKey; - var _this = this; - var urlOBJ = ("http://api.openweathermap.org/data/2.5/weather?q=" + city + "," + country + "&appid=2acf34be0b8f033b89ba4de1e674d42a"); - var returnData; - var AjaxRequest = { - "url": urlOBJ, - "method": "POST", - "timeout": 0, - "processData": true, - "contentType": false - }; - jquery.ajax(AjaxRequest) - .done(function (response) { - returnData = response; - }); - return (returnData); -} - export function RefreshONCE(){ window.location.reload(); } diff --git a/src/components/CustomIcons/index.js b/src/components/CustomIcons/index.js index 1662e50b..0d39a4bb 100644 --- a/src/components/CustomIcons/index.js +++ b/src/components/CustomIcons/index.js @@ -1,6 +1,7 @@ const VerifiedBadge = () => ( ) const CommonThings = () => () +const SunSVG = () => () +const MoonSVG = () => () - -const CustomIcons = {VerifiedBadge, CommonThings} +const CustomIcons = {VerifiedBadge, CommonThings, SunSVG, MoonSVG} export default CustomIcons diff --git a/src/components/DropOption/DropOption.js b/src/components/DropOption/DropOption.js index d0d4ee41..99e7d12c 100644 --- a/src/components/DropOption/DropOption.js +++ b/src/components/DropOption/DropOption.js @@ -1,7 +1,6 @@ import React from 'react' import PropTypes from 'prop-types' -import * as icon from '@ant-design/icons'; -import { Dropdown, Button, Menu } from 'antd'; +import { Dropdown, Button, Icon, Menu } from 'antd' const DropOption = ({ onMenuClick, @@ -18,11 +17,11 @@ const DropOption = ({ } {...dropdownProps}> - ); + ) } DropOption.propTypes = { diff --git a/src/components/Layout/Header.js b/src/components/Layout/Header.js index 39653c75..ad1bfd1a 100644 --- a/src/components/Layout/Header.js +++ b/src/components/Layout/Header.js @@ -1,17 +1,6 @@ import React, { PureComponent, Fragment } from 'react' -import * as icon from '@ant-design/icons'; -import { - Menu, - Layout, - Avatar, - Popover, - Badge, - List, - Switch, - Tooltip, - Dropdown, - Button, -} from 'antd'; +import { Menu, Icon, Layout, Avatar, Popover, Badge, List, Switch, Tooltip, Dropdown, Button } from 'antd' +import HeaderSearch from './local_components/HeaderSearch/index.js' import { Trans, withI18n } from '@lingui/react' import { Ellipsis } from 'ant-design-pro' import classnames from 'classnames' @@ -44,7 +33,7 @@ class Header extends PureComponent { handleOpenMenu() { let ListControls = [ (
- +
) ] @@ -90,7 +79,10 @@ class Header extends PureComponent { } description={moment(item.date).fromNow()} /> - + )} /> @@ -111,24 +103,25 @@ class Header extends PureComponent { offset={[-10, 10]} className={styles.iconButton} > - + ) return ( - -
- - - -
-
- this.handleOpenMenu()} className={styles.iconButton} style={{ fontSize: '15px' }} /> - {notificationIcon} + +
+
+ + +
+
+ this.handleOpenMenu()} className={styles.iconButton} style={{ fontSize: '15px' }} /> + {notificationIcon} +
- ); + ) } } diff --git a/src/components/Layout/Header.less b/src/components/Layout/Header.less index 5e5cfd74..b8bab351 100644 --- a/src/components/Layout/Header.less +++ b/src/components/Layout/Header.less @@ -1,11 +1,17 @@ @import '~themes/vars.less'; +@LDarkMode-backgroud: rgba(47, 46, 48, 0.74); +@LLightMode-backgroud: #fff; + +@LDarkMode-color: #fff; +@LLightMode-color: #2F2E30; .createMenu { width: 30px; margin: 0 auto 0 auto; height: 190px; + } .brand { display: flex; @@ -18,13 +24,19 @@ padding: 0; } } +.containersWrappers{ + display: flex; + &.collapsed { + width: ~'calc(100% - 80px)'; + } +} .header { -webkit-box-shadow: 0px 9px 15px -6px rgba(158,158,158,0.82); -moz-box-shadow: 0px 9px 15px -6px rgba(158,158,158,0.82); box-shadow: 0px 9px 15px -6px rgba(158,158,158,0.82); display: flex; width: 100%; - background-color: @DarkMode-backgroud; + background-color: #F3F3F3; height: 45px; z-index: 9; align-items: center; @@ -33,6 +45,16 @@ width: 100%; z-index: 10; transition: width 0.2s; + right: 0; + &.collapsed { + width: ~'calc(100% - 180px)'; + background-color: rgb(80, 80, 80); + background-color: @LDarkMode-backgroud; + color: @DarkMode-color; + border-color: transparent; + box-shadow: none; + transition: box-shadow 1s linear; + } :global { .ant-menu-submenu-title { @@ -82,10 +104,8 @@ margin: 0 50px; } .leftContainer { - margin: 0 23px; + margin: 0 0 0 50px; display: flex; - - } .button { diff --git a/src/components/Layout/L_Sider.js b/src/components/Layout/L_Sider.js new file mode 100644 index 00000000..01ac8192 --- /dev/null +++ b/src/components/Layout/L_Sider.js @@ -0,0 +1,190 @@ +import React, { PureComponent } from 'react' +import PropTypes from 'prop-types' +import * as antd from 'antd' +import { withI18n, Trans } from '@lingui/react' +import ScrollBar from '../ScrollBar' +import { config } from 'utils' +import styles from './L_Sider.less' +import * as ycore from 'ycore'; +import router from 'umi/router'; +import {CustomIcons} from 'components' + + +const userData = ycore.SDCP() + +@withI18n() +class L_Sider extends PureComponent { + constructor(props) { + super(props); + this.state = { + isHover: false + }; + this.hover = this.hover.bind(this); + } + + hover(e) { + this.setState({ + isHover: !this.state.isHover + }); + } + Balancer() { + const { collapsed, } = this.props; + const { isHover } = this.state; + if (collapsed == false) { + return false + } + if (isHover == false ){ + if (collapsed == true) { + return true + } + return true + }else{ + return false + } + } + + StrictMode = () =>{ + const { theme } = this.props; + if (ycore.DevOptions.StrictLightMode == false) { + return "dark" + } + if (ycore.DevOptions.StrictLightMode == true && theme == "light") { + return "light" + } + if (ycore.DevOptions.StrictLightMode == true && theme == "dark") { + return "dark" + } + } + UserIsPro(){ + if (userData.is_pro == 1){ + return true + } + return false + } + UserIsAdmin(){ + if (userData.admin == 1){ + return true + } + return false + } + handleClickMenu = e => { + e.key === 'SignOut' && ycore.LogoutCall() + e.key === 'settingpage' && router.push('/settings') + e.key === 'accountpage' && router.push('/account') + } + isDarkMode(){ + const { theme } = this.props + if (theme == 'dark'){ + return true + } + return false + } + + render() { + const { + i18n, + menus, + theme, + isMobile, + collapsed, + onThemeChange, + onCollapseChange, + } = this.props + + return ( +
+ + +
onCollapseChange(!collapsed)} icon={collapsed? (this.Balancer()? "right" : "double-right") : (this.Balancer()? "left" : "double-left") } />
+
+ + + {this.UserIsPro()? + + + {collapsed ? null : Boosted Posts } + + : + + + {collapsed ? null : Upgrade to Pro } + } + + + {collapsed ? null : Edit Profile} + + + + {collapsed ? null : General Settings} + + {this.UserIsAdmin()? + + + {collapsed ? null : Admin Area} + + : + undefined + } + + +
+ + + {collapsed? : +
+ } + unCheckedChildren={} + defaultChecked={theme === 'dark'} + /> +
} +
+ + + {collapsed ? null : Logout} + +
+
+ +
+ {collapsed? null :

@{userData.username}

} +
+
+
+
+
+ ) + } +} + +L_Sider.propTypes = { + menus: PropTypes.array, + theme: PropTypes.string, + isMobile: PropTypes.bool, + collapsed: PropTypes.bool, + onThemeChange: PropTypes.func, + onCollapseChange: PropTypes.func, +} + +export default L_Sider diff --git a/src/components/Layout/L_Sider.less b/src/components/Layout/L_Sider.less new file mode 100644 index 00000000..44dcbd2a --- /dev/null +++ b/src/components/Layout/L_Sider.less @@ -0,0 +1,287 @@ +@import '~themes/vars.less'; + +@LDarkMode-backgroud: rgba(47, 46, 48, 0.74); +@LLightMode-backgroud: #fff; + +@LDarkMode-color: #fff; +@LLightMode-color: #2F2E30; + +.CollapserWrapperLight{ + height: 100%; + position: absolute; + float: left; + top: 0; + left: 0; + z-index: 200; + vertical-align: middle; + :global{ + + .ant-btn { + border: none; + border-radius: unset; + vertical-align: middle; + height: 100%; + color: white; + background-color: transparent; + border-color: transparent; + box-shadow: none; + transition: background-color 1s linear; + } + .ant-btn:hover{ + background: rgb(255,255,255); + background: linear-gradient(270deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.57) 95%); + + } + } +} + +.CollapserWrapperDark{ + height: 100%; + position: absolute; + float: left; + top: 0; + left: 0; + z-index: 200; + vertical-align: middle; + :global{ + + .ant-btn { + border: none; + border-radius: unset; + vertical-align: middle; + height: 100%; + color: white; + background-color: transparent; + border-color: transparent; + box-shadow: none; + transition: background-color 1s linear; + } + .ant-btn:hover{ + background: rgb(255,255,255); + background: linear-gradient(270deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.57) 95%); + + } + } +} + +.brand { + display: flex; + vertical-align: middle; + padding: 5px; + width: 100%; + max-height: 50px; + +} + +.userInfo{ + font-family: "Poppins", sans-serif; + align-items: center; + text-align: center; + h2{ + color: @LDarkMode-color + } +} +.avatarFull{ + width: 120px; +} +.avatar{ + margin: 0 0 15px 0; +} + +.something_thats_pulling_me_down{ + :global{ + text-align: center; + bottom: 0; + position: absolute; + width: 100%; + + } +} + +.siderwrapper { + border-color: transparent; + + font-size: 13px; + font-family: "Poppins", sans-serif; + height: 100%; + width: 100%; + left: 0; + position: absolute; + :global { + .ant-menu-inline, .ant-menu-vertical, .ant-menu-vertical-left { + :hover { + background-color: rgb(80, 80, 80); + color: #fff; + } + border-right: 1px solid transparent; + } + .ant-layout-sider-dark { + background-color: @LDarkMode-backgroud; + color: @DarkMode-color; + } + .ant-layout-sider-light { + background-color: @LightMode-backgroud; + color: @LightMode-color; + } + } +} + +.sider { + height: 100%; + z-index: 50; + :global { + .ant-sider{ + background-color: #fff; + } + .ant-menu-sub { + font-size: 14px; + -webkit-box-shadow: 13px 4px 34px 0px rgba(0, 0, 0, 0.005); + -moz-box-shadow: 13px 4px 34px 0px rgba(0, 0, 0, 0.005); + box-shadow: 13px 4px 34px 0px rgba(0, 0, 0, 0.005); + } + .ant-menu-dark { + background-color: @LDarkMode-backgroud; + color: @LDarkMode-color; + } + .ant-menu-light { + background-color: @LLightMode-backgroud; + color: @LLightMode-color; + } + } + .siderhead{ + font-family: 'Source Sans Pro', sans-serif; + display: flex; + align-items: center; + justify-content: center; + ::first-letter{ + margin-left: 7px; + } + height: 60px; + font-size: 17px; + } + .sidercontainer{ + width: 100%; + display: flex; + align-items: center; + justify-content: center; + } + .menuItems{ + background-color: transparent; + color: @LDarkMode-color; + margin-bottom: 8px; + width: 100%; + animation: fadein 0.5s; + :global { + .ant-menu-item-selected{ + background-color: rgba(82, 82, 82, 0.562); + } + } + + } + .menuItemsCollapsed{ + background-color: transparent; + color: @LDarkMode-color; + + width: 100%; + + animation: fadein 0.5s; + :global { + .ant-menu-item { + padding: 0 !important; + margin: 2px 0 2px 0; + width: 100%; + text-align: center; + font-size: 20px; + } + .ant-menu-item-selected{ + background-color: rgba(82, 82, 82, 0.562); + } + } + + } + + .menuContainer { + height: 100%; + margin: 18px 0 8px 0; + .scrollbar-container { + position: initial; + height: 100%; + } + overflow-x: hidden; + flex: 1; + + &::-webkit-scrollbar-thumb { + background-color: transparent; + } + + &:hover { + &::-webkit-scrollbar-thumb { + background-color: rgba(59, 59, 59, 0.2); + } + } + + :global { + .ant-layout-sider-children { + display: flex; + flex-direction: column; + justify-content: space-between; + } + .ant-layout-sider-collapsed { + .ant-menu-item { + left: 0; + margin: 0; + padding: 0; + } + .ant-menu-inline-collapsed > .ant-menu-item{ + padding: 0; + left:0; + } + } + .scrollbar-container { + position: initial; + height: 100%; + } + .ant-menu-inline .ant-menu-item { + font-size: 14px; + font-family: 'Source Sans Pro', sans-serif; + } + + .ant-menu-dark .ant-menu-item a { + color: rgb(197, 197, 197); + } + + } + + } +} +.scrollbar-container { + position: initial; + height: 100%; +} + +@keyframes fadeLeftIn { + 0% { + transform: translateX(5px); + opacity: 0; + } + + 100% { + transform: translateX(0); + opacity: 1; + } +} + +.themeSwitcher { + :global { + .ant-switch-checked { + background-color: #2F2E30; + } + } + svg { + height: 100%; + vertical-align: middle; + } + span { + line-height: 10px; + } +} \ No newline at end of file diff --git a/src/components/Layout/Menu.js b/src/components/Layout/Menu.js index 25d95526..975217da 100644 --- a/src/components/Layout/Menu.js +++ b/src/components/Layout/Menu.js @@ -1,7 +1,6 @@ import React, { PureComponent, Fragment } from 'react' import PropTypes from 'prop-types' -import * as icon from '@ant-design/icons'; -import { Menu } from 'antd'; +import { Menu, Icon } from 'antd' import Navlink from 'umi/navlink' import withRouter from 'umi/withRouter' import {SDCP} from 'ycore' @@ -13,7 +12,6 @@ import { } from 'utils' import store from 'store' import styles from './Menu.less' -import { isTypeNode } from 'typescript'; const { SubMenu } = Menu @@ -53,24 +51,24 @@ class SiderMenu extends PureComponent { className={styles.SubMenuItems} title={ - {item.icon && } + {item.icon && } {item.name} } > {this.generateMenus(item.children)} - ); + ) } return ( - {item.icon && } + {item.icon && } {item.name} - ); - }); + ) + }) } render() { diff --git a/src/components/Layout/R_Sider.js b/src/components/Layout/R_Sider.js deleted file mode 100644 index eb044596..00000000 --- a/src/components/Layout/R_Sider.js +++ /dev/null @@ -1,172 +0,0 @@ -import React, { PureComponent, StrictMode } from 'react' -import PropTypes from 'prop-types' -import { Icons as LegacyIcon } from '@ant-design/compatible'; -import * as icon from '@ant-design/icons'; -import { Switch, Layout, Tag, Divider, Drawer, Avatar, Menu } from 'antd'; -import { withI18n, Trans } from '@lingui/react' -import classNames from 'classnames' -import router from 'umi/router' -import { SDCP, LogoutCall, DevOptions} from 'ycore' - -import styles from './R_Sider.less' -import ycstyle from 'ycstyle' - -let userData = SDCP() - -@withI18n() -class R_Sider extends PureComponent { - constructor(props) { - super(props); - this.state = { - isHover: false - }; - this.hover = this.hover.bind(this); - } - hover(e) { - this.setState({ - isHover: !this.state.isHover - }); - } - handleClickMenu = e => { - e.key === 'SignOut' && LogoutCall() - e.key === 'settingpage' && router.push('/settings') - e.key === 'accountpage' && router.push('/account') - } - Balancer() { - const { collapsed, } = this.props; - const { isHover } = this.state; - if (collapsed == false) { - return false - } - if (isHover == false ){ - if (collapsed == true) { - return true - } - return true - }else{ - return false - } - - } - StrictMode = () =>{ - const { theme } = this.props; - if (DevOptions.StrictLightMode == false) { - return "dark" - } - if (DevOptions.StrictLightMode == true && theme == "light") { - return "light" - } - if (DevOptions.StrictLightMode == true && theme == "dark") { - return "dark" - } - } - UserIsPro(){ - if (userData.is_pro == 1){ - return true - } - return false - } - UserIsAdmin(){ - if (userData.admin == 1){ - return true - } - return false - } - render() { - - const { theme, onThemeChange} = this.props; - - return ( -
- - -
- -
- {this.Balancer()?
: -
-
-

@{userData.username}

- Points: {userData.points} -
- -
- - {this.UserIsPro()? - - - Boosted Posts - - : - - - Upgrade to Pro - } - - - Edit Profile - - - - General Settings - - - {this.UserIsAdmin()? - - - Admin Area - - : - undefined - } - - - -
- - - - - - - - Logout - - -
-
-
- } -
-
- ); - } -} - -R_Sider.propTypes = { - menus: PropTypes.array, - theme: PropTypes.string, - isMobile: PropTypes.bool, - collapsed: PropTypes.bool, - onThemeChange: PropTypes.func, - onCollapseChange: PropTypes.func, -} - -export default R_Sider diff --git a/src/components/Layout/R_Sider.less b/src/components/Layout/R_Sider.less deleted file mode 100644 index 328bbc62..00000000 --- a/src/components/Layout/R_Sider.less +++ /dev/null @@ -1,149 +0,0 @@ -@import '~themes/vars.less'; - -@LDarkMode-backgroud: rgba(47, 46, 48, 0.74); -@LLightMode-backgroud: #fff; - -@LDarkMode-color: #fff; -@LLightMode-color: #2F2E30; - -.userInfo{ - font-family: "Poppins", sans-serif; - align-items: center; - text-align: center; - h2{ - color: @LDarkMode-color - } -} -.avatarFull{ - width: 120px; -} -.avatar{ - margin: 0 0 15px 0; -} - -.something_thats_pulling_me_down{ - :global{ - text-align: center; - bottom: 0; - position: absolute; - width: 100%; - - } -} - -.siderwrapper { - font-size: 13px; - font-family: "Poppins", sans-serif; - height: 100%; - right: 0; - position: absolute; - :global { - .ant-menu-inline, .ant-menu-vertical, .ant-menu-vertical-left { - :hover { - color: #ffca1d; - } - border-right: 1px solid transparent; - } - .ant-layout-sider-dark { - background-color: @LDarkMode-backgroud; - color: @DarkMode-color; - } - .ant-layout-sider-light { - background-color: @LightMode-backgroud; - color: @LightMode-color; - } - } -} -.sider { - height: 100%; - z-index: 50; - :global { - .ant-menu-sub { - font-size: 14px; - -webkit-box-shadow: 13px 4px 34px 0px rgba(0, 0, 0, 0.005); - -moz-box-shadow: 13px 4px 34px 0px rgba(0, 0, 0, 0.005); - box-shadow: 13px 4px 34px 0px rgba(0, 0, 0, 0.005); - } - .ant-menu-dark { - background-color: @LDarkMode-backgroud; - color: @LDarkMode-color; - } - .ant-menu-light { - background-color: @LLightMode-backgroud; - color: @LLightMode-color; - } - } - .siderhead{ - font-family: 'Source Sans Pro', sans-serif; - display: flex; - align-items: center; - justify-content: center; - ::first-letter{ - margin-left: 7px; - } - height: 60px; - font-size: 17px; - } - .sidercontainer{ - width: 100%; - display: flex; - align-items: center; - justify-content: center; - } - .menuItems{ - background-color: transparent; - color: @LDarkMode-color; - margin-bottom: 8px; - width: 100%; - animation: fadein 0.5s; - :global { - .ant-menu-item-selected{ - background-color: rgba(82, 82, 82, 0.562); - } - } - - } - - .menuContainer { - height: ~'calc(100vh - 120px)'; - overflow-x: hidden; - flex: 1; - - &::-webkit-scrollbar-thumb { - background-color: transparent; - } - - &:hover { - &::-webkit-scrollbar-thumb { - background-color: rgba(59, 59, 59, 0.2); - } - } - - :global { - .ant-menu-inline .ant-menu-item { - font-size: 14px; - font-family: 'Source Sans Pro', sans-serif; - } - - .ant-menu-dark .ant-menu-item a { - color: rgb(197, 197, 197); - } - - - - } - - } -} - -@keyframes fadeLeftIn { - 0% { - transform: translateX(5px); - opacity: 0; - } - - 100% { - transform: translateX(0); - opacity: 1; - } -} \ No newline at end of file diff --git a/src/components/Layout/index.js b/src/components/Layout/index.js index cd5785a5..4f80a351 100644 --- a/src/components/Layout/index.js +++ b/src/components/Layout/index.js @@ -1,5 +1,5 @@ import Header from './Header' -import R_Sider from './R_Sider' +import L_Sider from './L_Sider' import Control from './Control' -export { Header, R_Sider, Control } +export { Header, L_Sider, Control } diff --git a/src/components/Layout/local_components/CustomMenu/index.js b/src/components/Layout/local_components/CustomMenu/index.js index ae04a1f8..2d17f50a 100644 --- a/src/components/Layout/local_components/CustomMenu/index.js +++ b/src/components/Layout/local_components/CustomMenu/index.js @@ -1,7 +1,6 @@ import React from 'react' import PropTypes from 'prop-types' -import { Icon as LegacyIcon } from '@ant-design/compatible'; -import { Menu, Button, Divider, Tooltip, message } from 'antd'; +import { Menu, Icon, Button, Divider, Tooltip, message } from 'antd' import Navlink from 'umi/navlink' import withRouter from 'umi/withRouter' import { arrayToTree, addLangPrefix} from 'utils' @@ -39,25 +38,26 @@ class CustomMenu extends React.Component { return data.map(item => { if (EditMode == true) { return ( -
- -
- ); +
+ +
+ + ) }else { return ( - {item.icon && } + {item.icon && } {item.name} - ); + ) } } - ); + ) } componentDidUpdate(){ @@ -89,7 +89,7 @@ class CustomMenu extends React.Component { : { openKeys: this.state.openKeys, } - return ( + return (
{collapsed? null :
@@ -114,10 +114,10 @@ class CustomMenu extends React.Component { {this.generateMenus(menuTree)} - {EditMode? (pins.length < 1)?
: null : (pins.length < 1)? : null } + {EditMode? (pins.length < 1)?
: null : (pins.length < 1)? : null } - ); + ) } } diff --git a/src/components/Layout/local_components/HeaderSearch/index.js b/src/components/Layout/local_components/HeaderSearch/index.js new file mode 100644 index 00000000..031f6f79 --- /dev/null +++ b/src/components/Layout/local_components/HeaderSearch/index.js @@ -0,0 +1,41 @@ +import { AutoComplete, Icon, Input } from 'antd'; +import { AutoCompleteProps, DataSourceItemType } from 'antd/es/auto-complete'; +import React, { Component } from 'react'; + +import classNames from 'classnames'; +import styles from './index.less' + + + +export default class HeaderSearch extends Component { + + constructor(props) { + super(props); + this.state = { + searchMode: '', + value: '' + }; + + } + + render() { + const { className, defaultValue, placeholder, open, ...restProps } = this.props; + const { searchMode, value } = this.state; + + return ( + + + + + + + ); + } +} diff --git a/src/components/Layout/local_components/HeaderSearch/index.tsx b/src/components/Layout/local_components/HeaderSearch/index.tsx deleted file mode 100644 index d9c10999..00000000 --- a/src/components/Layout/local_components/HeaderSearch/index.tsx +++ /dev/null @@ -1,148 +0,0 @@ -import { Icon as LegacyIcon } from '@ant-design/compatible'; -import { AutoComplete, Input } from 'antd'; -import { AutoCompleteProps, DataSourceItemType } from 'antd/es/auto-complete'; -import React, { Component } from 'react'; - -import classNames from 'classnames'; -import debounce from 'lodash/debounce'; -var styles = require('./index.less') - -export interface HeaderSearchProps {1 - onPressEnter: (value: string) => void; - onSearch: (value: string) => void; - onChange: (value: string) => void; - onVisibleChange: (b: boolean) => void; - className: string; - placeholder: string; - defaultActiveFirstOption: boolean; - dataSource: DataSourceItemType[]; - defaultOpen: boolean; - open?: boolean; - defaultValue?: string; -} - -interface HeaderSearchState { - value?: string; - searchMode: boolean; -} - -export default class HeaderSearch extends Component { - static defaultProps = { - defaultActiveFirstOption: false, - onPressEnter: () => {}, - onSearch: () => {}, - onChange: () => {}, - className: '', - placeholder: '', - dataSource: [], - defaultOpen: false, - onVisibleChange: () => {}, - }; - - static getDerivedStateFromProps(props: HeaderSearchProps) { - if ('open' in props) { - return { - searchMode: props.open, - }; - } - return null; - } - - private inputRef: Input | null = null; - - constructor(props: HeaderSearchProps) { - super(props); - this.state = { - searchMode: props.defaultOpen, - value: props.defaultValue, - }; - // this.debouncePressEnter = debounce(this.debouncePressEnter, 500, { - // leading: true, - // trailing: false, - // }); - } - - // onKeyDown = (e: React.KeyboardEvent) => { - // if (e.key === 'Enter') { - // this.debouncePressEnter(); - // } - // }; - - // onChange: AutoCompleteProps['onChange'] = value => { - // if (typeof value === 'string') { - // const { onSearch, onChange } = this.props; - // this.setState({ value }); - // if (onSearch) { - // onSearch(value); - // } - // if (onChange) { - // onChange(value); - // } - // } - // }; - - // enterSearchMode = () => { - // const { onVisibleChange } = this.props; - // onVisibleChange(true); - // this.setState({ searchMode: true }, () => { - // const { searchMode } = this.state; - // if (searchMode && this.inputRef) { - // this.inputRef.focus(); - // } - // }); - // }; - - // leaveSearchMode = () => { - // this.setState({ - // searchMode: false, - // }); - // }; - - // debouncePressEnter = () => { - // const { onPressEnter } = this.props; - // const { value } = this.state; - // onPressEnter(value || ''); - // }; - - render() { - const { className, defaultValue, placeholder, open, ...restProps } = this.props; - const { searchMode, value } = this.state; - delete restProps.defaultOpen; // for rc-select not affected - const inputClass = classNames(styles.input, { - [styles.show]: searchMode, - }); - - return ( - { - if (propertyName === 'width' && !searchMode) { - const { onVisibleChange } = this.props; - onVisibleChange(searchMode); - } - }} - > - - - { - // this.inputRef = node; - // }} - defaultValue={defaultValue} - aria-label={placeholder} - placeholder={placeholder} - // onKeyDown={this.onKeyDown} - // onBlur={this.leaveSearchMode} - /> - - - ); - } -} diff --git a/src/components/MainSidebar/index.js b/src/components/MainSidebar/index.js index 9b08a8d5..a0e06b0d 100644 --- a/src/components/MainSidebar/index.js +++ b/src/components/MainSidebar/index.js @@ -12,11 +12,6 @@ class MainSidebar extends React.Component { collapsed: false, }; - toggleCollapsed = () => { - this.setState({ - collapsed: !this.state.collapsed, - }); - }; render(){ return( diff --git a/src/components/UserProfile/index.js b/src/components/UserProfile/index.js new file mode 100644 index 00000000..79d1a2e8 --- /dev/null +++ b/src/components/UserProfile/index.js @@ -0,0 +1,70 @@ +import React from 'react' +import styles from './styles.less' +import * as ycore from 'ycore' +import * as antd from 'antd' +import { PageHeaderWrapper } from '@ant-design/pro-layout'; +import { string } from 'prop-types'; + +const userData = ycore.SDCP(); + +function isOwnProfile(id){ + if(id == userData.username){ + return true + } + return false +} + +const UserHeader = ({ inputIO }) => { + return ( + +
+ +
+
+
+

{inputIO.username}

+ {userData.about} +
+
+
+ } /> + ); + }; +class UserProfile extends React.Component { + constructor(props){ + super(props), + this.state = { + RenderValue: {}, + } + } + + componentDidMount(){ + const { regx } = this.props + this.initUser(regx) + } + initUser = (e) => { + const parsed = e.shift() + const raw = parsed.toString() + const string = raw.replace('/@', "") + + const uservalue = { id: '', userToken: userData.userToken } + // ycore.GetUserData() + let rendVal = { id: '0', username: string, avatar: '' } + this.setState({ RenderValue: rendVal}) + console.log(`User => ${string} `) + + + } + render(){ + const { regx } = this.props; + console.log( regx ) + return( +
+ {isOwnProfile(regx)?

Your profile

: null} + +
+ ) + } +} +export default UserProfile; diff --git a/src/components/UserProfile/styles.less b/src/components/UserProfile/styles.less new file mode 100644 index 00000000..fd4943c6 --- /dev/null +++ b/src/components/UserProfile/styles.less @@ -0,0 +1,262 @@ +@import '~themes/default'; + +.textOverflow() { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + word-break: break-all; +} + +// mixins for clearfix +// ------------------------ +.clearfix() { + zoom: 1; + &::before, + &::after { + display: table; + content: ' '; + } + &::after { + clear: both; + height: 0; + font-size: 0; + visibility: hidden; + } +} + +.activitiesList { + padding: 0 24px 8px 24px; + .username { + color: @text-color; + } + .event { + font-weight: normal; + } +} + +.pageHeaderContent { + display: flex; + .avatar { + flex: 0 1 72px; + & > span { + display: block; + width: 92px; + height: 92px; + } + } + .content { + font-family: "Poppins", sans-serif; + position: relative; + top: 4px; + flex: 1 1 auto; + margin-left: 24px; + color: @text-color-secondary; + line-height: 22px; + .contentTitle { + + color: @heading-color; + font-weight: 500; + font-size: 20px; + line-height: 28px; + } + } +} + +.extraContent { + .clearfix(); + + float: right; + white-space: nowrap; + .statItem { + position: relative; + display: inline-block; + padding: 0 32px; + > p:first-child { + margin-bottom: 4px; + color: @text-color-secondary; + font-size: @font-size-base; + line-height: 22px; + } + > p { + margin: 0; + color: @heading-color; + font-size: 30px; + line-height: 38px; + > span { + color: @text-color-secondary; + font-size: 20px; + } + } + &::after { + position: absolute; + top: 8px; + right: 0; + width: 1px; + height: 40px; + background-color: @border-color-split; + content: ''; + } + &:last-child { + padding-right: 0; + &::after { + display: none; + } + } + } +} + +.members { + a { + display: block; + height: 24px; + margin: 12px 0; + color: @text-color; + transition: all 0.3s; + .textOverflow(); + .member { + margin-left: 12px; + font-size: @font-size-base; + line-height: 24px; + vertical-align: top; + } + &:hover { + color: @primary-color; + } + } +} + +.projectList { + :global { + .ant-card-meta-description { + height: 44px; + overflow: hidden; + color: @text-color-secondary; + line-height: 22px; + } + } + .cardTitle { + font-size: 0; + a { + display: inline-block; + height: 24px; + margin-left: 12px; + color: @heading-color; + font-size: @font-size-base; + line-height: 24px; + vertical-align: top; + &:hover { + color: @primary-color; + } + } + } + .projectGrid { + width: 33.33%; + } + .projectItemContent { + display: flex; + height: 20px; + margin-top: 8px; + overflow: hidden; + font-size: 12px; + line-height: 20px; + .textOverflow(); + a { + display: inline-block; + flex: 1 1 0; + color: @text-color-secondary; + .textOverflow(); + &:hover { + color: @primary-color; + } + } + .datetime { + flex: 0 0 auto; + float: right; + color: @disabled-color; + } + } +} + +.datetime { + color: @disabled-color; +} + +@media screen and (max-width: @screen-xl) and (min-width: @screen-lg) { + .activeCard { + margin-bottom: 24px; + } + .members { + margin-bottom: 0; + } + .extraContent { + margin-left: -44px; + .statItem { + padding: 0 16px; + } + } +} + +@media screen and (max-width: @screen-lg) { + .activeCard { + margin-bottom: 24px; + } + .members { + margin-bottom: 0; + } + .extraContent { + float: none; + margin-right: 0; + .statItem { + padding: 0 16px; + text-align: left; + &::after { + display: none; + } + } + } +} + +@media screen and (max-width: @screen-md) { + .extraContent { + margin-left: -16px; + } + .projectList { + .projectGrid { + width: 50%; + } + } +} + +@media screen and (max-width: @screen-sm) { + .pageHeaderContent { + display: block; + margin: 10px; + .content { + margin-left: 0; + } + } + .extraContent { + .statItem { + float: none; + } + } +} + +@media screen and (max-width: @screen-xs) { + .projectList { + .projectGrid { + width: 100%; + } + } +} + + + +.main_container { + width: 1200px; + margin-left: auto; + margin-right: auto; +} +.main_content { + padding: 10px 20px; +} \ No newline at end of file diff --git a/src/components/YulioID/experimental/components/StatusBoxC.old.js b/src/components/YulioID/experimental/components/StatusBoxC.old.js index b902ff53..6aaa2d25 100644 --- a/src/components/YulioID/experimental/components/StatusBoxC.old.js +++ b/src/components/YulioID/experimental/components/StatusBoxC.old.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import { Icon as LegacyIcon } from '@ant-design/compatible'; +import { Icon } from 'antd'; import styles from '../yid.scss'; import PropTypes from 'prop-types'; @@ -22,13 +22,13 @@ class StatusBox extends Component { if (Reactive == 'loading') { return (
-
+



Wait a sec...
- ); + ) } if (Reactive == '200') { return ( diff --git a/src/components/YulioID/experimental/index.js b/src/components/YulioID/experimental/index.js index 4c60eed4..02052f8d 100644 --- a/src/components/YulioID/experimental/index.js +++ b/src/components/YulioID/experimental/index.js @@ -2,9 +2,7 @@ import React, { Component } from 'react' import {GetAuth, InitSDCP, DevOptions, asyncSDCP} from 'ycore'; import PropTypes from 'prop-types'; import { connect } from 'dva'; -import { Form, Icon as LegacyIcon } from '@ant-design/compatible'; -import '@ant-design/compatible/assets/index.css'; -import { Button, Input, Drawer, Collapse } from 'antd'; +import { Button, Form, Input, Drawer, Icon, Collapse } from 'antd' import styles from './yid.scss'; import formstyle from './formstyle.less' @@ -106,7 +104,7 @@ class YulioID extends Component { {ShowLoading ? (
- {StateIcon ? ( ) : ()} + {StateIcon ? ( ) : ()}



{StateMessage}
@@ -120,7 +118,7 @@ class YulioID extends Component {
@@ -142,7 +140,7 @@ class YulioID extends Component {
@@ -185,7 +183,7 @@ class YulioID extends Component { onClick={this.initFPassword} style={{ top: '8px' }} > - Forgotten password + Forgotten password
@@ -194,7 +192,7 @@ class YulioID extends Component { onClick={this.initRegister} style={{ top: '8px' }} > - Create an account + Create an account
@@ -204,7 +202,7 @@ class YulioID extends Component {
- ); + ) } } diff --git a/src/components/YulioID/legacy/forms.js b/src/components/YulioID/legacy/forms.js index 138a4a52..1ae723e3 100644 --- a/src/components/YulioID/legacy/forms.js +++ b/src/components/YulioID/legacy/forms.js @@ -11,21 +11,7 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import { connect } from 'dva' -import { Form, Icon as LegacyIcon } from '@ant-design/compatible'; -import '@ant-design/compatible/assets/index.css'; -import { - Button, - Row, - Input, - Drawer, - Collapse, - Select, - Checkbox, - Result, - Layout, - message, - notification, -} from 'antd'; +import { Button, Row, Form, Input, Drawer, Icon, Collapse, Select, Checkbox, Result, Layout, message, notification } from 'antd' import { Trans, withI18n } from '@lingui/react' import { setLocale } from 'utils' import { UIFxPY, UIFxList, DevOptions } from 'ycore'; @@ -209,7 +195,7 @@ render() {
- + {getFieldDecorator('Username', { rules: [{ required: true }] })( { this.handleUsername(text) }} /> )} @@ -217,7 +203,7 @@ render() {
- + {getFieldDecorator('Password', { rules: [{ required: true }] })( { this.handlePassword(text) }} /> )} @@ -226,11 +212,11 @@ render() {

Or

-
-
+
+
-
+



Wait a sec...
@@ -259,21 +245,21 @@ render() {
{getFieldDecorator('rgUsername', { rules: [{ required: true }] })( - } placeholder="Username" onChange={(text) => { this.handleRGUsername(text) }} /> + } placeholder="Username" onChange={(text) => { this.handleRGUsername(text) }} /> )}
{getFieldDecorator('rgEmail', { rules: [{ required: true }] })( - } placeholder="Email" onChange={(text) => { this.handleRGEmail(text) }} /> + } placeholder="Email" onChange={(text) => { this.handleRGEmail(text) }} /> )}
{getFieldDecorator('rgPassword', { rules: [{ required: true }] })( - } placeholder="Password" onChange={(text) => { this.handleRGPassword(text) }} /> + } placeholder="Password" onChange={(text) => { this.handleRGPassword(text) }} /> )}
@@ -282,9 +268,9 @@ render() {
* Clicking the register button you accept our terms and conditions
Register
-
+
-
+
Ok thanks, wait a minute...
@@ -302,14 +288,14 @@ render() {

To recover your account enter the email used to register

- + {getFieldDecorator('Email', { rules: [{ required: true }] })( { this.handleFPEmail(text) }} /> )}
{/* */}
-
+



Wait a sec...
@@ -322,13 +308,13 @@ render() { {/* NOTF */} -
+

{this.state.FailArray}

{MensageException}


- }> + }> - +
STATUS HANDLER => {this.state.ErrorType}
EXCEPTION => {this.state.api_response}
EXCEPTION MENSAGE => {MensageException}
@@ -343,7 +329,7 @@ render() { {/* SOTF */} -
+

Success

Please wait while process your data ...

@@ -351,14 +337,14 @@ render() { {/* RGSOTF */}
- +

Registered

Welcome to Dashboard, you will start discovering now

Please check your new data while we are process you ...

- ); + ) } } diff --git a/src/components/YulioID/legacy/index.js b/src/components/YulioID/legacy/index.js index 2016a375..f4669d1a 100644 --- a/src/components/YulioID/legacy/index.js +++ b/src/components/YulioID/legacy/index.js @@ -11,21 +11,7 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import { connect } from 'dva' -import { Form, Icon as LegacyIcon } from '@ant-design/compatible'; -import '@ant-design/compatible/assets/index.css'; -import { - Button, - Row, - Input, - Drawer, - Collapse, - Select, - Checkbox, - Result, - Layout, - message, - notification, -} from 'antd'; +import { Button, Row, Form, Input, Drawer, Icon, Collapse, Select, Checkbox, Result, Layout, message, notification } from 'antd' import { Trans, withI18n } from '@lingui/react' import { setLocale } from 'utils' import { UIFxPY, UIFxList, DevOptions } from 'ycore'; @@ -222,7 +208,7 @@ class YulioID extends PureComponent { message: 'For continue your request, is necessary to login with YulioID™ again', description: 'LoginBridge™ report a access token expiration, and is required you for continue login again with security reasons.', - icon: , + icon: , }); cookies.remove('access_token', { path: '/' }) }); @@ -362,7 +348,7 @@ class YulioID extends PureComponent { message: 'The instructions to recover your account have been sent to the email', description: 'If you cant find the email, try looking for it in the spam folder or try again', - icon: , + icon: , }); console.log(response) }); @@ -409,7 +395,7 @@ class YulioID extends PureComponent { placement: 'topLeft', message: 'Currently our servers are having operating problems', description: 'Please be patient until the services become available again, try again later. We apologize for the inconveniences', - icon: + icon: }), $("#loadingspn").css({ opacity: 0, "z-index": -1 }), _this.triggerNOTF(); diff --git a/src/components/YulioID/legacy/legacy.js b/src/components/YulioID/legacy/legacy.js index 1ca60365..eced2b83 100644 --- a/src/components/YulioID/legacy/legacy.js +++ b/src/components/YulioID/legacy/legacy.js @@ -11,21 +11,7 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import { connect } from 'dva' -import { Form, Icon as LegacyIcon } from '@ant-design/compatible'; -import '@ant-design/compatible/assets/index.css'; -import { - Button, - Row, - Input, - Drawer, - Collapse, - Select, - Checkbox, - Result, - Layout, - message, - notification, -} from 'antd'; +import { Button, Row, Form, Input, Drawer, Icon, Collapse, Select, Checkbox, Result, Layout, message, notification } from 'antd' import { Trans, withI18n } from '@lingui/react' import { setLocale } from 'utils' import { UIFxPY, UIFxList, DevOptions, avilableSDCP } from 'ycore'; @@ -228,7 +214,7 @@ class YulioID extends PureComponent { message: 'For continue your request, is necessary to login with YulioID™ again', description: 'LoginBridge™ report a access token expiration, and is required you for continue login again with security reasons.', - icon: , + icon: , }); cookies.remove('access_token', { path: '/' }) }); @@ -368,7 +354,7 @@ class YulioID extends PureComponent { message: 'The instructions to recover your account have been sent to the email', description: 'If you cant find the email, try looking for it in the spam folder or try again', - icon: , + icon: , }); console.log(response) }); @@ -415,7 +401,7 @@ class YulioID extends PureComponent { placement: 'topLeft', message: 'Currently our servers are having operating problems', description: 'Please be patient until the services become available again, try again later. We apologize for the inconveniences', - icon: + icon: }), $("#loadingspn").css({ opacity: 0, "z-index": -1 }), _this.triggerNOTF(); @@ -589,7 +575,7 @@ class YulioID extends PureComponent {
- + {getFieldDecorator('Username', { rules: [{ required: true }] })( { this.handleUsername(text) }} /> )} @@ -597,7 +583,7 @@ class YulioID extends PureComponent {
- + {getFieldDecorator('Password', { rules: [{ required: true }] })( { this.handlePassword(text) }} /> )} @@ -606,11 +592,11 @@ class YulioID extends PureComponent {

Or

-
-


+
+


-
+



Wait a sec...
@@ -639,21 +625,21 @@ class YulioID extends PureComponent {
{getFieldDecorator('rgUsername', { rules: [{ required: true }] })( - } placeholder="Username" onChange={(text) => { this.handleRGUsername(text) }} /> + } placeholder="Username" onChange={(text) => { this.handleRGUsername(text) }} /> )}
{getFieldDecorator('rgEmail', { rules: [{ required: true }] })( - } placeholder="Email" onChange={(text) => { this.handleRGEmail(text) }} /> + } placeholder="Email" onChange={(text) => { this.handleRGEmail(text) }} /> )}
{getFieldDecorator('rgPassword', { rules: [{ required: true }] })( - } placeholder="Password" onChange={(text) => { this.handleRGPassword(text) }} /> + } placeholder="Password" onChange={(text) => { this.handleRGPassword(text) }} /> )}
@@ -662,9 +648,9 @@ class YulioID extends PureComponent {
* Clicking the register button you accept our terms and conditions
Register
-
+
-
+
Ok thanks, wait a minute...
@@ -682,14 +668,14 @@ class YulioID extends PureComponent {

To recover your account enter the email used to register

- + {getFieldDecorator('Email', { rules: [{ required: true }] })( { this.handleFPEmail(text) }} /> )}
{/* */}
-
+



Wait a sec...
@@ -702,13 +688,13 @@ class YulioID extends PureComponent { {/* NOTF */} -
+

{this.state.FailArray}

{MensageException}


- }> + }> - +
STATUS HANDLER => {this.state.ErrorType}
EXCEPTION => {this.state.api_response}
EXCEPTION MENSAGE => {MensageException}
@@ -723,7 +709,7 @@ class YulioID extends PureComponent { {/* SOTF */} -
+

Success

Please wait while process your data ...

@@ -731,14 +717,14 @@ class YulioID extends PureComponent { {/* RGSOTF */}
- +

Registered

Welcome to Dashboard, you will start discovering now

Please check your new data while we are process you ...

- ); + ) } } diff --git a/src/components/YulioID/legacy/ycore_sdcp.js b/src/components/YulioID/legacy/ycore_sdcp.js index 4ff58e3b..192fad8b 100644 --- a/src/components/YulioID/legacy/ycore_sdcp.js +++ b/src/components/YulioID/legacy/ycore_sdcp.js @@ -9,9 +9,7 @@ //****************************************| import React, { PureComponent } from 'react' -import { Form, Icon as LegacyIcon } from '@ant-design/compatible'; -import '@ant-design/compatible/assets/index.css'; -import { message, notification } from 'antd'; +import { Form, Icon, message, notification } from 'antd' import { UIFxPY, UIFxList, DevOptions } from 'ycoreLegacy'; import { endpoints } from 'ycoreLegacy'; import $ from 'jquery'; @@ -141,7 +139,7 @@ export class SDCP extends PureComponent { message: 'For continue your request, is necessary to login with YulioID™ again', description: 'LoginBridge™ report a access token expiration, and is required you for continue login again with security reasons.', - icon: , + icon: , }); cookies.remove('access_token', { path: '/' }) }); @@ -271,7 +269,7 @@ export class SDCP extends PureComponent { message: 'The instructions to recover your account have been sent to the email', description: 'If you cant find the email, try looking for it in the spam folder or try again', - icon: , + icon: , }); console.log(response) }); @@ -316,7 +314,7 @@ export class SDCP extends PureComponent { placement: 'topLeft', message: 'Currently our servers are having operating problems', description: 'Please be patient until the services become available again, try again later. We apologize for the inconveniences', - icon: + icon: }), $("#loadingspn").css({ opacity: 0, "z-index": -1 }), _this.triggerNOTF(); diff --git a/src/components/index.js b/src/components/index.js index fe4609bc..073905cd 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -1,4 +1,5 @@ import CustomIcons from './CustomIcons' +import UserProfile from './UserProfile' import MainSidebar from './MainSidebar' import PostCard from './PostCard' import PostCreator from './PostCreator' @@ -12,4 +13,4 @@ import Page from './Page' import YulioID from './YulioID/experimental/index.js' import CoreLoader from './CoreLoader' -export { MyLayout, Editor, FilterItem, DropOption, Loader, Page, ScrollBar, YulioID, CoreLoader, PostCard, PostCreator, CustomIcons, MainSidebar} +export { UserProfile, MyLayout, Editor, FilterItem, DropOption, Loader, Page, ScrollBar, YulioID, CoreLoader, PostCard, PostCreator, CustomIcons, MainSidebar} diff --git a/src/layouts/PrimaryLayout.js b/src/layouts/PrimaryLayout.js index d590546e..191aa762 100644 --- a/src/layouts/PrimaryLayout.js +++ b/src/layouts/PrimaryLayout.js @@ -14,7 +14,7 @@ import Error from '../pages/404' import styles from './PrimaryLayout.less' const { Content } = Layout -const { Header, L_Sider, R_Sider, Control } = MyLayout +const { Header, L_Sider, Control } = MyLayout @withRouter @connect(({ app, loading }) => ({ app, loading })) @@ -118,8 +118,10 @@ class PrimaryLayout extends PureComponent { }, } - const RightSiderProps = { + const LeftSiderProps = { + menus, theme, + isMobile, collapsed, onCollapseChange, onThemeChange(theme) { @@ -131,6 +133,7 @@ class PrimaryLayout extends PureComponent { } const ContainerProps = { theme, + location } const MobileWarning = () =>{ if (resbypass == false) { @@ -151,6 +154,7 @@ class PrimaryLayout extends PureComponent {
+
@@ -159,7 +163,6 @@ class PrimaryLayout extends PureComponent {
-
) diff --git a/src/layouts/PrimaryLayout.less b/src/layouts/PrimaryLayout.less index bc3c9ab3..55b6e20f 100644 --- a/src/layouts/PrimaryLayout.less +++ b/src/layouts/PrimaryLayout.less @@ -19,13 +19,12 @@ } .content { - padding: 24px; height: 100vh; - width: 100%; - + /* width: 100vw; */ + margin: 5px 15px 5px 50px; } .container_light { - background-color: rgb(249, 249, 249); + background-color: #E2E6E9; transition: background-color 200ms linear; } // TODO: Complete full dark theme diff --git a/src/models/app.js b/src/models/app.js index 5b6359f9..a70aaa1c 100644 --- a/src/models/app.js +++ b/src/models/app.js @@ -27,7 +27,7 @@ export default { AppSettings: store.get('app_settings') || config.defaultSettings, locationQuery: {}, theme: store.get('theme') || 'light', - collapsed: store.get('collapsed') || true, + collapsed: store.get('collapsed') || false, notifications: [ { title: 'Hey! Test notification', diff --git a/src/pages/$page/index.js b/src/pages/$page/index.js new file mode 100644 index 00000000..bfa36133 --- /dev/null +++ b/src/pages/$page/index.js @@ -0,0 +1,38 @@ +import React, { PureComponent } from 'react' +import { UserProfile } from 'components' +import { pathMatchRegexp } from 'utils' +import Error404 from '../404.js' +import * as ycore from 'ycore' + +const userData = ycore.SDCP() + +class PageIndexer extends PureComponent { + componentDidMount(){ + + } + + + render() { + const {location} = this.props + + const matchUser = pathMatchRegexp("/@:id", location.pathname); + const matchSearch = pathMatchRegexp("/s/:id", location.pathname); + + if (matchUser) { + console.log(`User matched! ${location.pathname}`) + return(
+ +
) + } + if (matchSearch) { + console.log(`Search matched! ${location.pathname}`) + return(
+ +
) + } + // By default return Error 404 + return(
) + } +} + +export default PageIndexer \ No newline at end of file diff --git a/src/pages/$page/index.less b/src/pages/$page/index.less new file mode 100644 index 00000000..6d1c70d1 --- /dev/null +++ b/src/pages/$page/index.less @@ -0,0 +1,14 @@ +.content { + line-height: 2.4; + font-size: 13px; + + .item { + display: flex; + + & > div { + &:first-child { + width: 100px; + } + } + } + } \ No newline at end of file diff --git a/src/pages/$page/model/detail.js b/src/pages/$page/model/detail.js new file mode 100644 index 00000000..7543c66c --- /dev/null +++ b/src/pages/$page/model/detail.js @@ -0,0 +1,50 @@ +import { pathMatchRegexp } from 'utils' +import api from 'api' + +const { queryUser } = api + +export default { + namespace: 'userDetail', + + state: { + data: {}, + }, + + subscriptions: { + setup({ dispatch, history }) { + history.listen(({ pathname }) => { + const match = pathMatchRegexp('/:user', pathname) + if (match) { + dispatch({ type: 'query', payload: { id: match[1] } }) + } + }) + }, + }, + + effects: { + *query({ payload }, { call, put }) { + const data = yield call(queryUser, payload) + const { success, message, status, ...other } = data + if (success) { + yield put({ + type: 'querySuccess', + payload: { + data: other, + }, + }) + } else { + throw data + } + }, + }, + + reducers: { + querySuccess(state, { payload }) { + const { data } = payload + return { + ...state, + data, + } + }, + }, +} \ No newline at end of file diff --git a/src/pages/404.js b/src/pages/404.js index fe427ce6..9a576e6d 100644 --- a/src/pages/404.js +++ b/src/pages/404.js @@ -1,16 +1,16 @@ import React from 'react' -import { Icon as LegacyIcon } from '@ant-design/compatible'; +import { Icon } from 'antd' import { Page } from 'components' import styles from './404.less' -const Error = () => ( +const Error404 = () => (
- +

OBA BLYAT

ERROR 404

) -export default Error +export default Error404 diff --git a/src/pages/s/$search/index.js b/src/pages/s/$search/index.js new file mode 100644 index 00000000..5d1b59d8 --- /dev/null +++ b/src/pages/s/$search/index.js @@ -0,0 +1,62 @@ +import React, { PureComponent } from 'react' +import { UserProfile } from 'components' +import { pathMatchRegexp } from 'utils' +import styles from './styles.less' +import * as ycore from 'ycore' +import * as antd from 'antd' + +const userData = ycore.SDCP() + +class SearchPageIndexer extends PureComponent { + constructor(props){ + super(props), + this.state = { + SearchResult: '' + } + } + SeachKeywords(key){ + let formdata = new FormData(); + formdata.append("server_key", ycore.yConfig.server_key); + formdata.append("search_key", key); + const requestOptions = { + method: 'POST', + body: formdata, + } + const uriObj = (`${ycore.endpoints.search_endpoint}${ycore.GetUserToken.decrypted().UserToken}`) + fetch(uriObj, requestOptions) + .then(result => { + console.log(result) + this.setState({ SearchResult: result }) + + }) + .catch(error => console.log('error', error)); + } + + + render() { + const {location} = this.props + const matchSearch = pathMatchRegexp("/s/:id", location.pathname); + + const parsed = matchSearch.shift() + const raw = parsed.toString() + const string = raw.replace('/s/', "") + + + if (matchSearch) { + this.SeachKeywords(string) + console.log(`Search matched! ${location.pathname}`) + return( +
+

Results of {string}

+ + {this.state.SearchResult.toString()} + +
+ ) + } + + return(
Input Error
) + } +} + +export default SearchPageIndexer \ No newline at end of file diff --git a/src/pages/s/$search/styles.less b/src/pages/s/$search/styles.less new file mode 100644 index 00000000..4888e9c6 --- /dev/null +++ b/src/pages/s/$search/styles.less @@ -0,0 +1,7 @@ +@import '~themes/vars.less'; + +.searchHeader { + font-family: "Nunito", sans-serif; + font-size: 40px; + +} \ No newline at end of file diff --git a/src/themes/fonty.css b/src/themes/fonty.css index 4fb67951..f8ab11e4 100644 --- a/src/themes/fonty.css +++ b/src/themes/fonty.css @@ -1,4 +1,5 @@ @import url('https://fonts.googleapis.com/css?family=Alata&display=swap'); @import url('https://fonts.googleapis.com/css?family=Poppins:300,300i,500,500i,700'); @import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro&display=swap'); -@import url('https://fonts.googleapis.com/css?family=Kulim+Park&display=swap'); \ No newline at end of file +@import url('https://fonts.googleapis.com/css?family=Kulim+Park&display=swap'); +@import url('https://fonts.googleapis.com/css?family=Nunito&display=swap'); \ No newline at end of file