kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Merge branch 'feed-carousel-conditional' into 'develop'
Move condition for FeedCarousel to HomePage Closes #1066 See merge request soapbox-pub/soapbox-fe!1732environments/review-develop-3zknud/deployments/774
commit
6c54d50839
|
@ -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}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue