2023-09-16 02:42:02 +08:00
|
|
|
import React, { useContext } from 'react';
|
2020-04-02 06:54:47 +08:00
|
|
|
import { withTracker } from 'meteor/react-meteor-data';
|
|
|
|
import Presentations from '/imports/api/presentations';
|
|
|
|
import PresentationUploaderService from '/imports/ui/components/presentation/presentation-uploader/service';
|
|
|
|
import ActionsDropdown from './component';
|
2022-05-13 21:42:19 +08:00
|
|
|
import { layoutSelectInput, layoutDispatch, layoutSelect } from '../../layout/context';
|
2022-03-04 01:46:20 +08:00
|
|
|
import { SMALL_VIEWPORT_BREAKPOINT } from '../../layout/enums';
|
2023-06-14 22:32:52 +08:00
|
|
|
import { isCameraAsContentEnabled, isTimerFeatureEnabled } from '/imports/ui/services/features';
|
2023-09-16 02:42:02 +08:00
|
|
|
import { PluginsContext } from '/imports/ui/components/components-data/plugin-context/context';
|
2021-05-18 04:25:07 +08:00
|
|
|
|
|
|
|
const ActionsDropdownContainer = (props) => {
|
2021-09-11 04:48:52 +08:00
|
|
|
const sidebarContent = layoutSelectInput((i) => i.sidebarContent);
|
|
|
|
const sidebarNavigation = layoutSelectInput((i) => i.sidebarNavigation);
|
2022-03-04 01:46:20 +08:00
|
|
|
const { width: browserWidth } = layoutSelectInput((i) => i.browser);
|
|
|
|
const isMobile = browserWidth <= SMALL_VIEWPORT_BREAKPOINT;
|
2021-09-11 04:48:52 +08:00
|
|
|
const layoutContextDispatch = layoutDispatch();
|
2022-05-13 21:42:19 +08:00
|
|
|
const isRTL = layoutSelect((i) => i.isRTL);
|
2023-09-16 02:42:02 +08:00
|
|
|
const { pluginsProvidedAggregatedState } = useContext(PluginsContext);
|
|
|
|
let actionButtonDropdownItems = [];
|
|
|
|
if (pluginsProvidedAggregatedState.actionButtonDropdownItems) {
|
|
|
|
actionButtonDropdownItems = [...pluginsProvidedAggregatedState.actionButtonDropdownItems];
|
|
|
|
}
|
2021-05-19 22:51:31 +08:00
|
|
|
|
|
|
|
return (
|
2023-06-14 22:32:52 +08:00
|
|
|
<ActionsDropdown
|
|
|
|
{...{
|
|
|
|
layoutContextDispatch,
|
|
|
|
sidebarContent,
|
|
|
|
sidebarNavigation,
|
|
|
|
isMobile,
|
|
|
|
isRTL,
|
2023-09-16 02:42:02 +08:00
|
|
|
actionButtonDropdownItems,
|
2023-06-14 22:32:52 +08:00
|
|
|
...props,
|
|
|
|
}}
|
2021-05-19 22:51:31 +08:00
|
|
|
/>
|
|
|
|
);
|
2021-05-18 04:25:07 +08:00
|
|
|
};
|
2020-04-02 06:54:47 +08:00
|
|
|
|
|
|
|
export default withTracker(() => {
|
|
|
|
const presentations = Presentations.find({ 'conversion.done': true }).fetch();
|
2023-06-14 02:54:16 +08:00
|
|
|
return {
|
2020-04-02 06:54:47 +08:00
|
|
|
presentations,
|
2023-06-14 02:54:16 +08:00
|
|
|
isTimerFeatureEnabled: isTimerFeatureEnabled(),
|
2021-05-12 22:07:18 +08:00
|
|
|
isDropdownOpen: Session.get('dropdownOpen'),
|
2020-04-02 06:54:47 +08:00
|
|
|
setPresentation: PresentationUploaderService.setPresentation,
|
2023-06-14 22:32:52 +08:00
|
|
|
isCameraAsContentEnabled: isCameraAsContentEnabled(),
|
2023-06-14 02:54:16 +08:00
|
|
|
};
|
2021-05-18 04:25:07 +08:00
|
|
|
})(ActionsDropdownContainer);
|