Use more show-if

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
This commit is contained in:
Tilman Vatteroth 2020-06-07 00:53:04 +02:00 committed by mrdrogdrog
parent 7b5b73a289
commit f2e273fc40
9 changed files with 76 additions and 85 deletions

View file

@ -1,6 +1,7 @@
import React from 'react'
import { Alert } from 'react-bootstrap'
import { ForkAwesomeIcon } from '../../fork-awesome/fork-awesome-icon'
import { ShowIf } from '../common/show-if'
export interface LoadingScreenProps {
failedTitle: string
@ -13,16 +14,12 @@ export const LoadingScreen: React.FC<LoadingScreenProps> = ({ failedTitle }) =>
<ForkAwesomeIcon icon="file-text" size="5x"
className={failedTitle ? 'animation-shake' : 'animation-pulse'}/>
</div>
{
failedTitle !== ''
? (
<Alert variant={'danger'}>
The task '{failedTitle}' failed.<br/>
For further information look into the browser console.
</Alert>
)
: null
}
<ShowIf condition={ failedTitle !== ''}>
<Alert variant={'danger'}>
The task '{failedTitle}' failed.<br/>
For further information look into the browser console.
</Alert>
</ShowIf>
</div>
)
}