forked from Gitlink/forgeplus-react
branch spin
This commit is contained in:
parent
cebc85436e
commit
3401ace6f9
|
|
@ -1,6 +1,6 @@
|
|||
import React , { useState, useEffect } from 'react';
|
||||
import { Link } from "react-router-dom";
|
||||
import { Dropdown , Menu , Icon , Tooltip } from 'antd';
|
||||
import { Dropdown , Menu , Icon , Tooltip , Spin } from 'antd';
|
||||
import { truncateCommitId } from '../common/util';
|
||||
import { getBranch } from '../GetData/getData';
|
||||
|
||||
|
|
@ -8,6 +8,8 @@ import './list.css';
|
|||
|
||||
export default ((props)=>{
|
||||
const [ data , setData ] =useState(undefined);
|
||||
const [ isSpin , setIsSpin ] =useState(true);
|
||||
|
||||
const { projectsId } = props.match.params;
|
||||
|
||||
useEffect(()=>{
|
||||
|
|
@ -17,6 +19,7 @@ export default ((props)=>{
|
|||
async function getBranchs(id){
|
||||
let result = await getBranch(id);
|
||||
setData(result);
|
||||
setIsSpin(false);
|
||||
}
|
||||
|
||||
const list =()=>{
|
||||
|
|
@ -62,10 +65,12 @@ export default ((props)=>{
|
|||
return(
|
||||
<React.Fragment>
|
||||
<div className="main">
|
||||
<div className="branchTable">
|
||||
<p className="branchTitle bor-bottom-greyE">分支列表</p>
|
||||
{list()}
|
||||
</div>
|
||||
<Spin spinning={isSpin}>
|
||||
<div className="branchTable">
|
||||
<p className="branchTitle bor-bottom-greyE">分支列表</p>
|
||||
{list()}
|
||||
</div>
|
||||
</Spin>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue