diff --git a/src/components/MainFeed/index.js b/src/components/MainFeed/index.js
index 02c2b63a..09a7f718 100755
--- a/src/components/MainFeed/index.js
+++ b/src/components/MainFeed/index.js
@@ -15,6 +15,7 @@ class MainFeed extends React.Component {
super(props)
window.MainFeedComponent = this;
this.state = {
+ invalid: false,
loading: false,
data: [],
fkey: 0
@@ -38,7 +39,17 @@ class MainFeed extends React.Component {
}
this.toogleLoader()
ycore.GetPosts(uid, get, '0', (err, result) => {
+ if (err) {
+ ycore.notifyError('Error when get data from this input')
+ return
+ }
+ console.log(result)
+ if (JSON.parse(result).api_status == '400') {
+ this.setState({ invalid: true })
+ return
+ }
const parsed = JSON.parse(result)['data']
+
const isEnd = parsed.length < ycore.DevOptions.limit_post_catch? true : false
this.setState({ isEnd: isEnd, data: parsed, loading: false })
})
@@ -105,10 +116,17 @@ class MainFeed extends React.Component {
}
render(){
- const { loading } = this.state;
+ const { loading, invalid } = this.state;
return (
- { loading?
+ {invalid?
+
+
+ Invalid Data
+ If this error has occurred several times, try restarting the app
+
+ :
+ loading?
diff --git a/src/components/UserProfile/index.js b/src/components/UserProfile/index.js
index 1cfc208f..80eec059 100755
--- a/src/components/UserProfile/index.js
+++ b/src/components/UserProfile/index.js
@@ -23,6 +23,7 @@ class UserProfile extends React.Component {
constructor(props){
super(props),
this.state = {
+ invalid: false,
UUID: '',
RenderValue: {},
loading: true,
@@ -57,7 +58,9 @@ class UserProfile extends React.Component {
if (!rp['0']) {
ycore.yconsole.log('Bad response / User not found')
const val = { id: null, username: 'User not found!'}
- this.setState({ RenderValue: val, loading: false })
+ this.setState({ invalid: true, RenderValue: val, loading: false })
+ ycore.crouter.native(`main`)
+ antd.message.warning(`Its seams like @${string} not exist`);
return
}
const c1 = rp['0'].username.toLowerCase()
@@ -111,12 +114,12 @@ class UserProfile extends React.Component {
);
};
render(){
- const { loading, UUID } = this.state
+ const { loading, UUID, invalid } = this.state
return(
{loading?
:
(
- {this.UserHeader(this.state.RenderValue)}
+ {invalid? null: this.UserHeader(this.state.RenderValue)}
)
}
diff --git a/src/pages/__m/index.js b/src/pages/__m/index.js
index 53992447..499177ee 100755
--- a/src/pages/__m/index.js
+++ b/src/pages/__m/index.js
@@ -66,6 +66,20 @@ export default class __m extends React.Component {
+
+
Test yCore™
+
+
+
ycore.notifyError('Yep, its not empty, jeje funny')} > Send empty notifyError()
+
ycore.notifyError(`ycore.GetPosts(uid, get, '0', (err, result) => {
+const parsed = JSON.parse(result)['data']
+const isEnd = parsed.length < ycore.DevOptions.limit_post_catch? true : false
+this.setState({ isEnd: isEnd, data: parsed, loading: false })
+})
+
+`)} > Send mock notifyError()
+
+
SDCP™
diff --git a/src/pages/g/$group/index.js b/src/pages/g/$group/index.js
new file mode 100644
index 00000000..436cb37b
--- /dev/null
+++ b/src/pages/g/$group/index.js
@@ -0,0 +1,97 @@
+import React, { PureComponent } from 'react'
+import { pathMatchRegexp } from 'utils'
+import { SearchCard } from 'components'
+import styles from './styles.less'
+import * as ycore from 'ycore'
+import * as antd from 'antd'
+import * as Icons from '@ant-design/icons';
+import Icon from '@ant-design/icons'
+
+const userData = ycore.SDCP()
+
+class GroupIndexer extends PureComponent {
+ constructor(props){
+ super(props),
+ this.state = {
+ SearchResult: '',
+ loading: true
+ }
+ }
+ toogleLoading(){
+ this.setState({loading: !this.state.loading})
+ }
+ componentDidMount(){
+ try {
+ const {location} = this.props
+ const matchSearch = pathMatchRegexp("/s/:id", location.pathname);
+ const parsed = matchSearch.shift()
+ const raw = parsed.toString()
+ const string = raw.replace('/s/', "")
+
+
+ } catch (err) {
+ ycore.notifyError(err)
+ }
+ }
+
+
+ EntryComponent = (t, source) => {
+ try {
+ return(
+
+ )
+
+ } catch (error) {
+ console.log(error)
+ return
Render Error
+ }
+
+
+ }
+
+ render() {
+ const {location} = this.props
+ const matchSearch = pathMatchRegexp("/g/:id", location.pathname);
+
+ const parsed = matchSearch.shift()
+ const raw = parsed.toString()
+ const string = raw.replace('/g/', "")
+
+
+ if (matchSearch) {
+ return(
+
+
Results of {string}
+
+
+ {this.state.loading? null : this.renderResult(this.state.SearchResult)}
+
+
+
+ )
+ }
+
+ return(
Render Error )
+ }
+}
+
+export default GroupIndexer
\ No newline at end of file
diff --git a/src/pages/g/$group/styles.less b/src/pages/g/$group/styles.less
new file mode 100644
index 00000000..d76a307a
--- /dev/null
+++ b/src/pages/g/$group/styles.less
@@ -0,0 +1,18 @@
+@import '~themes/vars.less';
+
+.searchHeader {
+ font-family: "Nunito", sans-serif;
+ font-size: 40px;
+ text-align: center;
+ margin-top: 7px;
+}
+.results {
+ padding: 10px;
+}
+.searchEntry {
+ :global{
+ .antd-card{
+ margin: auto;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/pages/hamza/index.js b/src/pages/hamza/index.js
deleted file mode 100755
index 6acd1650..00000000
--- a/src/pages/hamza/index.js
+++ /dev/null
@@ -1,14 +0,0 @@
- import React from 'react'
- import * as ycore from 'ycore'
-
- export default class Hamza extends React.PureComponent {
- render() {
- return (
-
-
- Españita Hola
-
-
- )
- }
- }
diff --git a/src/pages/settings/components/base.js b/src/pages/settings/components/base.js
index 0c13c00a..247e6093 100755
--- a/src/pages/settings/components/base.js
+++ b/src/pages/settings/components/base.js
@@ -4,6 +4,7 @@ import { AppSettings } from '../../../../globals/settings.js'
import { DevOptions, ControlBar } from 'ycore'
import * as ycore from "ycore"
import * as Icons from '@ant-design/icons'
+import Icon from '@ant-design/icons'
import { CustomIcons } from 'components'
class Base extends Component {
@@ -107,6 +108,8 @@ class Base extends Component {
Behaviors
+
+
{this.SettingRender(this.state.SettingRepo)}
diff --git a/src/pages/settings/components/notification.js b/src/pages/settings/components/notification.js
index 26bd3277..2e4a04cd 100755
--- a/src/pages/settings/components/notification.js
+++ b/src/pages/settings/components/notification.js
@@ -1,48 +1,16 @@
-import * as antd from 'antd';
-import React, { Component, Fragment } from 'react';
+import React from 'react';
+import * as ycore from "ycore"
+import * as Icons from '@ant-design/icons'
+import styles from './notification.less'
-class NotificationView extends Component {
- getData = () => {
- const Action = (
-
- );
- return [
- {
- title: 'Title 1',
- description: 'Description 1',
- actions: [Action],
- },
- {
- title: 'Title 2',
- description: 'Description 2',
- actions: [Action],
- },
- {
- title: 'Title 3',
- description: 'Description 3',
- actions: [Action],
- },
- ];
- };
+class NotificationView extends React.Component {
render() {
- const data = this.getData();
return (
-
- (
-
-
-
- )} />
-
- );
+
+
Notifications
+
+ )
}
}
diff --git a/src/pages/settings/components/notification.less b/src/pages/settings/components/notification.less
new file mode 100644
index 00000000..0e1fea32
--- /dev/null
+++ b/src/pages/settings/components/notification.less
@@ -0,0 +1,16 @@
+@import '~themes/vars.less';
+
+.main{
+
+ :global{
+ h2{
+ font-weight: 500;
+ }
+ .anticon{
+ color: #2d2d2d;
+
+ }
+
+
+ }
+}
\ No newline at end of file
diff --git a/src/pages/settings/components/security.js b/src/pages/settings/components/security.js
index e1937669..a923e08e 100755
--- a/src/pages/settings/components/security.js
+++ b/src/pages/settings/components/security.js
@@ -1,84 +1,15 @@
-import React, { Component, Fragment } from 'react';
-import { List } from 'antd';
-
-const passwordStrength = {
- strong: (
-
- Strong
-
- ),
- medium: (
-
- Medium
-
- ),
- weak: (
-
- Weak
-
- ),
-};
-
-class SecurityView extends Component {
- getData = () => [
- {
- title:
Password
,
- description: (
-
- Something
- {passwordStrength.strong}
-
- ),
- actions: [
-
- Modify
- ,
- ],
- },
- {
- title:
Security question
,
- description: 'Security cuesting seting',
- actions: [
-
- Set
- ,
- ],
- },
- {
- title: 'Mail',
- description: 'YourEmail@jeje.com',
- actions: [
-
- Modify
- ,
- ],
- },
- {
- title: 'mfa',
- description: 'mfa settings',
- actions: [
-
- Bind
- ,
- ],
- },
- ];
+import React from 'react';
+import * as ycore from "ycore"
+import * as Icons from '@ant-design/icons'
+import styles from './security.less'
+class SecurityView extends React.Component {
render() {
- const data = this.getData();
return (
-
- (
-
-
-
- )}
- />
-
- );
+
+
Your Security & Privacy
+
+ )
}
}
diff --git a/src/pages/settings/components/security.less b/src/pages/settings/components/security.less
new file mode 100644
index 00000000..0e1fea32
--- /dev/null
+++ b/src/pages/settings/components/security.less
@@ -0,0 +1,16 @@
+@import '~themes/vars.less';
+
+.main{
+
+ :global{
+ h2{
+ font-weight: 500;
+ }
+ .anticon{
+ color: #2d2d2d;
+
+ }
+
+
+ }
+}
\ No newline at end of file
diff --git a/src/pages/settings/index.js b/src/pages/settings/index.js
index f7201c9e..a2890cad 100755
--- a/src/pages/settings/index.js
+++ b/src/pages/settings/index.js
@@ -14,20 +14,18 @@ import Earnings from './components/earnings.js'
const { Item } = Menu;
const menuMap = {
- base: 'General',
- security: 'Security & Privacity',
- notification: 'Notification',
- earnings: 'Earnings',
- about: 'About'
+ base: (
General),
+ security: (
Security & Privacity),
+ notification: (
Notification),
+ earnings: (
Earnings),
+ about: (
About)
};
-const { Title } = Typography;
class GeneralSettings extends React.Component {
constructor(props) {
super(props);
this.state = {
- mode: 'inline',
selectKey: 'base',
};
}
@@ -62,33 +60,22 @@ class GeneralSettings extends React.Component {
};
render() {
- const { mode, selectKey } = this.state;
+ const { selectKey } = this.state;
return (
-
-
{this.getMenu()}
-
- {
- if (ref) {
- this.main = ref;
- }
- }}
+
+
+
Settings
+
-
+ {this.getMenu()}
+
+
+
+ {this.renderChildren()}
+
);
}
diff --git a/src/pages/settings/style.less b/src/pages/settings/style.less
index c9ac52f1..a89d19b7 100755
--- a/src/pages/settings/style.less
+++ b/src/pages/settings/style.less
@@ -1,21 +1,21 @@
@import '~themes/vars.less';
-.titleHead{
- font-family: "Nunito", sans-serif;
-}
+
.main {
+ font-family: "Nunito", sans-serif;
+ margin: 20px 0 0 0;
display: flex;
width: 100%;
height: 100%;
overflow: auto;
color: @DarkMode-color_container;
- background-color: transparent;
+ background-color: #ffffff;
+ padding: 15px;
+ border-radius: 10px;
.leftMenu {
width: 224px;
- border-right: @border-width-base @border-style-base @border-color-split;
:global {
-
.ant-menu-inline {
color: @DarkMode-color_container;
background-color: transparent;
@@ -41,43 +41,19 @@
}
}
:global {
- .ant-list-split .ant-list-item:last-child {
- border-bottom: 1px solid @border-color-split;
- }
.ant-list-item {
- padding-top: 14px;
- padding-bottom: 14px;
+ padding-top: 7px;
+ padding-bottom: 7px;
+ }
+ .ant-list-split .ant-list-item {
+ border-bottom: 0;
+ }
+ .ant-list-item-meta-title {
+ color: rgba(0, 0, 0, 0.733);
+ font-size: 14px;
}
}
}
-:global {
- .ant-list-item-meta {
- // 账号绑定图标
- .taobao {
- display: block;
- color: #ff4000;
- font-size: 48px;
- line-height: 48px;
- border-radius: @border-radius-base;
- }
- .dingding {
- margin: 2px;
- padding: 6px;
- color: #fff;
- font-size: 32px;
- line-height: 32px;
- background-color: #2eabff;
- border-radius: @border-radius-base;
- }
- .alipay {
- color: #2eabff;
- font-size: 48px;
- line-height: 48px;
- border-radius: @border-radius-base;
- }
- }
-
-}
@media screen and (max-width: @screen-md) {
.main {