bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/presentation/presentation-uploader/container.jsx

40 lines
1.4 KiB
React
Raw Normal View History

import React from 'react';
2020-02-26 03:29:14 +08:00
import { Meteor } from 'meteor/meteor';
import { withTracker } from 'meteor/react-meteor-data';
2017-05-04 00:36:16 +08:00
import Service from './service';
import PresentationService from '../service';
2020-02-26 03:29:14 +08:00
import Uploader from './component';
const PRESENTATION_CONFIG = Meteor.settings.public.presentation;
2017-05-04 00:36:16 +08:00
2020-02-26 03:29:14 +08:00
const UploaderContainer = props => <Uploader {...props} />;
2017-05-04 00:36:16 +08:00
export default withTracker(() => {
2017-05-04 00:36:16 +08:00
const currentPresentations = Service.getPresentations();
const {
dispatchDisableDownloadable,
dispatchEnableDownloadable,
dispatchTogglePresentationDownloadable,
} = Service;
2017-05-04 00:36:16 +08:00
return {
presentations: currentPresentations,
defaultFileName: PRESENTATION_CONFIG.defaultPresentationFile,
2017-05-04 00:36:16 +08:00
fileSizeMin: PRESENTATION_CONFIG.uploadSizeMin,
fileSizeMax: PRESENTATION_CONFIG.uploadSizeMax,
fileValidMimeTypes: PRESENTATION_CONFIG.uploadValidMimeTypes,
handleSave: presentations => Service.persistPresentationChanges(
currentPresentations,
presentations,
PRESENTATION_CONFIG.uploadEndpoint,
'DEFAULT_PRESENTATION_POD',
),
dispatchDisableDownloadable,
dispatchEnableDownloadable,
dispatchTogglePresentationDownloadable,
isOpen: Session.get('showUploadPresentationView') || false,
selectedToBeNextCurrent: Session.get('selectedToBeNextCurrent') || null,
isPresenter: PresentationService.isPresenter('DEFAULT_PRESENTATION_POD'),
2017-05-04 00:36:16 +08:00
};
})(UploaderContainer);