diff --git a/app/javascript/mastodon/components/featured_carousel.tsx b/app/javascript/mastodon/components/featured_carousel.tsx deleted file mode 100644 index c35f2f37f06..00000000000 --- a/app/javascript/mastodon/components/featured_carousel.tsx +++ /dev/null @@ -1,90 +0,0 @@ -import { useCallback, useEffect, useId } from 'react'; - -import { defineMessages, FormattedMessage } from 'react-intl'; - -import type { Map as ImmutableMap } from 'immutable'; -import { List as ImmutableList } from 'immutable'; - -import { expandAccountFeaturedTimeline } from '@/mastodon/actions/timelines'; -import { Icon } from '@/mastodon/components/icon'; -import { StatusQuoteManager } from '@/mastodon/components/status_quoted'; -import { - createAppSelector, - useAppDispatch, - useAppSelector, -} from '@/mastodon/store'; -import PushPinIcon from '@/material-icons/400-24px/push_pin.svg?react'; - -import { Carousel } from './carousel'; - -const pinnedStatusesSelector = createAppSelector( - [ - (state, accountId: string, tagged?: string) => - (state.timelines as ImmutableMap).getIn( - [`account:${accountId}:pinned${tagged ? `:${tagged}` : ''}`, 'items'], - ImmutableList(), - ) as ImmutableList, - ], - (items) => items.toArray().map((id) => ({ id })), -); - -const messages = defineMessages({ - previous: { id: 'lightbox.previous', defaultMessage: 'Previous' }, - next: { id: 'lightbox.next', defaultMessage: 'Next' }, - current: { - id: 'featured_carousel.current', - defaultMessage: 'Post {current, number} / {max, number}', - }, - slide: { - id: 'featured_carousel.slide', - defaultMessage: 'Post {current, number} of {max, number}', - }, -}); - -export const FeaturedCarousel: React.FC<{ - accountId: string; - tagged?: string; -}> = ({ accountId, tagged }) => { - const accessibilityId = useId(); - - // Load pinned statuses - const dispatch = useAppDispatch(); - useEffect(() => { - if (accountId) { - void dispatch(expandAccountFeaturedTimeline(accountId, { tagged })); - } - }, [accountId, dispatch, tagged]); - const pinnedStatuses = useAppSelector((state) => - pinnedStatusesSelector(state, accountId, tagged), - ); - - const renderSlide = useCallback( - ({ id }: { id: string }) => ( - - ), - [], - ); - - if (!accountId || pinnedStatuses.length === 0) { - return null; - } - - return ( - -

- - -

-
- ); -}; diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index 28a8f4b7116..252aabf865c 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -789,9 +789,6 @@ "explore.trending_links": "News", "explore.trending_statuses": "Posts", "explore.trending_tags": "Hashtags", - "featured_carousel.current": "Post {current, number} / {max, number}", - "featured_carousel.header": "{count, plural, one {Pinned Post} other {Pinned Posts}}", - "featured_carousel.slide": "Post {current, number} of {max, number}", "featured_tags.more_items": "+{count}", "featured_tags.suggestions": "Lately you’ve posted about {items}. Add these as featured hashtags?", "featured_tags.suggestions.add": "Add",