Move condition for FeedCarousel to HomePage
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
aa5b5dbaf6
commit
771abfb8fb
|
@ -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'>
|
||||
|
|
|
@ -58,7 +58,7 @@ const HomePage: React.FC = ({ children }) => {
|
|||
</Card>
|
||||
)}
|
||||
|
||||
<FeedCarousel />
|
||||
{features.feedUserFiltering && <FeedCarousel />}
|
||||
|
||||
{children}
|
||||
|
||||
|
|
Loading…
Reference in New Issue