diff --git a/src/views/all/all.tsx b/src/views/all/all.tsx index de56957d..4a0ecf70 100644 --- a/src/views/all/all.tsx +++ b/src/views/all/all.tsx @@ -13,8 +13,6 @@ import useTimeFilter, { TimeFilterKey } from '../../hooks/use-time-filter'; const lastVirtuosoStates: { [key: string]: StateSnapshot } = {}; -const NoPosts = () => 'no posts'; - const All = () => { const subplebbitAddresses = useDefaultSubplebbitAddresses(); const params = useParams<{ sortType?: string; timeFilterName?: string }>(); @@ -46,13 +44,19 @@ const All = () => { document.title = `p/all - seedit`; }, [t]); - let Footer; - if (feed?.length === 0) { - Footer = NoPosts; - } - if (hasMore || subplebbitAddresses.length === 0) { - Footer = () => loadingString; - } + const Footer = () => { + let footerContent; + + if (feed.length === 0) { + footerContent = t('no_posts'); + } + + if (hasMore || subplebbitAddresses.length === 0) { + footerContent = loadingString; + } + + return
{footerContent}
; + }; const virtuosoRef = useRef(null); diff --git a/src/views/home/home.tsx b/src/views/home/home.tsx index 58e346d0..777d2454 100644 --- a/src/views/home/home.tsx +++ b/src/views/home/home.tsx @@ -63,7 +63,7 @@ const Home = () => { let footerContent; if (feed.length === 0) { - footerContent = 'no posts'; + footerContent = t('no_posts'); } if (hasMore || (subplebbitAddresses && subplebbitAddresses.length === 0)) { diff --git a/src/views/subplebbit/subplebbit.tsx b/src/views/subplebbit/subplebbit.tsx index cdc99ebd..042177ce 100644 --- a/src/views/subplebbit/subplebbit.tsx +++ b/src/views/subplebbit/subplebbit.tsx @@ -35,7 +35,7 @@ const Subplebbit = () => { let footerContent; if (feed.length === 0) { - footerContent = 'no posts'; + footerContent = t('no_posts'); } if (hasMore || subplebbitAddresses.length === 0) {