import React from 'react'; import PropTypes from 'prop-types'; import { withTranslation } from 'react-i18next'; import { UncontrolledPopover, PopoverHeader, PopoverBody } from 'reactstrap'; /** * * @author Yuki Takei * * @export * @class SlackNotification * @extends {React.Component} */ class SlackNotification extends React.Component { constructor(props) { super(props); this.idForSlackPopover = `${this.props.id}ForSlackPopover`; this.updateCheckboxHandler = this.updateCheckboxHandler.bind(this); this.updateSlackChannelsHandler = this.updateSlackChannelsHandler.bind(this); } updateCheckboxHandler(event) { const value = event.target.checked; if (this.props.onEnabledFlagChange != null) { this.props.onEnabledFlagChange(value); } } updateSlackChannelsHandler(event) { const value = event.target.value; if (this.props.onChannelChange != null) { this.props.onChannelChange(value); } } render() { const { t } = this.props; return (
{t('slack_notification.popover_title')} {t('slack_notification.popover_desc')}
); } } SlackNotification.propTypes = { t: PropTypes.func.isRequired, // i18next popUp: PropTypes.bool.isRequired, isSlackEnabled: PropTypes.bool.isRequired, slackChannels: PropTypes.string.isRequired, onEnabledFlagChange: PropTypes.func, onChannelChange: PropTypes.func, id: PropTypes.string.isRequired, }; export default withTranslation()(SlackNotification);