You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
610 B
20 lines
610 B
import React, { useState, useEffect } from "react"; |
|
|
|
function Progress({ percent, deskTop }) { |
|
const [delayPercent, setDelayPercent] = useState(0); |
|
useEffect(() => { |
|
setTimeout(() => { |
|
setDelayPercent(() => percent); |
|
}, 1000); |
|
}, [percent]); |
|
return ( |
|
<div className={`flex-1 ${deskTop ? 'h-3' : 'h-1.5'} rounded-full overflow-hidden my-3`} style={{ backgroundColor: '#D3E9FF' }}> |
|
<div |
|
className="h-full bg-blueEB float-left transition-all duration-500 rounded-full" |
|
style={{ width: delayPercent + "%" }} |
|
></div> |
|
</div> |
|
); |
|
} |
|
|
|
export default Progress;
|
|
|