Merge branch 'feed-carousel-conditional' into 'develop'

Move condition for FeedCarousel to HomePage

Closes #1066

See merge request soapbox-pub/soapbox-fe!1732
environments/review-develop-3zknud/deployments/774
marcin mikołajczak 2022-08-12 22:07:16 +00:00
commit 6c54d50839
2 zmienionych plików z 2 dodań i 8 usunięć

Wyświetl plik

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

Wyświetl plik

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