import PropTypes from 'prop-types'; import React from 'react'; import { FormattedMessage, injectIntl, defineMessages } from 'react-intl'; import { connect } from 'react-redux'; import { Link } from 'react-router-dom'; import { changeSettingImmediate } from 'soapbox/actions/settings'; import snackbar from 'soapbox/actions/snackbar'; import Icon from 'soapbox/components/icon'; import Column from '../ui/components/column'; const messages = defineMessages({ heading: { id: 'column.developers', defaultMessage: 'Developers' }, leave: { id: 'developers.leave', defaultMessage: 'You have left developers' }, }); export default @connect() @injectIntl class DevelopersMenu extends React.Component { static contextTypes = { router: PropTypes.object, }; static propTypes = { intl: PropTypes.object.isRequired, dispatch: PropTypes.func.isRequired, } leaveDevelopers = e => { const { intl, dispatch } = this.props; dispatch(changeSettingImmediate(['isDeveloper'], false)); dispatch(snackbar.success(intl.formatMessage(messages.leave))); this.context.router.history.push('/'); e.preventDefault(); } render() { const { intl } = this.props; return (
); } }