import React from 'react'; import ConfirmModal from './ConfirmModal'; import ModalActionCreators from '../actions/ModalActionCreators'; import i18n from '../i18n'; import MessageGroup from './MessageGroup'; import MessageActionCreators from '../actions/MessageActionCreators'; import ChannelPinActionCreators from '../actions/ChannelPinActionCreators'; import Protip from './common/Protip'; function confirmPin(channel, message) { ModalActionCreators.push(props => { let prompt; if (channel.isPrivate()) { prompt = i18n.Messages.PIN_MESSAGE_BODY_PRIVATE_CHANNEL; } else { prompt = i18n.Messages.PIN_MESSAGE_BODY.format({channelName: channel.toString()}); } return ( ChannelPinActionCreators.pinMessage(channel, message.id)} {...props}>

{prompt}

); }); } function confirmUnpin(channel, message) { ModalActionCreators.push(props => { return ( ChannelPinActionCreators.unpinMessage(channel, message.id)} {...props}>

{i18n.Messages.UNPIN_MESSAGE_BODY}

); }); } function confirmDelete(channel, message, showContextMenuHint = false) { let contextHint = null; if (showContextMenuHint) { contextHint = ; } ModalActionCreators.push(props => { return ( MessageActionCreators.deleteMessage(channel.id, message.id)} {...props}>

{i18n.Messages.DELETE_MESSAGE_BODY}

{contextHint}
); }); } export default { confirmPin, confirmUnpin, confirmDelete, }; // WEBPACK FOOTER // // ./discord_app/components/MessageAlerts.js