From 04d9f47aec1f0e9cd3dedeab3004fcff70ef98af Mon Sep 17 00:00:00 2001 From: Igor Lobanov Date: Wed, 7 Dec 2022 21:11:32 +0100 Subject: [PATCH] author name hotfix --- src/components/Author/Card.tsx | 15 ++++++++++++--- src/components/Feed/Card.tsx | 7 +++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/components/Author/Card.tsx b/src/components/Author/Card.tsx index 95fa35d7..4b2cbecf 100644 --- a/src/components/Author/Card.tsx +++ b/src/components/Author/Card.tsx @@ -55,9 +55,18 @@ export const AuthorCard = (props: AuthorCardProps) => { const canFollow = createMemo(() => !props.hideFollow && session()?.user?.slug !== props.author.slug) - const name = () => { - return props.author.name === 'Дискурс' && locale() !== 'ru' ? 'Discours' : translit(props.author.name) - } + const name = createMemo(() => { + if (locale() !== 'ru') { + if (props.author.name === 'Дискурс') { + return 'Discours' + } + + return translit(props.author.name) + } + + return props.author.name + }) + // TODO: reimplement AuthorCard return (
{
{(author, index) => { - const name = - author.name === 'Дискурс' && locale() !== 'ru' ? 'Discours' : translit(author.name) + let name = author.name + + if (locale() !== 'ru') { + name = name === 'Дискурс' ? 'Discours' : translit(name) + } return ( <>