2022-02-23 01:41:16 +08:00
|
|
|
import React from 'react';
|
|
|
|
import LayoutModalComponent from './component';
|
2024-05-17 20:47:27 +08:00
|
|
|
import { updateSettings } from '/imports/ui/components/settings/service';
|
2024-01-30 21:03:11 +08:00
|
|
|
import useUserChangedLocalSettings from '/imports/ui/services/settings/hooks/useUserChangedLocalSettings';
|
2024-05-17 20:47:27 +08:00
|
|
|
import useSettings from '/imports/ui/services/settings/hooks/useSettings';
|
|
|
|
import { SETTINGS } from '/imports/ui/services/settings/enums';
|
|
|
|
import useCurrentUser from '/imports/ui/core/hooks/useCurrentUser';
|
2022-02-23 01:41:16 +08:00
|
|
|
|
2023-03-22 01:55:43 +08:00
|
|
|
const LayoutModalContainer = (props) => {
|
2024-05-17 20:47:27 +08:00
|
|
|
const {
|
|
|
|
intl, setIsOpen, onRequestClose, isOpen, amIModerator,
|
|
|
|
} = props;
|
2024-01-30 21:03:11 +08:00
|
|
|
const setLocalSettings = useUserChangedLocalSettings();
|
2024-05-17 20:47:27 +08:00
|
|
|
const application = useSettings(SETTINGS.APPLICATION);
|
|
|
|
const { data: currentUser } = useCurrentUser((u) => ({
|
|
|
|
presenter: u.presenter,
|
|
|
|
}));
|
|
|
|
return (
|
|
|
|
<LayoutModalComponent {...{
|
|
|
|
intl,
|
|
|
|
setIsOpen,
|
|
|
|
isModerator: amIModerator,
|
|
|
|
isPresenter: currentUser?.presenter ?? false,
|
|
|
|
application,
|
|
|
|
updateSettings,
|
|
|
|
onRequestClose,
|
|
|
|
isOpen,
|
|
|
|
setLocalSettings,
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|
2022-02-23 01:41:16 +08:00
|
|
|
|
2024-05-17 20:47:27 +08:00
|
|
|
export default LayoutModalContainer;
|