From b8b271404034ec2351b17c1a4ca7b7321c1d5ff7 Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Wed, 22 Sep 2021 16:02:30 +0700 Subject: [PATCH] added random description generator --- src/components/node/NodeAuthorBlock/index.tsx | 8 +++++++- src/constants/phrases.ts | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/components/node/NodeAuthorBlock/index.tsx b/src/components/node/NodeAuthorBlock/index.tsx index c04205ba..4d89ae58 100644 --- a/src/components/node/NodeAuthorBlock/index.tsx +++ b/src/components/node/NodeAuthorBlock/index.tsx @@ -3,6 +3,7 @@ import { INode } from '~/redux/types'; import styles from './styles.module.scss'; import { CommentAvatar } from '~/components/comment/CommentAvatar'; import { openUserProfile } from '~/utils/user'; +import { useRandomPhrase } from '~/constants/phrases'; interface Props { node?: INode; @@ -23,7 +24,12 @@ const NodeAuthorBlock: FC = ({ node }) => {
{fullname || username}
- {description &&
{description}
} + + {description && ( +
+ {description || useRandomPhrase('USER_DESCRIPTION')} +
+ )}
); diff --git a/src/constants/phrases.ts b/src/constants/phrases.ts index 46e6c068..19935b43 100644 --- a/src/constants/phrases.ts +++ b/src/constants/phrases.ts @@ -37,6 +37,25 @@ export const PHRASES = { 'Хм... Где все?', 'Тут будут наши с тобой сообщения', ], + USER_DESCRIPTION: [ + 'Плазменный носорог', + 'Пси-оператор 3 разряда', + 'Потайной Егор', + 'Капитан Малярия', + 'Апельсиновый рассвет', + 'Лаборант-потрошитель', + 'Ежедневный именинник', + 'Луковый номер восемь', + 'Антрацит-гедонист', + 'Девиатор из полупространства', + 'Сверхзвуковая штуковина', + 'Лелембока', + 'Суицидальный собутыльник', + 'Чикичомбабунда', + 'Голос рассказчика', + 'Сентябрьская свежесть', + 'Кибернетическая личность', + ], }; export const useRandomPhrase = (key: keyof typeof PHRASES) =>