From 6570985b68fab5a2071013bf1e79879ba7c53ee8 Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Thu, 18 Jun 2020 16:05:22 +0800
Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/forge/Index.js | 1 -
src/forge/Main/Detail.js | 2 +-
src/forge/Main/IndexItem.js | 2 +-
src/forge/users/Index.scss | 26 ++++++++++++++++++++++++++
src/forge/users/InfosUser.js | 35 +++++++++++++++++++++++++----------
5 files changed, 53 insertions(+), 13 deletions(-)
diff --git a/src/forge/Index.js b/src/forge/Index.js
index 376da109..395c990b 100644
--- a/src/forge/Index.js
+++ b/src/forge/Index.js
@@ -35,7 +35,6 @@ const Infos = Loadable({
class Index extends Component {
render() {
- console.log("1",this.props);
return (
diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js
index 15158a8c..bb7727f6 100644
--- a/src/forge/Main/Detail.js
+++ b/src/forge/Main/Detail.js
@@ -416,7 +416,7 @@ class Detail extends Component {
-1 ? "active" : ""}>
合并请求
- { projectDetail && projectDetail.pull_requests_count ? {projectDetail.issues_count} : "" }
+ { projectDetail && projectDetail.pull_requests_count ? {projectDetail.pull_requests_count} : "" }
-1 || url.indexOf("meilpost") > -1) ? "active" : ""}>
diff --git a/src/forge/Main/IndexItem.js b/src/forge/Main/IndexItem.js
index e803d54c..c9dd41ad 100644
--- a/src/forge/Main/IndexItem.js
+++ b/src/forge/Main/IndexItem.js
@@ -53,7 +53,7 @@ class IndexItem extends Component {
fork ({item.forked_count})
- {item.description}
+ {item.description}
diff --git a/src/forge/users/Index.scss b/src/forge/users/Index.scss
index 40652d8e..5fdc0b1f 100644
--- a/src/forge/users/Index.scss
+++ b/src/forge/users/Index.scss
@@ -41,4 +41,30 @@ $flex:flex;
color: #888;
margin-top: 3px;
}
+}
+.infosType{
+ padding:20px 30px 0px 30px;
+ display: flex;
+ justify-content: space-between;
+ .infoStatus{
+ height:30px;
+ background:rgba(255,255,255,1);
+ border-radius:15px;
+ border:1px solid rgba(221,221,221,1);
+ line-height: 30px;
+ font-size: 12px;
+ color: #888;
+ display: flex;
+ & > span{
+ display: block;
+ padding:0px 12px;
+ border-radius:15px;
+ cursor: pointer;
+ }
+ & > span.active{
+ background-color:#5091FF ;
+ color: #fff;
+ padding:0px 15px;
+ }
+ }
}
\ No newline at end of file
diff --git a/src/forge/users/InfosUser.js b/src/forge/users/InfosUser.js
index 4180402a..4edf9053 100644
--- a/src/forge/users/InfosUser.js
+++ b/src/forge/users/InfosUser.js
@@ -1,5 +1,4 @@
import React, { Component } from "react";
-// import { SnackbarHOC } from 'educoder';
import { Link } from "react-router-dom";
import { Menu, Input, Spin, Pagination, Popover, Button } from "antd";
@@ -21,6 +20,7 @@ class InfosUser extends Component {
projectsList: undefined,
total: undefined,
category: undefined,
+ is_public:"public"
};
}
@@ -29,12 +29,12 @@ class InfosUser extends Component {
};
componentDidUpdate = (prevProps) => {
- if (prevProps.project_type != this.props.project_type) {
+ if (prevProps.project_type !== this.props.project_type) {
this.get_projects();
}
};
- get_projects = () => {
+ get_projects = (is_public) => {
const { user, project_type } = this.props;
const url = `/users/${user && user.login}/projects.json`;
const { page, limit, search, sort_by, category } = this.state;
@@ -50,6 +50,7 @@ class InfosUser extends Component {
sort_by,
category,
project_type,
+ is_public:is_public!==undefined ? is_public : "public"
},
})
.then((result) => {
@@ -91,9 +92,17 @@ class InfosUser extends Component {
});
};
+ // 切换公有私有
+ changeStatus=(is_public)=>{
+ this.setState({
+ is_public
+ })
+ this.get_projects(is_public);
+ }
+
render() {
const { current_user, user } = this.props;
- const { category } = this.state;
+ const { category , is_public } = this.state;
const menu = (
- {category_button}
+
+
{category_button}
+
+ this.changeStatus("public")}>公有
+ this.changeStatus("private")}>私有
+
+
{projectsList && projectsList.length > 0 ? (