From cdb4d115c14c7b8a7c8116d53b3ab6c8365ffb48 Mon Sep 17 00:00:00 2001
From: srgooglo <38926803+srgooglo@users.noreply.github.com>
Date: Sun, 12 Apr 2020 22:36:02 +0200
Subject: [PATCH] change new render model
---
globals/endpoints/comty_endpoints.js | 2 +-
package.json | 29 +-
src/@ycore/libs/app_functions/pre.js | 2 +-
src/@ycore/libs/comty_ng/comty_get.js | 22 +
src/@ycore/libs/comty_ng/comty_post.js | 6 +
src/@ycore/libs/rs_cloud/pre.js | 2 +-
src/@ycore/ycore_worker.js | 2 -
src/components/HeaderSearch/index.js | 2 +
src/components/Layout/Secondary/index.js | 359 +++++++------
src/components/Layout/Secondary/index.less | 29 +-
src/components/Layout/Secondary/renders.js | 4 +-
src/components/MainFeed/index.js | 7 +-
src/components/PostCard/index.js | 29 +-
src/components/UserProfile/index.js | 8 +-
src/components/YulioID/index.js | 240 ---------
src/components/YulioID/index.less | 485 ------------------
src/components/index.js | 2 -
src/pages/404.js | 4 +-
src/pages/main/index.js | 2 +-
.../settings/components/earnings/index.js | 28 +-
20 files changed, 312 insertions(+), 952 deletions(-)
delete mode 100755 src/components/YulioID/index.js
delete mode 100755 src/components/YulioID/index.less
diff --git a/globals/endpoints/comty_endpoints.js b/globals/endpoints/comty_endpoints.js
index f35e04ff..45338a71 100644
--- a/globals/endpoints/comty_endpoints.js
+++ b/globals/endpoints/comty_endpoints.js
@@ -14,7 +14,7 @@ module.exports={
auth_endpoint: "https://api.ragestudio.net/RSA-COMTY/r/auth",
new_post: "https://comty.julioworld.club/api/new_post?access_token=",
get_config_endpoint: "https://api.ragestudio.net/RSA-COMTY/r/get-site-settings?access_token=",
- get_userData_endpoint: "https://api.ragestudio.net/RSA-COMTY/r/get-user-data?access_token=",
+ get_userData: "https://api.ragestudio.net/RSA-COMTY/r/get-user-data?access_token=",
update_userData_endpoint: "https://api.ragestudio.net/RSA-COMTY/r/update-user-data?access_token=",
removeToken: "https://api.ragestudio.net/RSA-COMTY/r/delete-access-token?access_token=",
register_endpoint: "https://api.ragestudio.net/RSA-COMTY/r/create-account",
diff --git a/package.json b/package.json
index 0d0a8b6a..8df2a3c6 100755
--- a/package.json
+++ b/package.json
@@ -3,7 +3,7 @@
"UUID": "C8mVSr-4nmPp2-pr5Vrz-CU4kg4",
"title": "Comty™",
"DevBuild": true,
- "version": "0.3.02",
+ "version": "0.3.09",
"stage": "dev-pre",
"description": "",
"main": "app/main.js",
@@ -16,19 +16,17 @@
}
},
"dependencies": {
- "@ant-design/compatible": "^1.0.1",
- "@ant-design/pro-layout": "^5.0.6",
"@capacitor/android": "^1.5.2",
"@capacitor/cli": "^1.5.2",
"@capacitor/core": "^1.5.2",
"@lingui/react": "^2.9.1",
- "@material-ui/core": "^4.9.3",
+ "@material-ui/core": "^4.9.9",
"@material-ui/icons": "^4.9.1",
- "antd": "^4.1.0",
+ "antd": "^4.1.1",
"axios": "^0.19.2",
"bag.js": "0.0.2",
"classnames": "^2.2.6",
- "cryptr": "^6.0.1",
+ "cryptr": "^6.0.2",
"dotenv": "^8.2.0",
"dva": "2.4.1",
"dva-model-extend": "^0.1.2",
@@ -43,7 +41,6 @@
"nprogress": "^0.2.0",
"os-utils": "0.0.14",
"path-to-regexp": "^6.1.0",
- "plyr-react": "^2.2.0",
"prop-types": "^15.7.2",
"radium": "^0.26.0",
"react-animations": "^1.0.0",
@@ -67,7 +64,7 @@
"@lingui/babel-preset-react": "^2.9.1",
"@lingui/cli": "^2.9.1",
"@lingui/loader": "^2.9.1",
- "@types/react": "^16.9.19",
+ "@types/react": "^16.9.33",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "^10.0.3",
"babel-plugin-dev-expression": "^0.2.2",
@@ -77,24 +74,24 @@
"cross-env": "^7.0.0",
"eslint": "^6.8.0",
"eslint-config-react-app": "^5.2.0",
- "eslint-plugin-flowtype": "^4.6.0",
- "eslint-plugin-import": "^2.20.1",
+ "eslint-plugin-flowtype": "^4.7.0",
+ "eslint-plugin-import": "^2.20.2",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.18.3",
- "husky": "^4.2.3",
+ "husky": "^4.2.4",
"less-vars-to-js": "^1.3.0",
- "lint-staged": "^10.0.7",
+ "lint-staged": "^10.1.3",
"module": "^1.2.5",
"now": "^17.0.3",
"prettier": "^1.19.1",
"rimraf": "^3.0.2",
- "stylelint": "^13.1.0",
+ "stylelint": "^13.3.1",
"stylelint-config-prettier": "^8.0.1",
"stylelint-config-standard": "^20.0.0",
"typescript": "^3.8.3",
- "umi": "^2.13.3",
- "umi-plugin-react": "^1.15.2",
- "wait-on": "^4.0.0",
+ "umi": "^2.13.12",
+ "umi-plugin-react": "^1.15.7",
+ "wait-on": "^4.0.2",
"workbox-webpack-plugin": "^5.0.0"
},
"engines": {
diff --git a/src/@ycore/libs/app_functions/pre.js b/src/@ycore/libs/app_functions/pre.js
index 3e5c5f8d..6a6485f3 100644
--- a/src/@ycore/libs/app_functions/pre.js
+++ b/src/@ycore/libs/app_functions/pre.js
@@ -10,7 +10,7 @@ import React from 'react'
export * from './modals.js'
-
+export {SwapMode}
export function QueryRuntime() {
const validBackup = ycore.validate.backup()
diff --git a/src/@ycore/libs/comty_ng/comty_get.js b/src/@ycore/libs/comty_ng/comty_get.js
index 2e0eb133..39a02b76 100644
--- a/src/@ycore/libs/comty_ng/comty_get.js
+++ b/src/@ycore/libs/comty_ng/comty_get.js
@@ -62,4 +62,26 @@ export const comty_get = {
)
},
+ get_user_data: (callback, payload) => {
+ let formdata = new FormData();
+ let callOptions = { includeUserID: false };
+
+ if (!payload) {
+ callOptions = { includeUserID: true }
+ formdata.append('fetch', 'user_data')
+ }
+
+ if (payload) {
+ payload.user_id? formdata.append('user_id', payload.user_id) : null
+ payload.fetch? formdata.append('fetch', payload.fetch) : null
+ }
+
+ API_Call(
+ (err, res) => {
+ return callback(err, res)
+ },
+ endpoints.comty_endpoints.get_userData,
+ formdata, callOptions
+ )
+ }
}
diff --git a/src/@ycore/libs/comty_ng/comty_post.js b/src/@ycore/libs/comty_ng/comty_post.js
index e7f06dc7..43096193 100644
--- a/src/@ycore/libs/comty_ng/comty_post.js
+++ b/src/@ycore/libs/comty_ng/comty_post.js
@@ -127,6 +127,12 @@ export const comty_post = {
formdata
)
},
+ hashtag: (callback, payload) => {
+ if (!payload) return false
+ const { hashtag } = payload
+ // DOING
+
+ },
getSaved: (callback, payload) => {
if (!payload) {
yconsole.log(
diff --git a/src/@ycore/libs/rs_cloud/pre.js b/src/@ycore/libs/rs_cloud/pre.js
index f180f1c7..77386b08 100644
--- a/src/@ycore/libs/rs_cloud/pre.js
+++ b/src/@ycore/libs/rs_cloud/pre.js
@@ -80,7 +80,7 @@ export const __rscloud = {
return callback(true, error)
}
},
- ycore.endpoints.comty_endpoints.get_userData_endpoint,
+ ycore.endpoints.comty_endpoints.get_userData,
formdata,
optionCall,
user_token
diff --git a/src/@ycore/ycore_worker.js b/src/@ycore/ycore_worker.js
index 5b8cb159..b207f3be 100755
--- a/src/@ycore/ycore_worker.js
+++ b/src/@ycore/ycore_worker.js
@@ -42,8 +42,6 @@ localforage.config({
storeName: package_json.name,
})
-
-
/**
* Convert a base64 string in a Blob according to the data and contentType.
*
diff --git a/src/components/HeaderSearch/index.js b/src/components/HeaderSearch/index.js
index d3aa7ccb..ca163480 100755
--- a/src/components/HeaderSearch/index.js
+++ b/src/components/HeaderSearch/index.js
@@ -32,6 +32,8 @@ export default class HeaderSearch extends Component {
openSearcher = () => {
const { value } = this.state
+ if (value.length < 1) return false
+ if (value == /\s/) return false
ycore.SecondarySwap.openSearch(value);
}
diff --git a/src/components/Layout/Secondary/index.js b/src/components/Layout/Secondary/index.js
index c618bd17..4d676d2b 100644
--- a/src/components/Layout/Secondary/index.js
+++ b/src/components/Layout/Secondary/index.js
@@ -5,18 +5,86 @@ import * as Icons from '@ant-design/icons'
import styles from './index.less'
import classnames from 'classnames'
-import { __priPost, __secComments, __priSearch, __trendings, __pro } from './renders.js'
+import {
+ __priPost,
+ __secComments,
+ __priSearch,
+ __trendings,
+ __pro,
+} from './renders.js'
export const SwapMode = {
close: () => {
SecondaryLayoutComponent.Swapper.close()
},
- openPost: (a, b) => {
- SecondaryLayoutComponent.setState({
- mode: 'post',
- global_raw: a,
- })
- SecondaryLayoutComponent.Swapper.open()
+ openPost: (id, content) => {
+ if (!id) return false
+ let d
+
+ if (content) {
+ d = content
+ } else {
+ const payload = { post_id: id }
+ ycore.comty_post.get((err, res) => {
+ if (err) {
+ return false
+ }
+ const post_data = JSON.parse(res)['post_data']
+ d = post_data
+ }, payload)
+ }
+
+ console.log(d)
+
+ if (d) {
+ try {
+ const pdata = (
+ <__priPost
+ isMobile={SecondaryLayoutComponent.props.isMobile}
+ payload={d}
+ />
+ )
+ SecondaryLayoutComponent.setState({ rd__pri: pdata, __pri_full: true })
+
+ return true
+ } catch (error) {
+ console.log(error)
+ return null
+ }
+ }
+ return false
+ },
+ openComments: (id, content) => {
+ if (!id) return false
+ let d
+
+ if (content) {
+ d = content
+ } else {
+ console.debug('Missing Payload [content]!')
+ localStorage.setItem('p_back_uid', postID)
+ const payload = { post_id: id }
+ ycore.comty_post.get((err, res) => {
+ if (err) {
+ return false
+ }
+ const post_comments = JSON.parse(res)['get_post_comments']
+ d = post_comments
+ }, payload)
+ }
+ if (d) {
+ try {
+ const pdata = <__secComments post_id={id} payload={d} />
+ SecondaryLayoutComponent.setState({
+ rd__sec: pdata,
+ __sec_active: true,
+ })
+ return true
+ } catch (error) {
+ console.log(error)
+ return null
+ }
+ }
},
openSearch: a => {
SecondaryLayoutComponent.setState({
@@ -31,98 +99,37 @@ export const SwapMode = {
global_raw: fragment,
})
SecondaryLayoutComponent.Swapper.unique()
- }
+ },
}
export default class Secondary extends React.PureComponent {
constructor(props) {
super(props),
- window.SecondaryLayoutComponent = this,
- this.state = {
- loading: true,
- half: false,
- swap: false,
- mode: '',
- gen_data: '',
- global_raw: '',
- pri_raw: '',
- sec_raw: '',
- }
+ (window.SecondaryLayoutComponent = this),
+ (this.state = {
+ loading: true,
+ gen_data: null,
+ // Lays
+ rd__pri: null,
+ rd__sec: null,
+ __pri_full: false,
+ __pri_half: false,
+ __sec_active: false,
+ __sec_full: false,
+ })
}
Swapper = {
close: () => {
this.setState({
- swap: false,
- half: false,
- unique: false,
- pri_raw: null,
- sec_raw: null,
- global_raw: null,
- mode: null,
+ rd__pri: null,
+ rd__sec: null,
+ __pri_full: false,
+ __pri_half: false,
+ __sec_active: false,
+ __sec_full: false,
})
},
- open: () => {
- this.setState({
- swap: true,
- half: false,
- unique: false,
- })
- },
- half : () => {
- this.setState({
- swap: false,
- half: true,
- unique: false,
- })
- },
- unique: ()=>{
- this.setState({
- swap: false,
- half: false,
- unique: true,
- })
- }
- }
-
- SwapBalanceContent(container) {
- switch (container) {
- case '__pri': {
- return this.__pri()
- }
- case '__sec': {
- return this.__sec()
- }
- default:
- return null
- }
- }
-
- __pri() {
- const dtraw = this.state.pri_raw
- switch (this.state.mode) {
- case 'post': {
- return this.renderPost(this.state.global_raw)
- }
- case 'search': {
- return this.renderSearch(dtraw)
- }
- case 'fragment': {
- return this.renderFragment()
- }
- default:
- return this.renderMain()
- }
- }
- __sec() {
- const dtraw = this.state.sec_raw
- switch (this.state.mode) {
- case 'post': {
- return this.renderComments(this.state.global_raw)
- }
- default:
- return null
- }
}
renderSearch = key => {
@@ -136,44 +143,26 @@ export default class Secondary extends React.PureComponent {
}, payload)
return (
-
Results of {key || '... nothing ?'}
+
+ Results of {key || '... nothing ?'}
+
<__priSearch payload={this.state.global_raw} />
)
}
- renderPost = payload => {
- const post_data = JSON.parse(payload)['post_data']
- return <__priPost isMobile={this.props.isMobile} payload={post_data} />
- }
-
- renderComments = payload => {
- try {
- const post_comments = JSON.parse(payload)['post_comments']
- const post_data = JSON.parse(payload)['post_data']
- return (
- <__secComments post_id={post_data.post_id} payload={post_comments} />
- )
- } catch (error) {
- return null
- }
- }
renderMain = payload => {
try {
const trending_data = JSON.parse(this.state.gen_data)['trending_hashtag']
- return(
+ return (
-
- {ycore.IsThisUser.pro()? <__pro /> : <__pro /> }
+ {ycore.IsThisUser.pro() ? <__pro /> : <__pro />}
<__trendings data={trending_data} />
-
-
)
} catch (error) {
return null
}
-
}
renderFragment = () => {
try {
@@ -183,46 +172,93 @@ export default class Secondary extends React.PureComponent {
return null
}
}
- componentDidMount(){
- ycore.comty_get.general_data((err,res)=> {
+
+ isOpen() {
+ if (
+ this.state.__pri_full ||
+ this.state.__pri_half ||
+ this.state.__sec_active ||
+ this.state.__sec_full
+ )
+ return true
+ return false
+ }
+
+ componentDidUpdate() {
+ if (this.isOpen()) {
+ document.addEventListener('keydown', this.escFunction, false)
+ } else {
+ document.removeEventListener('keydown', this.escFunction, false)
+ }
+ }
+
+ componentDidMount() {
+ ycore.comty_get.general_data((err, res) => {
if (err) return false
const notification_data = JSON.parse(res)['notifications']
- this.setState({ loading: false, gen_data: res, notification_data: notification_data })
-
+ this.setState({
+ loading: false,
+ gen_data: res,
+ notification_data: notification_data,
+ })
})
}
+ escFunction(event) {
+ if (event.keyCode === 27) {
+ SwapMode.close()
+ }
+ }
+
+ componentWillUnmount() {
+ document.removeEventListener('keydown', this.escFunction, false)
+ }
+
+ renderTarget(target) {
+ try {
+ switch (target) {
+ case '__pri': {
+ const fragment = this.state.rd__pri
+ return {fragment}
+ }
+ case '__sec': {
+ const fragment = this.state.rd__sec
+ return {fragment}
+ }
+ default:
+ return Invalid Render Target
+ }
+ } catch (error) {
+ console.log(error)
+ return null
+ }
+ }
+
render() {
const { userData, isMobile } = this.props
- if (!this.state.loading) return (
- <>
- {isMobile? null : }
-
- {isMobile? null :
-
-
-
{this.state.notification_data.length}
-
-
![]()
ycore.router.go(`@${userData.username}`)}
- src={userData.avatar}
- />
-
}
+ if (!this.state.loading)
+ return (
+ <>
+ {isMobile ? null :
}
+
+ {isMobile ? null : (
+
+
+
{this.state.notification_data.length}
+
+
![]()
ycore.router.go(`@${userData.username}`)}
+ src={userData.avatar}
+ />
+
+ )}
-
-
-
- {this.state.swap || this.state.half || this.state.unique ? (
+ {this.isOpen() ? (
}
@@ -231,24 +267,33 @@ export default class Secondary extends React.PureComponent {
Back
) : null}
- {this.SwapBalanceContent('__pri')}
-
-
-
- {this.SwapBalanceContent('__sec')}
-
+
+
+ {this.renderTarget('__pri')}
+
+
+ {this.renderTarget('__sec')}
+
-
- >
- )
- return null
+
+ >
+ )
+ return null
}
}
diff --git a/src/components/Layout/Secondary/index.less b/src/components/Layout/Secondary/index.less
index 1c1eab8f..f1580cfa 100644
--- a/src/components/Layout/Secondary/index.less
+++ b/src/components/Layout/Secondary/index.less
@@ -9,7 +9,7 @@
}
.secondary_wrapper {
- width: @secondary_wrapper_hidden_width;
+ width: auto;
height: 100vh;
z-index: 50;
@@ -19,18 +19,7 @@
overflow-x: hidden;
display: flex;
-
-
-
- &.active {
- width: @secondary_wrapper_showFull_width;
- >.secondary_container_1 {
- padding: @secondary_container_1_padding;
- }
- //@media (min-width: 1000px) {
- // width: 95.4%
- //}
- }
+
&.mobile {
width: 100%;
@@ -153,20 +142,28 @@
overflow: hidden;
transition: all @__Global_SwapAnimDuration ease-in-out;
- background-color: @secondary_container_bg_background;
+ background-color: transparent;
border-radius: @__Global_layout_border-rd;
}
.secondary_container_1 {
- width: 100%;
+ width: @secondary_wrapper_hidden_width;
height: 100%;
position: relative;
padding: 30px 30px 30px 35px;
color: @secondary_container_1_color;
-
+
+ &.full_opent {
+ width: @secondary_wrapper_showFull_width;
+ padding: @secondary_container_1_padding;
+ }
+ &.half {
+
+ }
+
:global {
.ant-btn {
color: @secondary_container_1_btn_color;
diff --git a/src/components/Layout/Secondary/renders.js b/src/components/Layout/Secondary/renders.js
index 790355b2..1c96f094 100644
--- a/src/components/Layout/Secondary/renders.js
+++ b/src/components/Layout/Secondary/renders.js
@@ -21,7 +21,7 @@ const VerifiedBadge = () => (
)
-export class __priPost extends React.Component {
+export class __priPost extends React.PureComponent {
renderContent(payload) {
const { id, postText, postFile_full, post_time, publisher } = payload
const {isMobile}= this.props
@@ -175,7 +175,7 @@ export class __secComments extends React.Component {
return (
-
Comments ({comment_data.length})
+ {/* Comments ({comment_data.length})
*/}
{loading ? (
diff --git a/src/components/MainFeed/index.js b/src/components/MainFeed/index.js
index e48e13e0..0de8027b 100755
--- a/src/components/MainFeed/index.js
+++ b/src/components/MainFeed/index.js
@@ -36,6 +36,7 @@ class MainFeed extends React.PureComponent {
super(props)
window.MainFeedComponent = this
this.state = {
+ AutoFeed: this.props.auto? true:false,
NewAV: false,
invalid: false,
loading: false,
@@ -51,7 +52,7 @@ class MainFeed extends React.PureComponent {
this.syncService(data)
})
}
-
+
toogleLoader() {
this.setState({ loading: !this.state.loading })
}
@@ -160,7 +161,7 @@ class MainFeed extends React.PureComponent {
render() {
- const { data, loading, isEnd, invalid, NewAV } = this.state
+ const { data, loading, isEnd, invalid, NewAV, AutoFeed } = this.state
const renderFeedPosts_payload = {data: data, loading: loading, isEnd: isEnd, feedGet: this.feedGet}
if (invalid){
@@ -176,7 +177,7 @@ class MainFeed extends React.PureComponent {
if (!loading) {
return (
- {NewAV? ComponentNewAV(() => this.feedGet.first()) : null}
+ {AutoFeed? NewAV? ComponentNewAV(() => this.feedGet.first()) : null : null}
{renderFeedPosts(renderFeedPosts_payload)}
)
diff --git a/src/components/PostCard/index.js b/src/components/PostCard/index.js
index ce1428a4..45406edb 100755
--- a/src/components/PostCard/index.js
+++ b/src/components/PostCard/index.js
@@ -38,20 +38,11 @@ class PostCard extends React.PureComponent {
this.setState({visibleMoreMenu: !this.state.visibleMoreMenu})
}
- goToPost(postID) {
- localStorage.setItem('p_back_uid', postID)
- const payload = { post_id: postID }
- ycore.comty_post.get((err, res) => {
- if (err) {
- return false
- }
- ycore.SecondarySwap.openPost(res)
- }, payload)
- }
-
render() {
const { payload, customActions } = this.props
const ActShowMode = ycore.AppSettings.auto_hide_postbar
+
+ const post_data = payload || emptyPayload;
const {
id,
post_time,
@@ -62,7 +53,17 @@ class PostCard extends React.PureComponent {
is_post_pinned,
is_liked,
post_comments,
- } = payload || emptyPayload
+ get_post_comments
+ } = post_data
+
+ const SwapThisPost = () => {
+ localStorage.setItem('p_back_uid', id)
+ if (postFile){
+ ycore.SwapMode.openPost(id, post_data)
+ }
+ ycore.SwapMode.openComments(id, get_post_comments)
+ }
+
const handlePostActions = {
delete: post_id => {
const payload = { post_id: post_id }
@@ -119,7 +120,7 @@ class PostCard extends React.PureComponent {
/>
,
0 ? true : false}>
- this.goToPost(id)} />
+ SwapThisPost()} />
,
]
const actions = customActions || defaultActions
@@ -174,7 +175,7 @@ class PostCard extends React.PureComponent {
return (
this.goToPost(id)}
+ onDoubleClick={() => SwapThisPost()}
hoverable
className={ActShowMode ? null : styles.showMode}
actions={actions}
diff --git a/src/components/UserProfile/index.js b/src/components/UserProfile/index.js
index 34f2772c..abd674e5 100755
--- a/src/components/UserProfile/index.js
+++ b/src/components/UserProfile/index.js
@@ -2,7 +2,6 @@ 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 { CustomIcons, MainFeed, PostCreator } from 'components'
import { SetHeaderSearchType } from 'components/HeaderSearch'
import * as Icons from '@ant-design/icons'
@@ -148,8 +147,8 @@ const moreMenu = (
-
+
@@ -215,8 +214,7 @@ const moreMenu = (
- }
- />
+
)}
{ycore.IsThisUser.same(UUID) ? (
diff --git a/src/components/YulioID/index.js b/src/components/YulioID/index.js
deleted file mode 100755
index 64a5eea3..00000000
--- a/src/components/YulioID/index.js
+++ /dev/null
@@ -1,240 +0,0 @@
-import React, { Component } from 'react'
-import { connect } from 'dva'
-import { Form, Icon as LegacyIcon } from '@ant-design/compatible'
-
-import { Button, Input, Drawer } from 'antd'
-import * as ycore from 'ycore'
-import * as Icons from '@ant-design/icons'
-
-import styles from './index.less'
-
-const FormItem = Form.Item
-
-@connect(({ loading }) => ({ loading }))
-@Form.create()
-class YulioID extends Component {
- constructor(props) {
- super(props)
- this.state = {
- // Drawers Visibility (Default on False)
- MainLoginVisible: true,
- ShowLoading: false,
- Answered: false,
- transition: false,
- }
- }
- // Handlers & others
- handleUsername(text) {
- this.setState({ RawUsername: text.target.value })
- }
- handlePassword(text) {
- this.setState({ RawPassword: text.target.value })
- }
- handleRetry = () => {
- this.setState({ ShowLoading: false, StateException: false, StateIcon: '' })
- }
- handleEnter = e => {
- this.handleLogin()
- }
-
- handleLogin = () => {
- var prefix = '[YID]: '
- const { RawUsername, RawPassword } = this.state
- var EncPassword = btoa(RawPassword)
- var EncUsername = btoa(RawUsername)
-
- if (!EncUsername || !EncPassword) {
- var message = 'Incomplete information!'
- ycore.yconsole.log(prefix, message)
- }
-
- if (EncUsername && EncPassword) {
- this.setState({ ShowLoading: true, StateMessage: 'Wait a sec...' })
- if (ycore.AppSettings.InfiniteLogin == true) {
- ycore.yconsole.log(prefix, 'InfiniteLogin is enabled! Disabled getAuth')
- } else {
- ycore.yconsole.log(prefix, 'Initialising login process...')
- const payload = { EncUsername, EncPassword }
- ycore.app_session.login((err, res) => {
- this.handleResponse(res)
- }, payload)
- }
- }
- }
-
- handleResponse = response => {
- if (response == '200') {
- ycore.LoginPage.transitionToogle()
- this.setState({
- StateIcon: 'login',
- StateMessage: 'Wait a sec...',
- StateException: false,
- })
-
- }
- if (response == '400') {
- this.setState({
- StateIcon: 'exclamation-circle',
- StateMessage: 'Invalid credentials',
- StateException: true,
- })
- }
- if (response == '404') {
- this.setState({
- StateIcon: 'exclamation-circle',
- StateMessage: 'Invalid Data',
- StateException: true,
- })
- }
- if (response == '500') {
- this.setState({
- StateIcon: 'cluster',
- StateMessage: 'Server Error',
- StateException: true,
- })
- }
- }
-
- render() {
- const { visible } = this.props
- const { getFieldDecorator } = this.props.form
- const { ShowLoading, StateIcon, StateMessage, StateException } = this.state
-
- return (
-
-
-
-
-
YulioID™
-
-
-
-
-
-
-
- )
- }
-}
-
-export default YulioID
diff --git a/src/components/YulioID/index.less b/src/components/YulioID/index.less
deleted file mode 100755
index 3aa46d12..00000000
--- a/src/components/YulioID/index.less
+++ /dev/null
@@ -1,485 +0,0 @@
- @import '~themes/index.less';
-
- .loginWrapper {
- :global {
- .ant-drawer-right.ant-drawer-open.no-mask {
- right: 1px;
- -ms-transform: translateX(1px);
- transform: translateX(1px);
- width: 100%;
- }
-
- .ant-drawer-right.ant-drawer-open .ant-drawer-content-wrapper {
- width: 100%;
- border-radius: 20px 0 0 20px;
- }
-
- .ant-drawer-body {
- height: 100%;
- }
-
- .ant-drawer {
- box-shadow: none;
- border-radius: 20px 0 0 20px;
- max-width: 512px;
- width: 100%;
- }
-
- .ant-drawer-content {
- background: #ffffff9f;
- border-radius: 20px 0 0 20px;
- }
- }
- }
-
- .StateIcon {
- font-size: 24px;
- margin: 13px;
- }
-
- .StateIcon_exception {
- font-size: 24px;
- margin: 13px;
- color: red !important;
-
- :global {
- i {
- color: red !important;
-
- }
- }
- }
-
- .mainlp {
- flex-direction: column;
- justify-content: center;
- align-items: center;
- display: flex;
- width: 100%;
- word-break: keep-all;
-
- color: @foregroundColor;
- text-align: left;
- }
-
- .mainlp .sectionlp {
- border: 1px solid @accentColor;
- position: relative;
- padding: 40px 40px 50px;
- }
-
- .mainlp .sectionlp>h6 {
- color: @accentColor;
- background: @canvasColor;
- position: absolute;
- top: -10px;
- left: 20px;
- padding: 0 10px;
- }
-
- .mainlp .sectionlp .h6lp.subheader {
- color: @grayColor;
- margin-top: 20px;
- margin-bottom: 20px;
- width: 100%;
- }
-
- @media (max-width: 992px) {
- section:not(:last-child) {
- border-width: 0 0 1px;
- }
-
- section:last-child {
- border-width: 0;
- }
- }
-
-
-
-
- .buttons {
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- }
-
- .buttons>* {
- flex: 1 1 calc(50% - 20px);
- margin-top: 20px;
- }
-
- .buttons>*:nth-child(odd) {
- margin-right: 20px;
- }
-
- a.buttonlp,
- input.buttonlp,
- .buttonlp {
- outline: none;
- width: 100%;
- text-align: center;
- display: inline-block;
- border: none;
- font: 500 16px/1 "Poppins", sans-serif;
- padding: 20px;
- cursor: pointer;
- border-radius: @borderRadius;
- background: @primaryColor;
- color: @backgroundColor;
- position: relative;
- top: 0;
- transition: 0.2s ease;
- }
-
- a.buttonlp:hover,
- a.buttonlp.hover,
- input.buttonlp:hover,
- input.buttonlp.hover,
- .buttonlp:hover,
- .buttonlp.hover {
- top: -3px;
- box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
- }
-
- a.buttonlp:active,
- a.buttonlp.active,
- input.buttonlp:active,
- .input.buttonlp.active,
- .buttonlp:active,
- .buttonlp.active {
- background: @primaryShade4;
- outline: none;
- box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
- top: 0;
- }
-
- a.buttonlp.disabled,
- input.buttonlp.disabled,
- .buttonlp.disabled {
- opacity: 0.4;
- user-select: none;
- pointer-events: none;
- }
-
- a.buttonlp.medium,
- input.buttonlp.medium,
- .buttonlp.medium {
- padding: 15px 18px;
- width: auto;
- }
-
- a.buttonlp.small,
- input.buttonlp.small,
- .buttonlp.small {
- padding: 10px 12px;
- width: auto;
- font-size: 14px;
- font-weight: 500;
- }
-
- a.buttonlp.secondary,
- input.buttonlp.secondary,
- .buttonlp.secondary {
- background: @secondaryColor;
- }
-
- a.buttonlp.secondary:active,
- a.buttonlp.secondary:focus,
- a.buttonlp.secondary.active,
- input.buttonlp.secondary:active,
- input.buttonlp.secondary:focus,
- input.buttonlp.secondary.active,
- .buttonlp.secondary:active,
- .buttonlp.secondary:focus,
- .buttonlp.secondary.active {
- background: @secondaryShade4;
- outline: none;
- }
-
- a.buttonlp.accent,
- input.buttonlp.accent,
- .buttonlp.accent {
- background: @accentColor;
- }
-
- a.buttonlp.accent:active,
- a.buttonlp.accent:focus,
- a.buttonlp.accent.active,
- input.buttonlp.accent:active,
- input.buttonlp.accent:focus,
- input.buttonlp.accent.active,
- .buttonlp.accent:active,
- .buttonlp.accent:focus,
- .buttonlp.accent.active {
- background: @accentShade4;
- }
-
- a.buttonlp.accent2,
- input.buttonlp.accent2,
- .buttonlp.accent2 {
- background: @accent2Color;
- }
-
- a.buttonlp.accent2:active,
- a.buttonlp.accent2:focus,
- a.buttonlp.accent2.active,
- input.buttonlp.accent2:active,
- input.buttonlp.accent2:focus,
- input.buttonlp.accent2.active,
- .buttonlp.accent2:active,
- .buttonlp.accent2:focus,
- .buttonlp.accent2.active {
- background: @accent2Shade4;
- }
-
- a.buttonlp.accent3,
- input.buttonlp.accent3,
- .buttonlp.accent3 {
- background: @accent3Color;
- }
-
- a.buttonlp.accent3:active,
- a.buttonlp.accent3:focus,
- a.buttonlp.accent3.active,
- input.buttonlp.accent3:active,
- input.buttonlp.accent3:focus,
- input.buttonlp.accent3.active,
- .buttonlp.accent3:active,
- .buttonlp.accent3:focus,
- .buttonlp.accent3.active {
- background: @accent3Shade4;
- }
-
- /*inputs*/
- .input__wrapper {
- margin-bottom: 10px;
-
- :global {
- .ant-col {
- width: 100%;
- }
- }
- }
-
- .inputRG__wrapper {
- margin-bottom: 0px;
- }
-
- .labelform {
- font-weight: 500;
- display: block;
- margin-bottom: 5px;
- }
-
- .inputform,
- select,
- textarea {
- height: 50px;
- font-size: 16px;
- border: 2px solid @neutralShade3;
- width: 100%;
- padding: 12px;
- font-family: "Poppins";
- border-radius: @borderRadius;
- color: @foregroundColor;
- background: @backgroundColor;
- }
-
- .inputform:focus,
- .inputform.active,
- select:focus,
- select.active,
- textarea:focus,
- textarea.active {
- outline: none;
- border-color: @primaryColor;
- }
-
- .inputform:disabled,
- select:disabled,
- textarea:disabled {
- cursor: not-allowed;
- background: @neutralShade1;
- opacity: 0.6;
- }
-
- Input .inputPasswordform {
- height: 50px;
- font-size: 16px;
- border: 2px solid @neutralShade3;
- width: 100%;
- padding: 12px;
- font-family: "Poppins";
- border-radius: @borderRadius;
- color: @foregroundColor;
- background: @backgroundColor;
- }
-
- Input .inputPasswordform:focus {
- outline: none;
- border-color: @primaryColor;
- }
-
- .inputform.input {
- height: 56px;
- font-size: 18px;
- padding: 15px;
- }
-
-
- /*spinner*/
- .spinner+.labellp {
- font-size: 14px;
- font-weight: 500;
- margin-top: 8px;
- display: inline-block;
- text-transform: uppercase;
- color: @primaryShade4;
- }
-
- .spinner1 .spinner {
- max-width: 50px;
- margin: auto;
- height: 20px;
- position: relative;
- }
-
- .spinner1 .spinner:after {
- content: "";
- position: absolute;
- width: 20px;
- height: 20px;
- left: -10%;
- background: @primaryColor;
- animation: spinnerLeftRight 1s infinite;
- }
-
- .spinner1 .spinner:before {
- content: "";
- position: absolute;
- width: 20px;
- height: 20px;
- left: -10%;
- background: @primaryShade2;
- opacity: 1;
- animation: spinnerLeftRight 1s infinite 0.06s;
- }
-
- @keyframes spinnerLeftRight {
- 0% {
- left: 85%;
- }
-
- 50% {
- left: -10%;
- }
-
- 100% {
- left: 85%;
- }
- }
-
-
-
- .formlogin {
- width: 95%;
- height: auto;
- border-radius: 10px;
- padding: 30px;
- box-shadow: 0 3px 15px rgba(51, 51, 51, 0.2);
- background: #ffffff44;
- margin: 20px 10px 20px 10px;
- position: relative;
- overflow: hidden;
- vertical-align: middle;
- }
-
- .formlogin .checkbox {
- margin-bottom: 30px;
- }
-
- .formlogin .spinner__wrapper {
- place-items: center;
- position: absolute;
- width: 100%;
- height: 100%;
- left: 0;
- top: 0;
- background: rgba(255, 255, 255, 0.85);
-
- }
-
-
- .preheader {
- position: relative;
- top: 0;
-
- h1 {
- font: 700 48px "Nunito", sans-serif;
- text-align: center;
- margin-bottom: 10px;
- }
-
- h6 {
- padding: 3em 0 0 0;
- line-height: 1px;
- display: flex;
- font: 500 16px/1 "Poppins", sans-serif;
- text-transform: uppercase;
-
- img {
- vertical-align: middle;
- height: 17px;
- }
- }
- }
-
- .moreActions {
- display: flex;
- margin: auto;
- align-content: center;
- position: relative;
- width: 100%;
-
- :global {
- .ant-btn {
- margin: auto;
- }
- }
- }
-
- @media (max-width: 472px) {
- .moreActions {
- display: grid;
- align-content: center;
- position: relative;
- width: 100%;
-
- :global {
- .ant-btn {
- margin: 5px;
- }
- }
- }
- }
-
- .resultbox {
- h6 {
- font-family: "Poppins", sans-serif;
- text-align: center;
- font-size: 16px;
- margin: auto;
- vertical-align: middle;
- }
-
- .retryBTN {
- text-align: center;
- width: 100%;
- position: absolute;
- bottom: 0;
- margin: auto;
- vertical-align: bottom;
- }
-
- margin: auto;
- }
\ No newline at end of file
diff --git a/src/components/index.js b/src/components/index.js
index 7583c7a5..fd9f74ea 100755
--- a/src/components/index.js
+++ b/src/components/index.js
@@ -11,7 +11,6 @@ import App_about from './App_about'
import * as MyLayout from './Layout/index.js'
import HeaderSearch from './HeaderSearch'
import PageTransition from './PageTransition'
-import YulioID from './YulioID'
// User Components
import UserBadges from './UserBadges'
@@ -34,7 +33,6 @@ export {
PageTransition,
SearchCard,
HeaderSearch,
- YulioID,
UserProfile,
MyLayout,
Loader,
diff --git a/src/pages/404.js b/src/pages/404.js
index ddc21062..a0c3ba3c 100755
--- a/src/pages/404.js
+++ b/src/pages/404.js
@@ -1,11 +1,9 @@
import React from 'react'
-import { Icon as LegacyIcon } from '@ant-design/compatible'
-import { Page } from 'components'
import styles from './404.less'
const Error404 = () => (
-
+
OBA BLYAT
ERROR 404
diff --git a/src/pages/main/index.js b/src/pages/main/index.js
index 5f1e604a..1eaaff42 100755
--- a/src/pages/main/index.js
+++ b/src/pages/main/index.js
@@ -8,7 +8,7 @@ export default class Main extends React.Component {
return (
)
}
diff --git a/src/pages/settings/components/earnings/index.js b/src/pages/settings/components/earnings/index.js
index db1aa206..525aea65 100644
--- a/src/pages/settings/components/earnings/index.js
+++ b/src/pages/settings/components/earnings/index.js
@@ -3,13 +3,35 @@ import * as ycore from 'ycore'
import * as antd from 'antd'
import * as Icons from '@ant-design/icons'
+
export default class Earnings extends React.Component {
+ state = {
+ loading: true,
+
+ }
+ componentDidMount(){
+ ycore.comty_get.get_user_data((err,res)=>{
+ if (err) return false
+ try {
+ const a = JSON.parse(res)['user_data']
+ this.setState({ loading: false, pro_points: a.points })
+ } catch (error) {
+
+ }
+ })
+
+ }
render() {
return (
-
- Redeem an Code
-
+
+
+
Your Pro Points
+ {this.state.pro_points}
+
)
}