@@ -2,32 +2,40 @@ import * as React from 'react'
22import * as T from 'typings'
33import { css , jsx } from '@emotion/core'
44import Loading from '../../components/Loading'
5- import Message from '../../ components/Message '
5+ import ProcessMessages from 'components/ProcessMessages '
66
77interface Props {
88 text : string
9- context ?: T . MachineContext
9+ processes ?: T . ProcessEvent [ ]
1010}
1111
1212const styles = {
1313 page : {
1414 position : 'relative' as 'relative' ,
15- display : 'flex' ,
16- alignItems : 'center' ,
17- justifyContent : 'center' ,
15+ display : 'flex' as 'flex' ,
16+ flexDirection : 'column' as 'column' ,
17+ alignItems : 'center' as 'center' ,
18+ justifyContent : 'center' as 'center' ,
1819 height : '100%' ,
1920 width : '100%' ,
2021 } ,
22+ processes : {
23+ padding : '0 1rem' ,
24+ position : 'fixed' as 'fixed' ,
25+ bottom : 0 ,
26+ left : 0 ,
27+ right : 0 ,
28+ } ,
2129}
2230
23- const LoadingPage = ( { text } : Props ) => {
24- const [ showLoading , setShowHiding ] = React . useState ( false )
31+ const LoadingPage = ( { text, processes } : Props ) => {
32+ const [ showLoading , setShowHiding ] = React . useState < boolean > ( ! ! processes ?. length )
2533
2634 React . useEffect ( ( ) => {
2735 // wait some time before showing loading indicator
2836 const timeout = setTimeout ( ( ) => {
2937 setShowHiding ( true )
30- } , 600 )
38+ } , 500 )
3139 return ( ) => {
3240 clearTimeout ( timeout )
3341 }
@@ -37,10 +45,14 @@ const LoadingPage = ({ text }: Props) => {
3745 if ( ! showLoading ) {
3846 return null
3947 }
40-
4148 return (
4249 < div css = { styles . page } >
43- < Loading text = { text } />
50+ < Loading message = { text } />
51+ { processes && processes . length ? (
52+ < div css = { styles . processes } >
53+ < ProcessMessages processes = { processes } />
54+ </ div >
55+ ) : null }
4456 </ div >
4557 )
4658}
0 commit comments