File tree Expand file tree Collapse file tree 2 files changed +30
-3
lines changed
web-app/src/containers/Tutorial/components Expand file tree Collapse file tree 2 files changed +30
-3
lines changed Original file line number Diff line number Diff line change 11import * as React from 'react'
2- import { Dialog , Message } from '@alifd/next'
2+ import { Dialog } from '@alifd/next'
33import Button from '../../../components/Button'
4+ import ProgressPie from './ProgressPie'
45
56interface Props {
67 onContinue ( ) : void
@@ -31,9 +32,9 @@ const Continue = (props: Props) => {
3132 onOk = { onOk }
3233 onCancel = { onClose }
3334 onClose = { onClose }
34- footerActions = { [ 'ok' , 'cancel' ] }
35+ footerActions = { [ 'ok' ] }
3536 >
36- < Message > Level Complete </ Message >
37+ < ProgressPie / >
3738 </ Dialog >
3839 </ >
3940 )
Original file line number Diff line number Diff line change 1+ import * as React from 'react'
2+ import { Progress , Icon } from '@alifd/next'
3+
4+ const ProgressPie = ( ) => {
5+ const [ progress , setProgress ] = React . useState ( 0 )
6+
7+ React . useEffect ( ( ) => {
8+ if ( progress < 100 ) {
9+ const intervals = [ 10 , 20 ]
10+ const randomInteval = intervals [ Math . floor ( Math . random ( ) * intervals . length ) ]
11+ setTimeout ( ( ) => {
12+ setProgress ( progress + randomInteval )
13+ } , 200 )
14+ }
15+ } , [ progress ] )
16+
17+ return (
18+ < Progress
19+ percent = { progress }
20+ shape = "circle"
21+ textRender = { ( ) => ( progress === 100 ? < Icon type = "select" size = "xl" /> : null ) }
22+ />
23+ )
24+ }
25+
26+ export default ProgressPie
You can’t perform that action at this time.
0 commit comments