mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
fixed random phrase outputting
This commit is contained in:
parent
b8b2714040
commit
d7b86202eb
1 changed files with 7 additions and 7 deletions
|
@ -10,14 +10,18 @@ interface Props {
|
|||
}
|
||||
|
||||
const NodeAuthorBlock: FC<Props> = ({ node }) => {
|
||||
const randomPhrase = useRandomPhrase('USER_DESCRIPTION');
|
||||
|
||||
const onOpenProfile = useCallback(() => openUserProfile(node?.user?.username), [
|
||||
node?.user?.username,
|
||||
]);
|
||||
|
||||
if (!node?.user) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const { fullname, username, description, photo } = node.user;
|
||||
|
||||
const onOpenProfile = useCallback(() => openUserProfile(username), [username]);
|
||||
|
||||
return (
|
||||
<div className={styles.block} onClick={onOpenProfile}>
|
||||
<CommentAvatar username={username} url={photo?.url} className={styles.avatar} />
|
||||
|
@ -25,11 +29,7 @@ const NodeAuthorBlock: FC<Props> = ({ node }) => {
|
|||
<div className={styles.info}>
|
||||
<div className={styles.username}>{fullname || username}</div>
|
||||
|
||||
{description && (
|
||||
<div className={styles.description}>
|
||||
{description || useRandomPhrase('USER_DESCRIPTION')}
|
||||
</div>
|
||||
)}
|
||||
<div className={styles.description}>{description || randomPhrase}</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue