2018-12-15 04:16:15 +08:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
2020-05-26 04:00:13 +08:00
|
|
|
import { defineMessages, injectIntl } from 'react-intl';
|
2018-12-15 04:16:15 +08:00
|
|
|
import Button from '/imports/ui/components/button/component';
|
|
|
|
|
|
|
|
const propTypes = {
|
2021-08-09 22:24:02 +08:00
|
|
|
intl: PropTypes.shape({
|
|
|
|
formatMessage: PropTypes.func.isRequired,
|
|
|
|
}).isRequired,
|
2018-12-15 04:16:15 +08:00
|
|
|
toggleSwapLayout: PropTypes.func.isRequired,
|
|
|
|
};
|
|
|
|
|
|
|
|
const intlMessages = defineMessages({
|
|
|
|
restorePresentationLabel: {
|
|
|
|
id: 'app.actionsBar.actionsDropdown.restorePresentationLabel',
|
|
|
|
description: 'Restore Presentation option label',
|
|
|
|
},
|
|
|
|
restorePresentationDesc: {
|
|
|
|
id: 'app.actionsBar.actionsDropdown.restorePresentationDesc',
|
|
|
|
description: 'button to restore presentation after it has been closed',
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2021-07-17 02:42:16 +08:00
|
|
|
const PresentationOptionsContainer = ({
|
|
|
|
intl,
|
|
|
|
toggleSwapLayout,
|
|
|
|
isThereCurrentPresentation,
|
2021-08-09 22:24:02 +08:00
|
|
|
layoutContextDispatch,
|
2021-08-10 03:06:31 +08:00
|
|
|
}) => (
|
|
|
|
<Button
|
|
|
|
icon="presentation"
|
|
|
|
data-test="restorePresentationButton"
|
|
|
|
label={intl.formatMessage(intlMessages.restorePresentationLabel)}
|
|
|
|
description={intl.formatMessage(intlMessages.restorePresentationDesc)}
|
|
|
|
color="primary"
|
|
|
|
hideLabel
|
|
|
|
circle
|
|
|
|
size="lg"
|
|
|
|
onClick={() => toggleSwapLayout(layoutContextDispatch)}
|
|
|
|
id="restore-presentation"
|
|
|
|
disabled={!isThereCurrentPresentation}
|
|
|
|
/>
|
|
|
|
);
|
2018-12-15 04:16:15 +08:00
|
|
|
|
|
|
|
PresentationOptionsContainer.propTypes = propTypes;
|
|
|
|
export default injectIntl(PresentationOptionsContainer);
|