import React from 'react'; import { FormattedMessage, defineMessages, useIntl } from 'react-intl'; import { useDispatch } from 'react-redux'; import { Link, useHistory } from 'react-router-dom'; import { changeSettingImmediate } from 'soapbox/actions/settings'; import snackbar from 'soapbox/actions/snackbar'; import { Text } from 'soapbox/components/ui'; import SvgIcon from 'soapbox/components/ui/icon/svg-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' }, }); interface IDashWidget { to?: string, onClick?: React.MouseEventHandler, children: React.ReactNode, } const DashWidget: React.FC = ({ to, onClick, children }) => { const className = 'bg-gray-200 dark:bg-gray-600 p-4 rounded flex flex-col items-center justify-center space-y-2 hover:-translate-y-1 transition-transform'; if (to) { return {children}; } else { return ; } }; const Developers: React.FC = () => { const dispatch = useDispatch(); const history = useHistory(); const intl = useIntl(); const leaveDevelopers = (e: React.MouseEvent) => { e.preventDefault(); dispatch(changeSettingImmediate(['isDeveloper'], false)); dispatch(snackbar.success(intl.formatMessage(messages.leave))); history.push('/'); }; return (
); }; export default Developers;