Move condition for FeedCarousel to HomePage

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2022-08-12 23:25:45 +02:00
parent aa5b5dbaf6
commit 771abfb8fb
2 changed files with 2 additions and 8 deletions

View File

@ -3,7 +3,7 @@ import React, { useEffect, useState } from 'react';
import { FormattedMessage } from 'react-intl'; import { FormattedMessage } from 'react-intl';
import { replaceHomeTimeline } from 'soapbox/actions/timelines'; import { replaceHomeTimeline } from 'soapbox/actions/timelines';
import { useAppDispatch, useAppSelector, useDimensions, useFeatures } from 'soapbox/hooks'; import { useAppDispatch, useAppSelector, useDimensions } from 'soapbox/hooks';
import useCarouselAvatars from 'soapbox/queries/carousels'; import useCarouselAvatars from 'soapbox/queries/carousels';
import { Card, HStack, Icon, Stack, Text } from '../../components/ui'; import { Card, HStack, Icon, Stack, Text } from '../../components/ui';
@ -59,8 +59,6 @@ const CarouselItem = ({ avatar }: { avatar: any }) => {
}; };
const FeedCarousel = () => { const FeedCarousel = () => {
const features = useFeatures();
const { data: avatars, isFetching, isError } = useCarouselAvatars(); const { data: avatars, isFetching, isError } = useCarouselAvatars();
const [cardRef, setCardRef, { width }] = useDimensions(); const [cardRef, setCardRef, { width }] = useDimensions();
@ -83,10 +81,6 @@ const FeedCarousel = () => {
} }
}, [width, widthPerAvatar]); }, [width, widthPerAvatar]);
if (!features.feedUserFiltering) {
return null;
}
if (isError) { if (isError) {
return ( return (
<Card variant='rounded' size='lg' data-testid='feed-carousel-error'> <Card variant='rounded' size='lg' data-testid='feed-carousel-error'>

View File

@ -58,7 +58,7 @@ const HomePage: React.FC = ({ children }) => {
</Card> </Card>
)} )}
<FeedCarousel /> {features.feedUserFiltering && <FeedCarousel />}
{children} {children}