import classNames from 'clsx'; import React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router-dom'; import { logOut } from 'soapbox/actions/auth'; import { Text } from 'soapbox/components/ui'; import emojify from 'soapbox/features/emoji/emoji'; import { useSoapboxConfig, useOwnAccount, useFeatures, useAppDispatch } from 'soapbox/hooks'; import sourceCode from 'soapbox/utils/code'; interface IFooterLink { to: string, className?: string, onClick?: React.EventHandler, children: React.ReactNode, } const FooterLink: React.FC = ({ children, className, ...rest }): JSX.Element => { return (
{children}
); }; const LinkFooter: React.FC = (): JSX.Element => { const account = useOwnAccount(); const features = useFeatures(); const soapboxConfig = useSoapboxConfig(); const dispatch = useAppDispatch(); const onClickLogOut: React.EventHandler = (e) => { dispatch(logOut()); e.preventDefault(); }; return (
{account && <> {features.profileDirectory && ( )} {features.filters && ( )} {features.federating && ( )} {account.admin && ( )} {account.locked && ( )} }
{soapboxConfig.linkFooterMessage ? ( ) : ( {sourceCode.repository}, code_version: sourceCode.version, }} /> )}
); }; export default LinkFooter;