Merge commit 'aa575341c2da1e84d349ca0b42211b0da30a2254' into glitch-soc/merge-upstream
This commit is contained in:
commit
166514d252
45 files changed
+146
-55
No files matched your search
@@ -6,6 +6,7 @@ import { FormattedMessage, injectIntl } from 'react-intl';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import { openModal } from 'mastodon/actions/modal';
|
||||
import { FormattedDateWrapper } from 'mastodon/components/formatted_date';
|
||||
import InlineAccount from 'mastodon/components/inline_account';
|
||||
import { RelativeTimestamp } from 'mastodon/components/relative_timestamp';
|
||||
|
||||
@@ -60,12 +61,12 @@ class EditedTimestamp extends PureComponent {
|
||||
};
|
||||
|
||||
render () {
|
||||
const { timestamp, intl, statusId } = this.props;
|
||||
const { timestamp, statusId } = this.props;
|
||||
|
||||
return (
|
||||
<DropdownMenu statusId={statusId} renderItem={this.renderItem} scrollable renderHeader={this.renderHeader} onItemClick={this.handleItemClick}>
|
||||
<button className='dropdown-menu__text-button'>
|
||||
<FormattedMessage id='status.edited' defaultMessage='Edited {date}' values={{ date: <span className='animated-number'>{intl.formatDate(timestamp, { month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' })}</span> }} />
|
||||
<FormattedMessage id='status.edited' defaultMessage='Edited {date}' values={{ date: <FormattedDateWrapper className='animated-number' value={timestamp} month='short' day='2-digit' hour='2-digit' minute='2-digit' /> }} />
|
||||
</button>
|
||||
</DropdownMenu>
|
||||
);
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import type { ComponentProps } from 'react';
|
||||
|
||||
import { FormattedDate } from 'react-intl';
|
||||
|
||||
export const FormattedDateWrapper = (
|
||||
props: ComponentProps<typeof FormattedDate> & { className?: string },
|
||||
) => (
|
||||
<FormattedDate {...props}>
|
||||
{(date) => (
|
||||
<time dateTime={tryIsoString(props.value)} className={props.className}>
|
||||
{date}
|
||||
</time>
|
||||
)}
|
||||
</FormattedDate>
|
||||
);
|
||||
|
||||
const tryIsoString = (date?: string | number | Date): string => {
|
||||
if (!date) {
|
||||
return '';
|
||||
}
|
||||
try {
|
||||
return new Date(date).toISOString();
|
||||
} catch {
|
||||
return date.toString();
|
||||
}
|
||||
};
|
||||
@@ -37,6 +37,7 @@ import {
|
||||
FollowingCounter,
|
||||
StatusesCounter,
|
||||
} from 'mastodon/components/counters';
|
||||
import { FormattedDateWrapper } from 'mastodon/components/formatted_date';
|
||||
import { Icon } from 'mastodon/components/icon';
|
||||
import { IconButton } from 'mastodon/components/icon_button';
|
||||
import { LoadingIndicator } from 'mastodon/components/loading_indicator';
|
||||
@@ -938,11 +939,12 @@ export const AccountHeader: React.FC<{
|
||||
/>
|
||||
</dt>
|
||||
<dd>
|
||||
{intl.formatDate(account.created_at, {
|
||||
year: 'numeric',
|
||||
month: 'short',
|
||||
day: '2-digit',
|
||||
})}
|
||||
<FormattedDateWrapper
|
||||
value={account.created_at}
|
||||
year='numeric'
|
||||
month='short'
|
||||
day='2-digit'
|
||||
/>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
|
||||
import {
|
||||
FormattedMessage,
|
||||
FormattedDate,
|
||||
useIntl,
|
||||
defineMessages,
|
||||
} from 'react-intl';
|
||||
import { FormattedMessage, useIntl, defineMessages } from 'react-intl';
|
||||
|
||||
import { Helmet } from 'react-helmet';
|
||||
|
||||
import { apiGetPrivacyPolicy } from 'mastodon/api/instance';
|
||||
import type { ApiPrivacyPolicyJSON } from 'mastodon/api_types/instance';
|
||||
import { Column } from 'mastodon/components/column';
|
||||
import { FormattedDateWrapper } from 'mastodon/components/formatted_date';
|
||||
import { Skeleton } from 'mastodon/components/skeleton';
|
||||
|
||||
const messages = defineMessages({
|
||||
@@ -58,7 +54,7 @@ const PrivacyPolicy: React.FC<{
|
||||
date: loading ? (
|
||||
<Skeleton width='10ch' />
|
||||
) : (
|
||||
<FormattedDate
|
||||
<FormattedDateWrapper
|
||||
value={response?.updated_at}
|
||||
year='numeric'
|
||||
month='short'
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import type { CSSProperties } from 'react';
|
||||
import { useState, useRef, useCallback } from 'react';
|
||||
|
||||
import { FormattedDate, FormattedMessage } from 'react-intl';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
|
||||
import classNames from 'classnames';
|
||||
import { Link } from 'react-router-dom';
|
||||
@@ -16,6 +16,7 @@ import { AnimatedNumber } from 'mastodon/components/animated_number';
|
||||
import { ContentWarning } from 'mastodon/components/content_warning';
|
||||
import EditedTimestamp from 'mastodon/components/edited_timestamp';
|
||||
import { FilterWarning } from 'mastodon/components/filter_warning';
|
||||
import { FormattedDateWrapper } from 'mastodon/components/formatted_date';
|
||||
import type { StatusLike } from 'mastodon/components/hashtag_bar';
|
||||
import { getHashtagBarForStatus } from 'mastodon/components/hashtag_bar';
|
||||
import { Icon } from 'mastodon/components/icon';
|
||||
@@ -388,7 +389,7 @@ export const DetailedStatus: React.FC<{
|
||||
target='_blank'
|
||||
rel='noopener noreferrer'
|
||||
>
|
||||
<FormattedDate
|
||||
<FormattedDateWrapper
|
||||
value={new Date(status.get('created_at') as string)}
|
||||
year='numeric'
|
||||
month='short'
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
"block_modal.show_less": "Afficher moins",
|
||||
"block_modal.show_more": "Afficher plus",
|
||||
"block_modal.they_cant_mention": "Il ne peut pas vous mentionner ou vous suivre.",
|
||||
"block_modal.they_cant_see_posts": "Il peut toujours voir vos messages, mais vous ne verrez pas les siens.",
|
||||
"block_modal.they_cant_see_posts": "Il ne peut plus voir vos messages et vous ne verrez plus les siens.",
|
||||
"block_modal.they_will_know": "Il peut voir qu'il est bloqué.",
|
||||
"block_modal.title": "Bloquer le compte ?",
|
||||
"block_modal.you_wont_see_mentions": "Vous ne verrez pas les messages qui le mentionne.",
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
"block_modal.show_less": "Afficher moins",
|
||||
"block_modal.show_more": "Afficher plus",
|
||||
"block_modal.they_cant_mention": "Il ne peut pas vous mentionner ou vous suivre.",
|
||||
"block_modal.they_cant_see_posts": "Il peut toujours voir vos messages, mais vous ne verrez pas les siens.",
|
||||
"block_modal.they_cant_see_posts": "Il ne peut plus voir vos messages et vous ne verrez plus les siens.",
|
||||
"block_modal.they_will_know": "Il peut voir qu'il est bloqué.",
|
||||
"block_modal.title": "Bloquer le compte ?",
|
||||
"block_modal.you_wont_see_mentions": "Vous ne verrez pas les messages qui le mentionne.",
|
||||
|
||||
@@ -874,6 +874,7 @@
|
||||
"tabs_bar.notifications": "알림",
|
||||
"terms_of_service.effective_as_of": "{date}부터 적용됨",
|
||||
"terms_of_service.title": "이용 약관",
|
||||
"terms_of_service.upcoming_changes_on": "{date}에 예정된 변경사항",
|
||||
"time_remaining.days": "{number} 일 남음",
|
||||
"time_remaining.hours": "{number} 시간 남음",
|
||||
"time_remaining.minutes": "{number} 분 남음",
|
||||
|
||||
Reference in new issue
Block a user