2022-03-30 07:51:07 -07:00
|
|
|
import React from 'react';
|
|
|
|
|
2022-06-17 11:42:21 -07:00
|
|
|
import UploadProgress from 'soapbox/components/upload-progress';
|
2022-03-30 07:51:07 -07:00
|
|
|
import { useAppSelector } from 'soapbox/hooks';
|
|
|
|
|
2022-06-17 11:42:21 -07:00
|
|
|
/** File upload progress bar for post composer. */
|
|
|
|
const ComposeUploadProgress = () => {
|
2022-03-30 07:51:07 -07:00
|
|
|
const active = useAppSelector((state) => state.compose.get('is_uploading'));
|
|
|
|
const progress = useAppSelector((state) => state.compose.get('progress'));
|
|
|
|
|
|
|
|
if (!active) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
2022-06-17 11:42:21 -07:00
|
|
|
<UploadProgress progress={progress} />
|
2022-03-30 07:51:07 -07:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2022-06-17 11:42:21 -07:00
|
|
|
export default ComposeUploadProgress;
|