forked from p15670423/monkey
Added an upload status icon (checkmark if successful, red x if error)
This commit is contained in:
parent
34024794c8
commit
691dfee4f8
|
@ -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;
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue