From 37f608cdb84d2df5b434760f4465fa5b172bd1fe Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 13 Aug 2021 17:12:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=BA=93-=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Branch/CloneAddress.js | 2 +- src/forge/Branch/branch.scss | 3 +- src/forge/Component/Component.scss | 82 +++++++++++++--- src/forge/Component/Contributors.jsx | 29 +++--- src/forge/Component/LanguagePower.jsx | 2 +- src/forge/Component/Releases.jsx | 3 +- src/forge/Main/CoderDepot.jsx | 18 ++-- src/forge/Main/CoderDepotCatalogue.jsx | 2 +- src/forge/Main/CoderDepotReadme.jsx | 44 +++++---- src/forge/Main/Detail.js | 12 +++ src/forge/Main/Index.scss | 79 +++++++++++---- src/forge/Main/list.scss | 128 +++++++++++++------------ src/forge/Main/sub/DetailBanner.jsx | 2 +- src/forge/Main/sub/ReadmeCatelogue.jsx | 10 +- src/forge/Main/sub/sub.scss | 5 +- src/forge/css/index.scss | 2 +- 16 files changed, 268 insertions(+), 155 deletions(-) diff --git a/src/forge/Branch/CloneAddress.js b/src/forge/Branch/CloneAddress.js index e936bb705..c2e6dd746 100644 --- a/src/forge/Branch/CloneAddress.js +++ b/src/forge/Branch/CloneAddress.js @@ -7,7 +7,7 @@ function CloneAddress({http_url , ssh_url , zip_url , tar_url}) { const [ key , setKey ] = useState("HTTP"); return (
-
+
{setKey(e.key)}}>HTTP {setKey(e.key)}}>SSH diff --git a/src/forge/Branch/branch.scss b/src/forge/Branch/branch.scss index dd9c7b14e..74f52e545 100644 --- a/src/forge/Branch/branch.scss +++ b/src/forge/Branch/branch.scss @@ -48,7 +48,7 @@ .branch-tagBox{ border:1px solid #D0D0D0; border-radius: 3px; - height: 40px; + height: 36px; display: flex; align-items: center; cursor: pointer; @@ -98,6 +98,7 @@ .urlMenu{ line-height: 30px; margin-bottom: 10px; + padding:15px 20px 0px 20px; border-bottom: none; li.ant-menu-item{ height: 30px; diff --git a/src/forge/Component/Component.scss b/src/forge/Component/Component.scss index 3a94c3751..627304e15 100644 --- a/src/forge/Component/Component.scss +++ b/src/forge/Component/Component.scss @@ -113,7 +113,14 @@ li.ant-menu-item{ z-index: 10000; } .laterest{ - color: #05690d; + background-color: #EF3131; + color: #fff; + font-size: 12px; + margin-left: 10px; + padding:0px 5px; + border-radius: 2px; + height: 18px; + line-height: 18px; } @media screen and (max-width: 1800px){ @@ -157,39 +164,88 @@ li.ant-menu-item{ } .menuPanels{ - width: 240px; - height: 180px; + width: 295px; + .leftline{ + position: relative; + color: #666; + height: 16px; + &::before{ + position: absolute; + left: -10px; + top:3px; + height: 12px; + width: 1px; + background-color: #666666; + content: ""; + } + } + .ant-btn{ + height: 36px; + line-height: 34px; + width: 83px; + text-align: center; + padding:0px ; + font-weight: 500; + font-size: 14px; + &.currentBtn{ + cursor: default; + color: #333; + &:hover{ + color: #333; + border-color: #d0d0d0; + } + } + } + .ant-btn-default{ + color: #333; + border-color: #d0d0d0; + &:hover{ + background: #F3F4F6; + } + } + .ant-btn-primary{ + color: #fff; + background-color: #2A61FF; + } + .focusPanelHeadInfo{ + padding:14px 16px; + border-bottom: 1px solid #eee; + } .ant-popover-content,.ant-popover-inner{ height: 100%; width: 100%; } + .ant-popover-inner-content{ + padding:0px; + } } .halfs{ margin-top: 24px; padding:24px 0px 0px 0px; border-top: 1px solid #e8e8e8; - .attrPerson{ - padding-bottom: 24px; - } +} +.aboutSubTitle{ + display: flex; + align-items: center; } .menuinfos{ - padding:15px 0px; + padding:10px 20px; &>a{ display: flex; flex-direction: column; align-items: center; - border-right: 1px solid #eee; flex: 1; & >span:first-child{ - font-size: 18px; - font-weight: 400; + font-size: 16px; + font-weight: 500; color: #333; + line-height: 22px; } & >span:last-child{ color: #666; - } - &:last-child{ - border-right: none; + font-weight: 400; + line-height: 20px; + margin-top: 6px; } } } diff --git a/src/forge/Component/Contributors.jsx b/src/forge/Component/Contributors.jsx index 2f67b3ab5..f878f672d 100644 --- a/src/forge/Component/Contributors.jsx +++ b/src/forge/Component/Contributors.jsx @@ -1,13 +1,13 @@ import React, { useEffect, useState } from 'react'; import { AlignCenter , FlexAJ } from '../Component/layout'; import { Link } from 'react-router-dom'; -import { Popover , Spin } from 'antd'; +import { Popover , Spin , Button } from 'antd'; import { getImageUrl } from 'educoder'; import './Component.scss'; import { getUser } from '../GetData/getData'; import axios from 'axios'; -function Contributors({contributors,owner,projectsId}){ +function Contributors({contributors,owner,projectsId,currentLogin}){ const [ menuList ,setMenuList ]= useState([]); const [ list , setList ]= useState(undefined); const [ total , setTotal ]= useState(0); @@ -73,19 +73,18 @@ function Contributors({contributors,owner,projectsId}){ 关注数 - { - data.organizations && data.organizations.length > 0 ? - - 所属组织: -
- {renderArray(data.organizations)} -
-
- :"" - } - { - data.location && 所在地址:{data.location} - } +
+ { + currentLogin && (currentLogin === data.login) + ? + + : + data.is_watch ? + + : + + } +
) setMenu(ele); diff --git a/src/forge/Component/LanguagePower.jsx b/src/forge/Component/LanguagePower.jsx index 3197309c4..8d3e361b5 100644 --- a/src/forge/Component/LanguagePower.jsx +++ b/src/forge/Component/LanguagePower.jsx @@ -25,7 +25,7 @@ function LanguagePower({languages}){ } return(
-

开发语言

+

开发语言

{ array && array.map((item,key)=>{ diff --git a/src/forge/Component/Releases.jsx b/src/forge/Component/Releases.jsx index ae7948067..4a689f5ff 100644 --- a/src/forge/Component/Releases.jsx +++ b/src/forge/Component/Releases.jsx @@ -19,13 +19,12 @@ function Releases({owner,projectsId,releaseVersions , baseOperate , projectType} releaseVersions.list.map((item,key)=>{ return( key === 0 && -

{item.name} 最新

-

{item.created_at}

+

{item.created_at}

) diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index ba215553c..787236019 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -321,7 +321,7 @@ function CoderDepot(props){ list = {mainFlag ? dirInfo : undefined} />
setVisible(true)}> - + 目录
@@ -334,7 +334,7 @@ function CoderDepot(props){
-
+
{ props && props.platform ? - + { baseOperate && ((projectDetail.type !== 2 && pullsFlag) || issuesFlag )&&
@@ -379,12 +379,12 @@ function CoderDepot(props){ } { fileOperate && - + } - + @@ -464,7 +464,7 @@ function CoderDepot(props){ setOpenModal(true)} className="iconfont icon-anquanshezhi color-grey-9 font-15"> } - {desc &&

{desc}

} + {desc &&

{desc}

} { website &&
@@ -473,7 +473,7 @@ function CoderDepot(props){
}
- + README.md
@@ -483,7 +483,7 @@ function CoderDepot(props){ { projectDetail && projectDetail.license_name &&
- + {projectDetail.license_name}
} @@ -499,7 +499,7 @@ function CoderDepot(props){ lesson_url &&
-

实践课程

+

实践课程

{lesson_url}
} diff --git a/src/forge/Main/CoderDepotCatalogue.jsx b/src/forge/Main/CoderDepotCatalogue.jsx index ad2847693..ff2b576b8 100644 --- a/src/forge/Main/CoderDepotCatalogue.jsx +++ b/src/forge/Main/CoderDepotCatalogue.jsx @@ -13,7 +13,7 @@ function CoderDepotCatalogue({item , goToSubRoot , owner , projectsId }){
  • goToSubRoot(item.path,item.type,item.name)} className={item.type === "submodule" && "submoduleStyle"}> - {item.name} + {item.name} diff --git a/src/forge/Main/CoderDepotReadme.jsx b/src/forge/Main/CoderDepotReadme.jsx index 59a687ddc..e5f6cbc4e 100644 --- a/src/forge/Main/CoderDepotReadme.jsx +++ b/src/forge/Main/CoderDepotReadme.jsx @@ -1,8 +1,7 @@ import React, { useEffect, useState } from 'react'; import RenderHtml from '../../components/render-html'; import { AlignCenter } from '../Component/layout'; -import { Dropdown , Menu , Spin } from 'antd'; -import { Link } from 'react-router-dom'; +import { Dropdown , Anchor , Spin } from 'antd'; import ReadmeCatelogue from './sub/ReadmeCatelogue'; const $ = window.$; @@ -33,32 +32,35 @@ function CoderDepotReadme({ operate , history , readme , ChangeFile }){ function menu(){ if(menuList && menuList.length > 0){ return( - + ) }else{ return } } + return(
    -
    - - - - - 目录 - - - README.md - - { - operate ? - ChangeFile(readme && readme.path, false)}> - - - :"" - } -
    + +
    + + + + + 目录 + + + README.md + + { + operate ? + ChangeFile(readme && readme.path, false)}> + + + :"" + } +
    +
    { content &&
    diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index 0ddc57067..bc104ff66 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -557,6 +557,18 @@ class Detail extends Component { }
    +
    + { + projectDetail && projectDetail.forked_from_project_id && projectDetail.fork_info ? + this.textFunc(projectDetail.forked_from_project_id,projectDetail.fork_info) + :"" + } + { + projectDetail && projectDetail.type && projectDetail.type !== 0 ? + 镜像自 {projectDetail.mirror_url} + :"" + } +
    { firstSync ? "" : img{ - margin-right: 8px; -} -.headerMenu-wrapper li a > span.num{ - line-height: 24px; - margin-left: 5px; - margin-top: 2px; - font-size: 12px; - float: right; - color: #666!important; - background-color: rgba(153, 153, 153, 0.13);; - border-radius: 50%; - width: 24px; - height: 24px; -} -.headerMenu-wrapper li.active a,.headerMenu-wrapper li.active a i{ - color: #2A61FF!important; -} -.headerMenu-wrapper li.active::after{ - position: absolute; - bottom:0px; - height:2px; - background-color: #2A61FF; - content:''; - left: 0px; - width:100%; + cursor: pointer; + li{ + font-size: 14px; + position: relative; + text-align: center; + height: 40px; + line-height: 28px; + padding:0px 20px; + & > a{ + color: #666; + &> img{ + margin-right: 8px; + } + &> span.num{ + line-height: 24px; + margin-left: 5px; + margin-top: 2px; + font-size: 12px; + float: right; + color: #666!important; + background-color: rgba(153, 153, 153, 0.13);; + border-radius: 50%; + width: 24px; + height: 24px; + } + } + &.active a,&.active a i{ + color: #2A61FF!important; + } + &.active::after,&:hover::after{ + position: absolute; + bottom:0px; + height:2px; + background-color: #2A61FF; + content:''; + left: 0px; + width:100%; + } + &:hover::after{ + background-color: rgba(153, 153, 153, 0.2);; + } + } } .detail_tag_btn{ height:34px; @@ -271,32 +274,36 @@ border:1px solid #D0D0D0; display: flex; align-items: center; - margin-left: 30px; + margin-left: 10px; padding:0px; background-color:#FAFBFC; box-shadow: none; -} -.detail_tag_btn:hover{ - background-color: #F3F4F6; + &:hover{ + background-color: #F3F4F6; + } + .detail_tag_btn_name{ + padding:0px 18px; + min-width: 82px; + text-align: center; + &:hover>span{ + color: #333!important; + } + img{ + margin-right: 10px; + } + } + .detail_tag_btn_count{ + width: 42px; + text-align: center; + background: #fff; + border-radius: 0px 4px 4px 0px; + height:100%; + border-left: 1px solid #D0D0D0; + } } .ant-tooltip { max-width: fit-content!important; } -.detail_tag_btn_name{ - padding:0px 10px; - color: #666!important; -} -.detail_tag_btn_name img{ - margin-right: 10px; -} -.detail_tag_btn_count{ - width: 42px; - text-align: center; - background: #fff; - border-radius: 0px 4px 4px 0px; - height:100%; - border-left: 1px solid #D0D0D0; -} .files-md{ padding:20px; } @@ -347,6 +354,7 @@ .gitAddressClone{ + margin:0px 20px 14px 20px!important; display: flex; height: 40px; align-items: center; @@ -658,9 +666,7 @@ .item:last-child{ border-bottom:none; } -.gitAddressClone{ - margin: 0 !important; -} + .item_title small{ font-weight: 400; margin-left: 10px; diff --git a/src/forge/Main/sub/DetailBanner.jsx b/src/forge/Main/sub/DetailBanner.jsx index cdfd253d7..1dfec5328 100644 --- a/src/forge/Main/sub/DetailBanner.jsx +++ b/src/forge/Main/sub/DetailBanner.jsx @@ -18,7 +18,7 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa } },[list]); return( -
    +
    { menuName && projectDetail ?
      diff --git a/src/forge/Main/sub/ReadmeCatelogue.jsx b/src/forge/Main/sub/ReadmeCatelogue.jsx index 64eb90bab..d1e018bb6 100644 --- a/src/forge/Main/sub/ReadmeCatelogue.jsx +++ b/src/forge/Main/sub/ReadmeCatelogue.jsx @@ -1,11 +1,11 @@ -import React , {useState } from 'react'; +import React , { useState , useEffect } from 'react'; import { Anchor , Input } from 'antd'; import './sub.scss'; +import { Base64 } from 'js-base64'; const { Link } = Anchor; -const { Search } = Input; -function ReadmeCatelogue({ menuList }) { +function ReadmeCatelogue({ menuList , hash }) { const [ goHref , setGoHref ] = useState(""); const [ value , setValue ] = useState(""); const [ menu , setMenu] = useState(menuList); @@ -18,7 +18,7 @@ function ReadmeCatelogue({ menuList }) { function changeValue(e) { setValue(e.target.value); if(e.target.value){ - let m = menu.filter(i=>i.text.indexOf(e.target.value)>-1); + let m = menuList.filter(i=>i.text.indexOf(e.target.value)>-1); setMenu(m); }else{ setMenu(menuList); @@ -41,7 +41,7 @@ function ReadmeCatelogue({ menuList }) { menu.map((item,key)=>{ return(
      - +
      ) }) diff --git a/src/forge/Main/sub/sub.scss b/src/forge/Main/sub/sub.scss index d4db6208c..4e6a3d8ac 100644 --- a/src/forge/Main/sub/sub.scss +++ b/src/forge/Main/sub/sub.scss @@ -34,13 +34,10 @@ padding:15px; border-bottom: 1px solid #eee; } - .anchorBox{ - max-height: 255px; - overflow-y: auto; - } .ant-anchor-wrapper{ margin-left: 0px; padding:5px 15px; + max-height: 255px!important; .items{ border-radius: 4px; margin-bottom: 5px; diff --git a/src/forge/css/index.scss b/src/forge/css/index.scss index 0264c73ce..e1986728e 100644 --- a/src/forge/css/index.scss +++ b/src/forge/css/index.scss @@ -11,7 +11,7 @@ ul,ol,dl{ font-size: 22px; font-weight: normal; line-height: 30px; - max-width: 700px; + max-width: 690px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;