diff --git a/src/components/ContributorAvatars/ContributorAvatars.tsx b/src/components/ContributorAvatars/ContributorAvatars.tsx index ad0618f7..0cb15b63 100644 --- a/src/components/ContributorAvatars/ContributorAvatars.tsx +++ b/src/components/ContributorAvatars/ContributorAvatars.tsx @@ -30,9 +30,8 @@ const ContributorAvatars: React.FC = (props) => { return null; } - if (contributors.length === 1) { - const oneAvatar = getOneAvatar(contributors[0], isAuthor, onlyAuthor); - return oneAvatar; + if (isAuthor && contributors.length === 1) { + return getOneAvatar(contributors[0], isAuthor, onlyAuthor); } const displayedContributors = [...contributors]; diff --git a/src/components/DocPage/DocPage.scss b/src/components/DocPage/DocPage.scss index 036c016b..328d7524 100644 --- a/src/components/DocPage/DocPage.scss +++ b/src/components/DocPage/DocPage.scss @@ -235,7 +235,7 @@ } &__separator { - margin: 0 5px 32px 0; + margin: 0 20px 32px 0; align-self: center; } diff --git a/src/components/DocPage/DocPage.tsx b/src/components/DocPage/DocPage.tsx index b2615fc3..553bc28e 100644 --- a/src/components/DocPage/DocPage.tsx +++ b/src/components/DocPage/DocPage.tsx @@ -383,16 +383,16 @@ class DocPage extends React.Component { return null; } - const updatedAt = this.renderUpdatedAt(meta?.updatedAt); const author = this.renderAuthor(!meta?.contributors?.length); const contributors = this.renderContributors(); + const updatedAt = this.renderUpdatedAt(meta?.updatedAt); return (
- {[updatedAt, author, contributors].filter(Boolean).map((element, idx, arr) => ( + {[author, contributors, updatedAt].filter(Boolean).map((element, idx, arr) => ( {element} - {arr.length - 1 !== idx &&
{','}
} + {arr.length - 1 !== idx &&
} ))}
diff --git a/src/components/UpdatedAtDate/UpdatedAtDate.tsx b/src/components/UpdatedAtDate/UpdatedAtDate.tsx index 682cb956..1ee4a5a1 100644 --- a/src/components/UpdatedAtDate/UpdatedAtDate.tsx +++ b/src/components/UpdatedAtDate/UpdatedAtDate.tsx @@ -19,7 +19,7 @@ const UpdatedAtDate: React.FC = ({updatedAt}) => { const updatedAtFormatted = useMemo(() => { const {localeCode} = getConfig(); - return format(updatedAt, 'longDateTime', localeCode); + return format(updatedAt, 'longDate', localeCode); }, [updatedAt]); return ( diff --git a/src/i18n/en.json b/src/i18n/en.json index 92244c5a..35bcbcb1 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -57,7 +57,7 @@ "title": "Written by" }, "contributors": { - "title": "improved by" + "title": "Improved by" }, "feedback": { "like-text": "Helpful", diff --git a/src/i18n/ru.json b/src/i18n/ru.json index fefa9d35..f69c93dd 100644 --- a/src/i18n/ru.json +++ b/src/i18n/ru.json @@ -57,7 +57,7 @@ "title": "Статья создана" }, "contributors": { - "title": "улучшена" + "title": "Улучшена" }, "feedback": { "like-text": "Статья полезна", diff --git a/src/utils/date.ts b/src/utils/date.ts index 3b4a29a2..b295b5dd 100644 --- a/src/utils/date.ts +++ b/src/utils/date.ts @@ -73,9 +73,5 @@ export const format = ( formatCode: keyof DateTimeFormatter, localeCode = defaultRegion, ) => { - let result = getDateTimeFormatter(localeCode)[formatCode].format(new Date(date)); - if (formatCode === 'longDate' && ['ru-RU', 'ru-KZ'].includes(localeCode)) { - result = result.replace(/\sг\.$/, ''); - } - return result; + return getDateTimeFormatter(localeCode)[formatCode].format(new Date(date)); };