bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/actions-bar/actions-dropdown/container.jsx

42 lines
1.6 KiB
React
Raw Normal View History

import React from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import Presentations from '/imports/api/presentations';
import PresentationUploaderService from '/imports/ui/components/presentation/presentation-uploader/service';
import PresentationPodService from '/imports/ui/components/presentation-pod/service';
import ActionsDropdown from './component';
2021-09-11 04:48:52 +08:00
import { layoutSelectInput, layoutDispatch } from '../../layout/context';
2021-09-28 03:57:02 +08:00
import getFromUserSettings from '/imports/ui/services/users-settings';
import { SMALL_VIEWPORT_BREAKPOINT } from '../../layout/enums';
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);
const { width: browserWidth } = layoutSelectInput((i) => i.browser);
const isMobile = browserWidth <= SMALL_VIEWPORT_BREAKPOINT;
2021-09-11 04:48:52 +08:00
const layoutContextDispatch = layoutDispatch();
return (
<ActionsDropdown {...{
2021-08-05 19:03:24 +08:00
layoutContextDispatch,
sidebarContent,
sidebarNavigation,
isMobile,
...props,
}}
/>
);
2021-05-18 04:25:07 +08:00
};
2021-09-28 03:57:02 +08:00
const LAYOUT_CONFIG = Meteor.settings.public.layout;
export default withTracker(() => {
const presentations = Presentations.find({ 'conversion.done': true }).fetch();
return ({
presentations,
2021-05-12 22:07:18 +08:00
isDropdownOpen: Session.get('dropdownOpen'),
setPresentation: PresentationUploaderService.setPresentation,
podIds: PresentationPodService.getPresentationPodIds(),
2021-09-28 03:57:02 +08:00
hidePresentation: getFromUserSettings('bbb_hide_presentation', LAYOUT_CONFIG.hidePresentation),
});
2021-05-18 04:25:07 +08:00
})(ActionsDropdownContainer);