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

38 lines
1.2 KiB
React
Raw Normal View History

import React from 'react';
import { withTracker } from 'meteor/react-meteor-data';
2017-05-04 00:36:16 +08:00
import Service from './service';
import PresentationUploader from './component';
const PresentationUploaderContainer = props => (
2017-09-29 22:03:08 +08:00
<PresentationUploader {...props} />
);
2017-05-04 00:36:16 +08:00
export default withTracker(() => {
2017-05-04 00:36:16 +08:00
const PRESENTATION_CONFIG = Meteor.settings.public.presentation;
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,
allowDownloadable: PRESENTATION_CONFIG.allowDownloadable,
handleSave: presentations => Service.persistPresentationChanges(
currentPresentations,
presentations,
PRESENTATION_CONFIG.uploadEndpoint,
'DEFAULT_PRESENTATION_POD',
),
dispatchDisableDownloadable,
dispatchEnableDownloadable,
dispatchTogglePresentationDownloadable,
2017-05-04 00:36:16 +08:00
};
})(PresentationUploaderContainer);