2017-06-07 20:28:41 +08:00
|
|
|
import React from 'react';
|
2018-01-08 12:44:42 +08:00
|
|
|
import { withTracker } from 'meteor/react-meteor-data';
|
2017-05-04 00:36:16 +08:00
|
|
|
|
|
|
|
import Service from './service';
|
|
|
|
import PresentationUploader from './component';
|
|
|
|
|
2017-06-07 20:28:41 +08:00
|
|
|
const PresentationUploaderContainer = props => (
|
2017-09-29 22:03:08 +08:00
|
|
|
<PresentationUploader {...props} />
|
2017-06-07 20:28:41 +08:00
|
|
|
);
|
2017-05-04 00:36:16 +08:00
|
|
|
|
2018-01-08 12:44:42 +08:00
|
|
|
export default withTracker(() => {
|
2017-05-04 00:36:16 +08:00
|
|
|
const PRESENTATION_CONFIG = Meteor.settings.public.presentation;
|
|
|
|
const currentPresentations = Service.getPresentations();
|
|
|
|
|
|
|
|
return {
|
|
|
|
presentations: currentPresentations,
|
2017-09-23 04:49:11 +08:00
|
|
|
defaultFileName: PRESENTATION_CONFIG.defaultPresentationFile,
|
2017-05-04 00:36:16 +08:00
|
|
|
fileSizeMin: PRESENTATION_CONFIG.uploadSizeMin,
|
|
|
|
fileSizeMax: PRESENTATION_CONFIG.uploadSizeMax,
|
|
|
|
fileValidMimeTypes: PRESENTATION_CONFIG.uploadValidMimeTypes,
|
2017-05-23 22:05:42 +08:00
|
|
|
handleSave: presentations => Service.persistPresentationChanges(
|
|
|
|
currentPresentations,
|
|
|
|
presentations,
|
2017-06-07 20:28:41 +08:00
|
|
|
PRESENTATION_CONFIG.uploadEndpoint,
|
2018-09-05 00:56:10 +08:00
|
|
|
'DEFAULT_PRESENTATION_POD',
|
2017-05-23 22:05:42 +08:00
|
|
|
),
|
2017-05-04 00:36:16 +08:00
|
|
|
};
|
2018-01-08 12:44:42 +08:00
|
|
|
})(PresentationUploaderContainer);
|