2018-04-10 13:24:04 +08:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { withTracker } from 'meteor/react-meteor-data';
|
2019-03-27 01:36:26 +08:00
|
|
|
import ErrorBoundary from '/imports/ui/components/error-boundary/component';
|
|
|
|
import FallbackPresentation from '/imports/ui/components/fallback-errors/fallback-presentation/component';
|
2018-04-10 13:24:04 +08:00
|
|
|
import PresentationPodService from './service';
|
|
|
|
import PresentationPods from './component';
|
|
|
|
|
|
|
|
// PresentationPods component will be the place to go once we have the presentation pods designs
|
|
|
|
// it should give each PresentationAreaContainer some space
|
|
|
|
// which it will fill with the uploaded presentation
|
|
|
|
const PresentationPodsContainer = ({ presentationPodIds, ...props }) => {
|
|
|
|
if (presentationPodIds && presentationPodIds.length > 0) {
|
|
|
|
return (
|
2019-03-27 01:36:26 +08:00
|
|
|
<ErrorBoundary Fallback={FallbackPresentation}>
|
|
|
|
<PresentationPods presentationPodIds={presentationPodIds} {...props} />
|
|
|
|
</ErrorBoundary>
|
2018-04-10 13:24:04 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
};
|
|
|
|
|
2019-08-30 00:26:07 +08:00
|
|
|
export default withTracker(() => ({
|
|
|
|
presentationPodIds: PresentationPodService.getPresentationPodIds()
|
|
|
|
}))(PresentationPodsContainer);
|
2018-04-10 13:24:04 +08:00
|
|
|
|
|
|
|
PresentationPodsContainer.propTypes = {
|
|
|
|
presentationPodIds: PropTypes.arrayOf(PropTypes.shape({
|
|
|
|
podId: PropTypes.string.isRequired,
|
|
|
|
})).isRequired,
|
|
|
|
};
|