bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/about/component.jsx

77 lines
1.9 KiB
React
Raw Normal View History

2017-10-06 20:50:01 +08:00
import React from 'react';
2016-12-08 23:40:11 +08:00
import { defineMessages, injectIntl } from 'react-intl';
import ModalSimple from '/imports/ui/components/common/modal/simple/component';
2016-12-08 23:40:11 +08:00
const intlMessages = defineMessages({
title: {
id: 'app.about.title',
2017-04-10 23:50:03 +08:00
description: 'About title label',
2016-12-08 23:40:11 +08:00
},
version: {
id: 'app.about.version',
2017-04-10 23:50:03 +08:00
description: 'Client version label',
2016-12-08 23:40:11 +08:00
},
copyright: {
id: 'app.about.copyright',
defaultMessage: (new Date().getFullYear()),
2017-04-10 23:50:03 +08:00
description: 'Client copyright label',
2016-12-08 23:40:11 +08:00
},
confirmLabel: {
id: 'app.about.confirmLabel',
2017-04-10 23:50:03 +08:00
description: 'Confirmation button label',
2016-12-08 23:40:11 +08:00
},
confirmDesc: {
id: 'app.about.confirmDesc',
2017-04-11 05:28:07 +08:00
description: 'adds descriptive context to confirmLabel',
2016-12-08 23:40:11 +08:00
},
dismissLabel: {
id: 'app.about.dismissLabel',
2017-04-10 23:50:03 +08:00
description: 'Dismiss button label',
2016-12-08 23:40:11 +08:00
},
dismissDesc: {
id: 'app.about.dismissDesc',
2017-04-11 05:28:07 +08:00
description: 'adds descriptive context to dissmissLabel',
2016-12-08 23:40:11 +08:00
},
version_label: {
id: 'app.about.version_label',
description: 'label for version bbb',
},
2016-12-08 23:40:11 +08:00
});
const AboutComponent = (props) => {
const { intl, settings } = props;
const {
html5ClientBuild,
copyright,
bbbServerVersion,
displayBbbServerVersion,
} = settings;
const showLabelVersion = () => (
<>
<br />
{`${intl.formatMessage(intlMessages.version_label)} ${bbbServerVersion}`}
</>
);
return (
<ModalSimple
data-test="aboutModalTitleLabel"
title={intl.formatMessage(intlMessages.title)}
dismiss={{
label: intl.formatMessage(intlMessages.dismissLabel),
description: intl.formatMessage(intlMessages.dismissDesc),
}}
{...props}
>
{`${intl.formatMessage(intlMessages.copyright)} ${copyright}`}
<br />
{`${intl.formatMessage(intlMessages.version)} ${html5ClientBuild}`}
{displayBbbServerVersion ? showLabelVersion() : null}
</ModalSimple>
);
};
2016-12-08 23:40:11 +08:00
export default injectIntl(AboutComponent);