diff --git a/app/soapbox/features/feed-suggestions/feed-suggestions.tsx b/app/soapbox/features/feed-suggestions/feed-suggestions.tsx index a1add25ee..a5740abf9 100644 --- a/app/soapbox/features/feed-suggestions/feed-suggestions.tsx +++ b/app/soapbox/features/feed-suggestions/feed-suggestions.tsx @@ -1,4 +1,5 @@ import React from 'react'; +import { defineMessages, useIntl } from 'react-intl'; import { Link } from 'react-router-dom'; import VerificationBadge from 'soapbox/components/verification_badge'; @@ -9,6 +10,11 @@ import ActionButton from '../ui/components/action-button'; import type { Account } from 'soapbox/types/entities'; +const messages = defineMessages({ + heading: { id: 'feedSuggestions.heading', defaultMessage: 'Suggested profiles' }, + viewAll: { id: 'feedSuggestions.viewAll', defaultMessage: 'View all' }, +}); + const SuggestionItem = ({ accountId }: { accountId: string }) => { const account = useAccount(accountId) as Account; @@ -52,18 +58,19 @@ const SuggestionItem = ({ accountId }: { accountId: string }) => { }; const FeedSuggestions = () => { + const intl = useIntl(); const suggestedProfiles = useAppSelector((state) => state.suggestions.items); return ( - + - View all + {intl.formatMessage(messages.viewAll)} diff --git a/app/soapbox/features/follow-recommendations/index.tsx b/app/soapbox/features/follow-recommendations/index.tsx index 7ad9c7ad3..235142aa4 100644 --- a/app/soapbox/features/follow-recommendations/index.tsx +++ b/app/soapbox/features/follow-recommendations/index.tsx @@ -1,6 +1,6 @@ import debounce from 'lodash/debounce'; import React, { useEffect } from 'react'; -import { FormattedMessage } from 'react-intl'; +import { defineMessages, FormattedMessage, useIntl } from 'react-intl'; import { fetchSuggestions } from 'soapbox/actions/suggestions'; import ScrollableList from 'soapbox/components/scrollable_list'; @@ -9,8 +9,13 @@ import AccountContainer from 'soapbox/containers/account_container'; import Column from 'soapbox/features/ui/components/column'; import { useAppDispatch, useAppSelector, useFeatures } from 'soapbox/hooks'; +const messages = defineMessages({ + heading: { id: 'followRecommendations.heading', defaultMessage: 'Suggested profiles' }, +}); + const FollowRecommendations: React.FC = () => { const dispatch = useAppDispatch(); + const intl = useIntl(); const features = useFeatures(); const suggestions = useAppSelector((state) => state.suggestions.items); @@ -31,7 +36,7 @@ const FollowRecommendations: React.FC = () => { if (suggestions.size === 0 && !isLoading) { return ( - + @@ -40,7 +45,7 @@ const FollowRecommendations: React.FC = () => { } return ( - +