better error messages for the loading-screen (#87)

better error messages for the loading-screen

Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2020-05-30 16:22:07 +02:00 committed by GitHub
parent 68790dbe1b
commit dbc592e6d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 36 additions and 14 deletions

View file

@ -3,18 +3,25 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { Alert } from 'react-bootstrap'
export interface LoadingScreenProps {
failed: boolean
failedTitle: string
}
export const LoadingScreen: React.FC<LoadingScreenProps> = ({ failed }) => {
export const LoadingScreen: React.FC<LoadingScreenProps> = ({ failedTitle }) => {
return (
<div className="loader middle">
<div className="icon">
<FontAwesomeIcon icon="file-alt" size="6x"
className={failed ? 'animation-shake' : 'animation-pulse'}/>
className={failedTitle ? 'animation-shake' : 'animation-pulse'}/>
</div>
{
failed ? <Alert variant={'danger'}>An error occurred while loading the application!</Alert> : null
failedTitle !== ''
? (
<Alert variant={'danger'}>
The task '{failedTitle}' failed.<br/>
For further information look into the browser console.
</Alert>
)
: null
}
</div>
)