From 622715919e7b21006ef419f4748ecdd3b057062b Mon Sep 17 00:00:00 2001
From: qyzh
Date: Wed, 22 Jul 2020 17:33:05 +0800
Subject: [PATCH] before merge
---
forgeplus-react.sublime-workspace | 317 ++++++++++++++++++++++++++++++
src/App.js | 10 +
src/forge/sponsor/Sponsor.js | 32 +++
src/forge/users/Infos.js | 23 +++
4 files changed, 382 insertions(+)
create mode 100644 forgeplus-react.sublime-workspace
create mode 100644 src/forge/sponsor/Sponsor.js
diff --git a/forgeplus-react.sublime-workspace b/forgeplus-react.sublime-workspace
new file mode 100644
index 000000000..08ec48f4e
--- /dev/null
+++ b/forgeplus-react.sublime-workspace
@@ -0,0 +1,317 @@
+{
+ "auto_complete":
+ {
+ "selected_items":
+ [
+ [
+ "samp",
+ "samp2_method"
+ ],
+ [
+ "modu",
+ "module_method"
+ ],
+ [
+ "cu",
+ "currentTerm"
+ ],
+ [
+ "req",
+ "requestVote"
+ ],
+ [
+ "reque",
+ "RequestVote"
+ ],
+ [
+ "App",
+ "AppendEntries"
+ ],
+ [
+ "hea",
+ "heartBeatInterval"
+ ],
+ [
+ "time",
+ "timeOut"
+ ],
+ [
+ "ele",
+ "electionTimeout"
+ ],
+ [
+ "R",
+ "Raft"
+ ],
+ [
+ "vote",
+ "votedFor"
+ ],
+ [
+ "Ra",
+ "RaftState"
+ ],
+ [
+ "is",
+ "isleader"
+ ]
+ ]
+ },
+ "buffers":
+ [
+ {
+ "file": "src/redux/actions/actionTypes.js",
+ "settings":
+ {
+ "buffer_size": 5688,
+ "encoding": "UTF-8",
+ "line_ending": "Unix"
+ }
+ }
+ ],
+ "build_system": "",
+ "build_system_choices":
+ [
+ ],
+ "build_varint": "",
+ "command_palette":
+ {
+ "height": 0.0,
+ "last_filter": "",
+ "selected_items":
+ [
+ ],
+ "width": 0.0
+ },
+ "console":
+ {
+ "height": 171.0,
+ "history":
+ [
+ "ls"
+ ]
+ },
+ "distraction_free":
+ {
+ "menu_visible": true,
+ "show_minimap": false,
+ "show_open_files": false,
+ "show_tabs": false,
+ "side_bar_visible": false,
+ "status_bar_visible": false
+ },
+ "expanded_folders":
+ [
+ "/home/qyzh/new_trustie/forgeplus-react"
+ ],
+ "file_history":
+ [
+ "/home/qyzh/OSS/forgeplus/app/models/user.rb",
+ "/home/qyzh/OSS/forgeplus/db/structure.sql",
+ "/home/qyzh/OSS/forgeplus/app/controllers/settings_controller.rb",
+ "/home/qyzh/OSS/forgeplus/app/controllers/application_controller.rb",
+ "/home/qyzh/OSS/Trustie/app/controllers/projects_controller.rb",
+ "/home/qyzh/temp.sh",
+ "/home/qyzh/OSS/Trustie/Gemfile",
+ "/home/qyzh/.npm/_logs/2020-06-07T02_42_06_886Z-debug.log",
+ "/home/qyzh/OSS/forgeplus/app/controllers/users_controller.rb",
+ "/home/qyzh/OSS/forgeplus/app/controllers/accounts_controller.rb",
+ "/home/qyzh/custom/conf/app.ini",
+ "/home/qyzh/OSS/Trustie_old/Gemfile.lock",
+ "/home/qyzh/OSS/Trustie/Gemfile.lock",
+ "/home/qyzh/ruby_study/test.rb",
+ "/home/qyzh/RubymineProjects/myblog/app/controller/users_controller.rb",
+ "/home/qyzh/OSS/forgeplus/app/libs/limit_forbid_control.rb",
+ "/home/qyzh/OSS/forgeplus/log/development.log",
+ "/home/qyzh/NJU-DisSys-2017/src/raft/raft.go",
+ "/home/qyzh/OSS/forgeplus/config/application.rb",
+ "/home/qyzh/RubymineProjects/demo/app/helpers/welcome_helper.rb",
+ "/home/qyzh/RubymineProjects/demo/app/controllers/welcome_controller.rb",
+ "/home/qyzh/RubymineProjects/demo/config/routes.rb",
+ "/home/qyzh/RubymineProjects/demo/app/views/welcome/index.html.erb",
+ "/home/qyzh/trustie/Gemfile",
+ "/home/qyzh/trustie/Gemfile.lock",
+ "/home/qyzh/ruby_study/test",
+ "/home/qyzh/NJU-DisSys-2017/src/labrpc/test_test.go",
+ "/home/qyzh/NJU-DisSys-2017/src/labrpc/labrpc.go",
+ "/home/qyzh/NJU-DisSys-2017/src/raft/test_test.go",
+ "/home/qyzh/NJU-DisSys-2017/src/raft/persister.go",
+ "/home/qyzh/NJU-DisSys-2017/src/raft/util.go",
+ "/home/qyzh/NJU-DisSys-2017/src/raft/config.go"
+ ],
+ "find":
+ {
+ "height": 29.0
+ },
+ "find_in_files":
+ {
+ "height": 0.0,
+ "where_history":
+ [
+ ]
+ },
+ "find_state":
+ {
+ "case_sensitive": true,
+ "find_history":
+ [
+ "current_user",
+ "user_set",
+ "login",
+ "platform",
+ "Platform不包含于列表中",
+ "find_by_",
+ "find_by",
+ "3.2.22",
+ "bug",
+ "persister",
+ "currentTerm",
+ "currentTern",
+ "term",
+ "your",
+ "electionInterval",
+ "your",
+ "if",
+ "your",
+ "Persister",
+ "make",
+ "Your code here",
+ "Call",
+ "labrpc",
+ "main"
+ ],
+ "highlight": true,
+ "in_selection": false,
+ "preserve_case": false,
+ "regex": false,
+ "replace_history":
+ [
+ ],
+ "reverse": false,
+ "show_context": true,
+ "use_buffer2": true,
+ "whole_word": false,
+ "wrap": true
+ },
+ "groups":
+ [
+ {
+ "selected": 0,
+ "sheets":
+ [
+ {
+ "buffer": 0,
+ "file": "src/redux/actions/actionTypes.js",
+ "semi_transient": false,
+ "settings":
+ {
+ "buffer_size": 5688,
+ "regions":
+ {
+ },
+ "selection":
+ [
+ [
+ 0,
+ 0
+ ]
+ ],
+ "settings":
+ {
+ "syntax": "Packages/JavaScript/JavaScript.sublime-syntax",
+ "tab_size": 2,
+ "translate_tabs_to_spaces": true
+ },
+ "translation.x": 0.0,
+ "translation.y": 0.0,
+ "zoom_level": 1.0
+ },
+ "stack_index": 0,
+ "type": "text"
+ }
+ ]
+ }
+ ],
+ "incremental_find":
+ {
+ "height": 29.0
+ },
+ "input":
+ {
+ "height": 0.0
+ },
+ "layout":
+ {
+ "cells":
+ [
+ [
+ 0,
+ 0,
+ 1,
+ 1
+ ]
+ ],
+ "cols":
+ [
+ 0.0,
+ 1.0
+ ],
+ "rows":
+ [
+ 0.0,
+ 1.0
+ ]
+ },
+ "menu_visible": true,
+ "output.find_results":
+ {
+ "height": 0.0
+ },
+ "pinned_build_system": "",
+ "project": "forgeplus-react.sublime-project",
+ "replace":
+ {
+ "height": 54.0
+ },
+ "save_all_on_build": true,
+ "select_file":
+ {
+ "height": 0.0,
+ "last_filter": "",
+ "selected_items":
+ [
+ ],
+ "width": 0.0
+ },
+ "select_project":
+ {
+ "height": 0.0,
+ "last_filter": "",
+ "selected_items":
+ [
+ ],
+ "width": 0.0
+ },
+ "select_symbol":
+ {
+ "height": 0.0,
+ "last_filter": "",
+ "selected_items":
+ [
+ ],
+ "width": 0.0
+ },
+ "selected_group": 0,
+ "settings":
+ {
+ },
+ "show_minimap": true,
+ "show_open_files": false,
+ "show_tabs": true,
+ "side_bar_visible": true,
+ "side_bar_width": 288.0,
+ "status_bar_visible": true,
+ "template_settings":
+ {
+ }
+}
diff --git a/src/App.js b/src/App.js
index ac18a443a..4a586cacf 100644
--- a/src/App.js
+++ b/src/App.js
@@ -81,6 +81,11 @@ const OrganizeIndex = Loadable({
loader: () => import('./forge/Team/Index'),
loading: Loading,
})
+// Sponsor
+const Sponsor = Loadable({
+ loader: () => import('./forge/sponsor/Sponsor'),
+ loading: Loading,
+})
class App extends Component {
constructor(props) {
@@ -270,6 +275,11 @@ class App extends Component {
return ()
}
}>
+ ()
+ }>
+
()
diff --git a/src/forge/sponsor/Sponsor.js b/src/forge/sponsor/Sponsor.js
new file mode 100644
index 000000000..35417180e
--- /dev/null
+++ b/src/forge/sponsor/Sponsor.js
@@ -0,0 +1,32 @@
+import React, { Component } from "react";
+
+import { Route, Switch } from "react-router-dom";
+import { withRouter } from "react-router";
+
+import { SnackbarHOC } from "educoder";
+import { CNotificationHOC } from "../../modules/courses/common/CNotificationHOC";
+import { TPMIndexHOC } from "../../modules/tpm/TPMIndexHOC";
+
+
+import Loadable from "react-loadable";
+import Loading from "../../Loading";
+import { ImageLayerOfCommentHOC } from "../../modules/page/layers/ImageLayerOfCommentHOC";
+
+class Sponsor extends Component {
+
+ render(){
+ return (
+ This is sponsor page
+ );
+
+ }
+
+}
+
+export default withRouter(
+ ImageLayerOfCommentHOC({
+ imgSelector: ".imageLayerParent img, .imageLayerParent .imageTarget",
+ parentSelector: ".newMain",
+ })(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Sponsor))))
+ );
+
\ No newline at end of file
diff --git a/src/forge/users/Infos.js b/src/forge/users/Infos.js
index 37172aa40..5a1bd8832 100644
--- a/src/forge/users/Infos.js
+++ b/src/forge/users/Infos.js
@@ -113,6 +113,14 @@ class Infos extends Component {
this.props.history.push(`/users/${user && user.login}/organizes`)
}
+ sponsor_link = () => {
+ const {user} = this.state
+ this.setState({
+ route_type: undefined
+ })
+ this.props.history.push(`/sponsor/${user && user.login}`)
+ }
+
render() {
const { current_user, mygetHelmetapi } = this.props;
@@ -240,6 +248,21 @@ class Infos extends Component {
+ {current_user && user && current_user.id === user.id && (
+
+
+
this.sponsor_link()} >
+
+ {/* */}
+ Sponsor
+
+ {/*
+ {user && user.undo_events}
+ */}
+
+
+
+ )}
{user && (