From 37654a11c3275e7bbbe084412e86c390a56b8355 Mon Sep 17 00:00:00 2001 From: srgooglo <38926803+srgooglo@users.noreply.github.com> Date: Fri, 27 Mar 2020 04:16:39 +0100 Subject: [PATCH] Endpoints Update --- globals/endpoints/comty_endpoints.js | 23 ++ globals/endpoints/index.js | 2 + globals/endpoints/twitter_endpoints.js | 6 + src/@ycore/libs/comty_ng/comty_get.js | 8 +- src/@ycore/libs/comty_ng/comty_post.js | 20 +- .../libs/comty_ng/comty_post_comment.js | 4 +- src/@ycore/libs/comty_ng/comty_search.js | 2 +- src/@ycore/libs/comty_ng/comty_user.js | 6 +- src/@ycore/libs/rs_cloud/pre.js | 6 +- src/@ycore/ycore_worker.js | 2 +- src/components/Layout/ChatSider.less | 251 ------------------ src/components/Layout/Secondary/index.less | 6 +- src/components/PostCreator/index.js | 6 +- 13 files changed, 61 insertions(+), 281 deletions(-) create mode 100644 globals/endpoints/comty_endpoints.js create mode 100644 globals/endpoints/index.js create mode 100644 globals/endpoints/twitter_endpoints.js delete mode 100755 src/components/Layout/ChatSider.less diff --git a/globals/endpoints/comty_endpoints.js b/globals/endpoints/comty_endpoints.js new file mode 100644 index 00000000..f35e04ff --- /dev/null +++ b/globals/endpoints/comty_endpoints.js @@ -0,0 +1,23 @@ +module.exports={ + comty_endpoints: { + comments_actions: "https://api.ragestudio.net/RSA-COMTY/r/comments?access_token=", + get_post_data: "https://api.ragestudio.net/RSA-COMTY/r/get-post-data?access_token=", + get_user_tags: "https://api.ragestudio.net/RSA-COMTY/r/user_tags?access_token=", + get_general_data: "https://api.ragestudio.net/RSA-COMTY/r/get-general-data?access_token=", + follow_user: "https://api.ragestudio.net/RSA-COMTY/r/follow-user?access_token=", + action_post: "https://api.ragestudio.net/RSA-COMTY/r/post-actions?access_token=", + get_posts: "https://api.ragestudio.net/RSA-COMTY/r/posts?access_token=", + find_user: "https://api.ragestudio.net/RSA-COMTY/r/find_user?access_token=", + search_endpoint: "https://api.ragestudio.net/RSA-COMTY/r/search?access_token=", + all_sessions: "https://api.ragestudio.net/RSA-COMTY/r/sessions?access_token=", + get_sessions: "https://api.ragestudio.net/RSA-COMTY/r/session_id?access_token=", + 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=", + 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", + resetPassword_endpoint: "https://api.ragestudio.net/RSA-COMTY/r/send-reset-password-email?access_token=", + } +} \ No newline at end of file diff --git a/globals/endpoints/index.js b/globals/endpoints/index.js new file mode 100644 index 00000000..d7e3836d --- /dev/null +++ b/globals/endpoints/index.js @@ -0,0 +1,2 @@ +export * from './comty_endpoints.js' +export * from './twitter_endpoints.js' \ No newline at end of file diff --git a/globals/endpoints/twitter_endpoints.js b/globals/endpoints/twitter_endpoints.js new file mode 100644 index 00000000..ba18f6ab --- /dev/null +++ b/globals/endpoints/twitter_endpoints.js @@ -0,0 +1,6 @@ +module.exports = { + twitter_endpoints: { + oa_access: "https://api.twitter.com/oauth/access_token", + oa_request: "https://api.twitter.com/oauth/request_token", + } +} \ No newline at end of file diff --git a/src/@ycore/libs/comty_ng/comty_get.js b/src/@ycore/libs/comty_ng/comty_get.js index 53230009..f7f23d63 100644 --- a/src/@ycore/libs/comty_ng/comty_get.js +++ b/src/@ycore/libs/comty_ng/comty_get.js @@ -9,7 +9,7 @@ export const comty_get = { (err, res) => { return callback(err, res) }, - endpoints.all_sessions, + endpoints.comty_endpoints.all_sessions, formdata ) }, @@ -26,7 +26,7 @@ export const comty_get = { return callback(err, '0x0000') } }, - endpoints.get_sessions, + endpoints.comty_endpoints.get_sessions, formdata) }, session: (callback) => { @@ -36,7 +36,7 @@ export const comty_get = { API_Call((err,res) => { return callback(err, res) }, - endpoints.get_sessions, + endpoints.comty_endpoints.get_sessions, formdata) }, general_data: (callback, payload) => { @@ -50,7 +50,7 @@ export const comty_get = { (err, res) => { return callback(err, res) }, - endpoints.get_general_data, + endpoints.comty_endpoints.get_general_data, formdata ) }, diff --git a/src/@ycore/libs/comty_ng/comty_post.js b/src/@ycore/libs/comty_ng/comty_post.js index 87f6582e..400f39ed 100644 --- a/src/@ycore/libs/comty_ng/comty_post.js +++ b/src/@ycore/libs/comty_ng/comty_post.js @@ -26,7 +26,7 @@ export const comty_post = { (err, res) => { return callback(err, res) }, - endpoints.get_posts, + endpoints.comty_endpoints.get_posts, formdata ) }, @@ -47,7 +47,7 @@ export const comty_post = { (err, res) => { return callback(err, res) }, - endpoints.get_post_data, + endpoints.comty_endpoints.get_post_data, formdata ) }, @@ -68,7 +68,7 @@ export const comty_post = { (err, res) => { return callback(err, res) }, - endpoints.new_post, + endpoints.comty_endpoints.new_post, formdata, callOptions ) @@ -87,7 +87,7 @@ export const comty_post = { (err, res) => { return callback(err, res) }, - endpoints.action_post, + endpoints.comty_endpoints.action_post, formdata ) }, @@ -105,7 +105,7 @@ export const comty_post = { (err, res) => { return callback(err, res) }, - endpoints.action_post, + endpoints.comty_endpoints.action_post, formdata ) }, @@ -123,7 +123,7 @@ export const comty_post = { (err, res) => { return callback(err, res) }, - endpoints.action_post, + endpoints.comty_endpoints.action_post, formdata ) }, @@ -146,7 +146,7 @@ export const comty_post = { (err, res) => { return callback(err, res) }, - endpoints.get_posts, + endpoints.comty_endpoints.get_posts, formdata ) }, @@ -166,7 +166,7 @@ export const comty_post = { (err, res) => { return callback(err, res) }, - endpoints.action_post, + endpoints.comty_endpoints.action_post, formdata ) }, @@ -184,7 +184,7 @@ export const comty_post = { (err, res) => { return callback(err, res) }, - endpoints.action_post, + endpoints.comty_endpoints.action_post, formdata ) }, @@ -202,7 +202,7 @@ export const comty_post = { (err, res) => { return callback(err, res) }, - endpoints.action_post, + endpoints.comty_endpoints.action_post, formdata ) }, diff --git a/src/@ycore/libs/comty_ng/comty_post_comment.js b/src/@ycore/libs/comty_ng/comty_post_comment.js index fe08719b..3e21a5a9 100644 --- a/src/@ycore/libs/comty_ng/comty_post_comment.js +++ b/src/@ycore/libs/comty_ng/comty_post_comment.js @@ -15,7 +15,7 @@ export const comty_post_comment = { (err, res) => { return callback(err, res) }, - endpoints.comments_actions, + endpoints.comty_endpoints.comments_actions, formdata ) }, @@ -34,7 +34,7 @@ export const comty_post_comment = { (err, res) => { return callback(err, res) }, - endpoints.action_post, + endpoints.comty_endpoints.action_post, formdata ) }, diff --git a/src/@ycore/libs/comty_ng/comty_search.js b/src/@ycore/libs/comty_ng/comty_search.js index 5e1da2ca..fe9da074 100644 --- a/src/@ycore/libs/comty_ng/comty_search.js +++ b/src/@ycore/libs/comty_ng/comty_search.js @@ -15,7 +15,7 @@ export const comty_search = { (err, res) => { return callback(err, res) }, - endpoints.search_endpoint, + endpoints.comty_endpoints.search_endpoint, formdata, callOptions ) diff --git a/src/@ycore/libs/comty_ng/comty_user.js b/src/@ycore/libs/comty_ng/comty_user.js index 0e5b9344..fdc6a7f4 100644 --- a/src/@ycore/libs/comty_ng/comty_user.js +++ b/src/@ycore/libs/comty_ng/comty_user.js @@ -15,7 +15,7 @@ export const comty_user = { (err, res) => { return callback(err, res) }, - endpoints.follow_user, + endpoints.comty_endpoints.follow_user, formdata ) }, @@ -37,7 +37,7 @@ export const comty_user = { (err, res) => { return callback(err, res) }, - endpoints.find_user, + endpoints.comty_endpoints.find_user, formdata, callOptions ) @@ -55,7 +55,7 @@ export const comty_user = { (err, res) => { return callback(err, res) }, - endpoints.get_user_tags, + endpoints.comty_endpoints.get_user_tags, formdata ) }, diff --git a/src/@ycore/libs/rs_cloud/pre.js b/src/@ycore/libs/rs_cloud/pre.js index 3aca77ae..6a5686b7 100644 --- a/src/@ycore/libs/rs_cloud/pre.js +++ b/src/@ycore/libs/rs_cloud/pre.js @@ -42,7 +42,7 @@ export const __rscloud = { (err, res) => { return callback(err, res) }, - ycore.endpoints.auth_endpoint, + ycore.endpoints.comty_endpoints.auth_endpoint, formdata, callOptions ) @@ -53,7 +53,7 @@ export const __rscloud = { (err, res) => { return callback(err, res) }, - ycore.endpoints.removeToken, + ycore.endpoints.comty_endpoints.removeToken, null, callOptions ) @@ -80,7 +80,7 @@ export const __rscloud = { return callback(true, error) } }, - ycore.endpoints.get_userData_endpoint, + ycore.endpoints.comty_endpoints.get_userData_endpoint, formdata, optionCall, user_token diff --git a/src/@ycore/ycore_worker.js b/src/@ycore/ycore_worker.js index c415818c..ba080fc1 100755 --- a/src/@ycore/ycore_worker.js +++ b/src/@ycore/ycore_worker.js @@ -5,7 +5,7 @@ * @licensed Pending... */ -import { Endpoints } from 'globals/endpoints.js' +import * as Endpoints from 'globals/endpoints/index.js' import * as Icons from '@ant-design/icons' import localforage from 'localforage' import { format } from 'timeago.js' diff --git a/src/components/Layout/ChatSider.less b/src/components/Layout/ChatSider.less deleted file mode 100755 index 5a352758..00000000 --- a/src/components/Layout/ChatSider.less +++ /dev/null @@ -1,251 +0,0 @@ -@import '~themes/index.less'; - -@LDarkMode-backgroud: rgba(47, 46, 48, 0.74); -@LLightMode-backgroud: #fff; - -@LDarkMode-color: #fff; -@LLightMode-color: #2F2E30; - -.chatTitle { - font-family: "Poppins", sans-serif; - padding: 0 10px 0 0; - float: right; - display: flex; - - h1 { - line-height: 1.2; - margin-right: 5px; - } - - svg { - font-size: 20px; - } -} - - -.something_thats_pulling_me_down { - :global { - text-align: center; - bottom: 0; - position: absolute; - width: 100%; - } -} - -.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; -} - -.siderwrapper { - border-color: transparent; - font-size: 13px; - font-family: "Poppins", sans-serif; - height: 100%; - width: 100%; - left: 0; - position: absolute; - - :global { - .ant-layout-sider-dark { - background-color: @LDarkMode-backgroud; - color: @DarkMode-color; - - h2 { - color: @Theme-SiderDeco-Color; - } - - .ant-menu-item { - color: @DarkMode-color; - } - - .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-light { - background-color: @Theme-SiderDeco-Backgroud; - color: @Theme-SiderDeco-Color; - - h2 { - color: @Theme-SiderDeco-Color; - } - - .ant-menu-item { - color: @Theme-SiderDeco-Color; - } - - .ant-menu-inline, - .ant-menu-vertical, - .ant-menu-vertical-left { - :hover { - background-color: @Theme-Hover-Backgroud; - color: #fff; - } - - border-right: 1px solid transparent; - } - } - } -} - -.chatsider { - float: right; - background-color: transparent; - border: 1px @LDarkMode-color solid; - height: 100%; - z-index: 50; - - :global { - .ant-menu-dark { - background-color: @LDarkMode-backgroud; - color: @LDarkMode-color; - } - - .ant-menu-light { - background-color: @LLightMode-backgroud; - color: @LLightMode-color; - } - } - - .menuItems { - background-color: transparent; - margin-bottom: 8px; - width: 100%; - animation: fadein 0.5s; - - :global { - .ant-menu-item-selected { - background-color: transparent; - } - } - } - - .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); - } - } - } - - .chatContainer { - 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; - } -} - -.search { - position: relative; - bottom: 0; - width: 100%; - visibility: bottom; -} - - -.chatbox { - width: 100%; - background: transparent; - border-radius: 6px; - height: 100%; -} diff --git a/src/components/Layout/Secondary/index.less b/src/components/Layout/Secondary/index.less index 58245448..72159cef 100644 --- a/src/components/Layout/Secondary/index.less +++ b/src/components/Layout/Secondary/index.less @@ -25,9 +25,9 @@ >.container_bg { border-radius: @__Global_layout_border-rd; } - @media (min-width: 1000px) { - width: 95.4% - } + //@media (min-width: 1000px) { + // width: 95.4% + //} } &.half { diff --git a/src/components/PostCreator/index.js b/src/components/PostCreator/index.js index a031519c..f17f4697 100755 --- a/src/components/PostCreator/index.js +++ b/src/components/PostCreator/index.js @@ -151,9 +151,9 @@ class PostCreator extends React.PureComponent { } handlePublishPost = e => { - const { rawtext, shareWith, file } = this.state - if (!rawtext) { - return null + const { rawtext, shareWith, file, fileURL} = this.state + if (!rawtext && !fileURL) { + return false } this.setState({ posting: true,