diff --git a/src/components/status.jsx b/src/components/status.jsx index eebdfb1..d3389bf 100644 --- a/src/components/status.jsx +++ b/src/components/status.jsx @@ -85,6 +85,8 @@ const isIOS = window.ontouchstart !== undefined && /iPad|iPhone|iPod/.test(navigator.userAgent); +const rtf = new Intl.RelativeTimeFormat(); + const REACTIONS_LIMIT = 80; function getPollText(poll) { @@ -508,6 +510,13 @@ function Status({ (attachment) => !attachment.description?.trim?.(), ); }, [mediaAttachments]); + + const statusMonthsAgo = useMemo(() => { + return Math.floor( + (new Date() - createdAtDate) / (1000 * 60 * 60 * 24 * 30), + ); + }, [createdAtDate]); + const boostStatus = async () => { if (!sameInstance || !authenticated) { alert(unauthInteractionErrorMessage); @@ -767,12 +776,22 @@ function Status({ } menuFooter={ - mediaNoDesc && - !reblogged && ( + mediaNoDesc && !reblogged ? ( + ) : ( + statusMonthsAgo >= 3 && ( + + ) ) } disabled={!canBoost}