bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/presentation/download-presentation-button/component.jsx

48 lines
1.1 KiB
React
Raw Normal View History

2019-02-21 03:28:02 +08:00
import React from 'react';
import { defineMessages, injectIntl } from 'react-intl';
2019-02-21 03:28:02 +08:00
import PropTypes from 'prop-types';
import Styled from './styles';
2019-02-21 03:28:02 +08:00
const intlMessages = defineMessages({
downloadPresentationButton: {
id: 'app.downloadPresentationButton.label',
description: 'Download presentation label',
},
});
const propTypes = {
intl: PropTypes.object.isRequired,
2019-02-21 03:28:02 +08:00
handleDownloadPresentation: PropTypes.func.isRequired,
dark: PropTypes.bool,
};
const defaultProps = {
dark: false,
};
const DownloadPresentationButton = ({
intl,
handleDownloadPresentation,
dark,
}) => {
return (
<Styled.ButtonWrapper theme={dark ? 'dark' : 'light'}>
<Styled.DownloadButton
data-test="presentationDownload"
color="default"
icon="template_download"
size="sm"
onClick={handleDownloadPresentation}
label={intl.formatMessage(intlMessages.downloadPresentationButton)}
hideLabel
/>
</Styled.ButtonWrapper>
);
};
2019-02-21 03:28:02 +08:00
DownloadPresentationButton.propTypes = propTypes;
DownloadPresentationButton.defaultProps = defaultProps;
export default injectIntl(DownloadPresentationButton);