All files / src/progress/_example ProgressCircleExample.jsx

75% Statements 6/8
100% Branches 0/0
60% Functions 3/5
83.33% Lines 5/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36        1x   1x 1x       1x     1x                                          
import React, { useState, useEffect } from "react";
import { Progress } from "@tencent/tea-component/lib/progress";
 
export default function ProgressCircleExample() {
  const [percent, setPercent] = useState(0);
 
  useEffect(() => {
    const timer = setInterval(
      () => setPercent(percent => (percent % 100) + 10),
      1000
    );
    return () => clearInterval(timer);
  }, []);
 
  return (
    <>
      <Progress type="circle" percent={percent} tips="正在上传应用,请稍等" />
      <hr />
      <Progress
        type="circle"
        theme="default"
        percent={percent}
        text="加固中"
        tips={
          <>
            <p>大约需要5分钟,您可以先去进行其他操作,稍后再来看看。</p>
            <p>
              推荐您使用<a href="#">乐固自助加固</a>工具,可自动加固、签名。
            </p>
          </>
        }
      />
    </>
  );
}