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 { Column, Text } from 'soapbox/components/ui'; import SvgIcon from 'soapbox/components/ui/icon/svg-icon'; import sourceCode from 'soapbox/utils/code'; 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-800 hover:bg-gray-300 dark:hover:bg-gray-800/75 p-4 rounded flex flex-col items-center justify-center space-y-2'; 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 ( <>
{sourceCode.displayName} {sourceCode.version}
); }; export default Developers;