Merge pull request '提交详情页体验优化' (#128) from durian/forgeplus-react:pre_develop_dev into pre_develop_dev

This commit is contained in:
jasder 2021-10-11 11:36:37 +08:00
commit 1684e5c04f
1 changed files with 7 additions and 3 deletions

View File

@ -1,7 +1,7 @@
import React ,{useEffect,useRef,useState } from 'react'; import React ,{useEffect,useState } from 'react';
import { truncateCommitId } from '../common/util'; import { truncateCommitId } from '../common/util';
import { AlignCenter , FlexAJ } from '../Component/layout'; import { AlignCenter , FlexAJ } from '../Component/layout';
import { Button, Tooltip,Progress, Popover, Anchor } from 'antd'; import { Tooltip,Progress } from 'antd';
import './merge.css'; import './merge.css';
import './Index.scss'; import './Index.scss';
@ -16,6 +16,10 @@ function Files({ data,history,owner,projectsId , parentsSha }){
} }
},[data]); },[data]);
useEffect(()=>{
document.addEventListener('click',()=>{setIsOpen(false)})
})
function showDown(flag,index,isBin){ function showDown(flag,index,isBin){
if(!isBin){ if(!isBin){
var lists = files.concat(); var lists = files.concat();
@ -63,7 +67,7 @@ function Files({ data,history,owner,projectsId , parentsSha }){
) )
return( return(
<div> <div onClick={(e)=>{e.nativeEvent.stopImmediatePropagation()}}>
<AlignCenter className="color-grey-9" style={{position:'relative'}}> <AlignCenter className="color-grey-9" style={{position:'relative'}}>
<div onClick={()=>{setIsOpen(!isOpen)}}> <div onClick={()=>{setIsOpen(!isOpen)}}>
<i className={`iconfont mr5 ${isOpen? "font-18 icon-sanjiaoxing-down":"font-16 icon-triangle"}`}></i> <i className={`iconfont mr5 ${isOpen? "font-18 icon-sanjiaoxing-down":"font-16 icon-triangle"}`}></i>