-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add progress bar for video uploads and refactor (#860)
* feat: add progress bar for video uploads and refactor --------- Co-authored-by: Kristin Aoki <42981026+KristinAoki@users.noreply.github.com>
- Loading branch information
1 parent
4e70813
commit d76aaa7
Showing
12 changed files
with
277 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/files-and-videos/videos-page/AddVideoProgressBarToast.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React, { useEffect } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n'; | ||
import { Toast, ProgressBar } from '@openedx/paragon'; | ||
import messages from './messages'; | ||
|
||
const AddVideoProgressBarToast = ({ | ||
uploadVideoProgress, | ||
intl, | ||
}) => { | ||
let isOpen = false; | ||
useEffect(() => { | ||
isOpen = !!uploadVideoProgress; | ||
}, [uploadVideoProgress]); | ||
|
||
return ( | ||
<Toast | ||
show={isOpen} | ||
> | ||
{intl.formatMessage(messages.videoUploadProgressBarLabel)} | ||
<ProgressBar now={uploadVideoProgress} label={uploadVideoProgress.toString()} variant="primary" /> | ||
</Toast> | ||
); | ||
}; | ||
|
||
AddVideoProgressBarToast.defaultProps = { | ||
uploadVideoProgress: 0, | ||
}; | ||
AddVideoProgressBarToast.propTypes = { | ||
uploadVideoProgress: PropTypes.number, | ||
// injected | ||
intl: intlShape.isRequired, | ||
}; | ||
|
||
export default injectIntl(AddVideoProgressBarToast); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.