import React, { useRef } from 'react'; import { Link } from 'react-router-dom'; import SidebarNavigation from 'soapbox/components/sidebar-navigation'; import LinkFooter from 'soapbox/features/ui/components/link_footer'; import { WhoToFollowPanel, TrendsPanel, SignUpPanel, PromoPanel, FundingPanel, CryptoDonatePanel, BirthdayPanel, } from 'soapbox/features/ui/util/async-components'; import { useAppSelector, useOwnAccount, useFeatures, useSoapboxConfig } from 'soapbox/hooks'; import Avatar from '../components/avatar'; import { Card, CardBody, Layout } from '../components/ui'; import ComposeFormContainer from '../features/compose/containers/compose_form_container'; import BundleContainer from '../features/ui/containers/bundle_container'; // import GroupSidebarPanel from '../features/groups/sidebar_panel'; const HomePage: React.FC = ({ children }) => { const me = useAppSelector(state => state.me); const account = useOwnAccount(); const features = useFeatures(); const soapboxConfig = useSoapboxConfig(); const composeBlock = useRef(null); const hasPatron = soapboxConfig.extensions.getIn(['patron', 'enabled']) === true; const hasCrypto = typeof soapboxConfig.cryptoAddresses.getIn([0, 'ticker']) === 'string'; const cryptoLimit = soapboxConfig.cryptoDonatePanel.get('limit'); const acct = account ? account.acct : ''; return ( {me && (
)} {children}
{!me && ( {Component => } )} {features.trends && ( {Component => } )} {hasPatron && ( {Component => } )} {hasCrypto && cryptoLimit && cryptoLimit > 0 && ( {Component => } )} {Component => } {features.birthdays && ( {Component => } )} {features.suggestions && ( {Component => } )}
); }; export default HomePage;