uppy/packages/@uppy/webcam/src/RecordingLength.js
Dominic Eden e7fbaa940d [feature] - Add new ‘showRecordingLength’ option for the Webcam plugin (#1947)
* [feature] - Add new ‘showRecordingLength’ prop for the Webcam plugin. When this is true, it counts the duration of a recording and displays it to the user. Add a test for generating the correct duration of the recording.

* Update packages/@uppy/webcam/src/style.scss

Co-Authored-By: Artur Paikin <artur@arturpaikin.com>

* Added i18n for the recording length counter and update Readme. Fix Webcam styles where some styles were not in alphabetical order.

* Update packages/@uppy/webcam/src/style.scss

Co-Authored-By: Artur Paikin <artur@arturpaikin.com>

Added i18n for the recording length counter and update Readme. Fix Webcam styles where some styles were not in alphabetical order.
2019-11-27 20:10:38 +03:00

12 lines
448 B
JavaScript

const { h } = require('preact')
const formatSeconds = require('./formatSeconds')
module.exports = function RecordingLength ({ recordingLengthSeconds, i18n }) {
const formattedRecordingLengthSeconds = formatSeconds(recordingLengthSeconds)
return (
<div class="uppy-Webcam-recordingLength" aria-label={i18n('recordingLength', { recording_length: formattedRecordingLengthSeconds })}>
{formattedRecordingLengthSeconds}
</div>
)
}