2018-04-10 13:24:04 +08:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { withTracker } from 'meteor/react-meteor-data';
|
2022-02-15 22:11:03 +08:00
|
|
|
import ErrorBoundary from '/imports/ui/components/common/error-boundary/component';
|
2022-02-15 22:29:38 +08:00
|
|
|
import FallbackView from '/imports/ui/components/common/fallback-errors/fallback-view/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
|
2021-06-09 21:49:59 +08:00
|
|
|
// it should give each PresentationContainer some space
|
2018-04-10 13:24:04 +08:00
|
|
|
// which it will fill with the uploaded presentation
|
|
|
|
const PresentationPodsContainer = ({ presentationPodIds, ...props }) => {
|
|
|
|
if (presentationPodIds && presentationPodIds.length > 0) {
|
|
|
|
return (
|
2020-10-22 21:00:09 +08:00
|
|
|
<ErrorBoundary Fallback={FallbackView}>
|
2019-03-27 01:36:26 +08:00
|
|
|
<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(() => ({
|
2020-10-22 21:00:09 +08:00
|
|
|
presentationPodIds: PresentationPodService.getPresentationPodIds(),
|
2019-08-30 00:26:07 +08:00
|
|
|
}))(PresentationPodsContainer);
|
2018-04-10 13:24:04 +08:00
|
|
|
|
|
|
|
PresentationPodsContainer.propTypes = {
|
|
|
|
presentationPodIds: PropTypes.arrayOf(PropTypes.shape({
|
|
|
|
podId: PropTypes.string.isRequired,
|
|
|
|
})).isRequired,
|
|
|
|
};
|