From a131f274b43366412aca3ef8512b4eb8babeb352 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 21 Sep 2023 13:08:33 -0500 Subject: [PATCH] LandingPage: remove donation widgets from sidebar when logged out --- src/pages/landing-page.tsx | 96 ++------------------------------------ 1 file changed, 5 insertions(+), 91 deletions(-) diff --git a/src/pages/landing-page.tsx b/src/pages/landing-page.tsx index 8a892e938..1eba1de91 100644 --- a/src/pages/landing-page.tsx +++ b/src/pages/landing-page.tsx @@ -1,25 +1,14 @@ -import clsx from 'clsx'; -import React, { useRef } from 'react'; -import { useIntl } from 'react-intl'; -import { Link } from 'react-router-dom'; +import React from 'react'; -import { uploadCompose } from 'soapbox/actions/compose'; import LinkFooter from 'soapbox/features/ui/components/link-footer'; import { - WhoToFollowPanel, TrendsPanel, SignUpPanel, - PromoPanel, - FundingPanel, - CryptoDonatePanel, - BirthdayPanel, CtaBanner, - AnnouncementsPanel, } from 'soapbox/features/ui/util/async-components'; -import { useAppSelector, useOwnAccount, useFeatures, useSoapboxConfig, useDraggedFiles, useAppDispatch } from 'soapbox/hooks'; +import { useAppSelector, useFeatures } from 'soapbox/hooks'; -import { Avatar, Card, CardBody, HStack, Layout } from '../components/ui'; -import ComposeForm from '../features/compose/components/compose-form'; +import { Layout } from '../components/ui'; import BundleContainer from '../features/ui/containers/bundle-container'; interface ILandingPage { @@ -27,64 +16,17 @@ interface ILandingPage { } const LandingPage: React.FC = ({ children }) => { - const intl = useIntl(); - const dispatch = useAppDispatch(); - const me = useAppSelector(state => state.me); - const { account } = useOwnAccount(); const features = useFeatures(); - const soapboxConfig = useSoapboxConfig(); - - const composeId = 'home'; - 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', 0); - - const { isDragging, isDraggedOver } = useDraggedFiles(composeBlock, (files) => { - dispatch(uploadCompose(composeId, files, intl)); - }); - - const acct = account ? account.acct : ''; - const avatar = account ? account.avatar : ''; return ( <> - {me && ( - - - - - - - -
- -
-
-
-
- )} - {children} {!me && ( - {Component => } + {Component => } )}
@@ -95,40 +37,12 @@ const LandingPage: React.FC = ({ children }) => { {Component => } )} - {me && features.announcements && ( - - {Component => } - - )} {features.trends && ( {Component => } )} - {hasPatron && ( - - {Component => } - - )} - {hasCrypto && cryptoLimit > 0 && ( - - {Component => } - - )} - - {Component => } - - {features.birthdays && ( - - {Component => } - - )} - {me && features.suggestions && ( - - {Component => } - - )} - + );