Added an upload status icon (checkmark if successful, red x if error)

This commit is contained in:
VakarisZ 2021-06-01 10:13:40 +03:00
parent 34024794c8
commit 691dfee4f8
2 changed files with 32 additions and 1 deletions

View File

@ -0,0 +1,23 @@
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
import {faCheck, faTimes} from '@fortawesome/free-solid-svg-icons';
import React from 'react';
export const UploadStatuses = {
clean: 'clean',
success: 'success',
error: 'error'
}
const UploadStatusIcon = (props: { status: string }) => {
switch (props.status) {
case UploadStatuses.success:
return (<FontAwesomeIcon icon={faCheck} className={'upload-status-icon-success'}/>);
case UploadStatuses.error:
return (<FontAwesomeIcon icon={faTimes} className={'upload-status-icon-error'}/>);
default:
return null;
}
}
export default UploadStatusIcon;

View File

@ -11,7 +11,7 @@
}
.icon-success {
color: $success
color: $success;
}
.icon-failed {
@ -26,3 +26,11 @@
transform: rotate(359deg);
}
}
.upload-status-icon-success {
color: $success;
}
.upload-status-icon-error {
color: $danger;
}