Skip to content

Commit

Permalink
animation username config
Browse files Browse the repository at this point in the history
  • Loading branch information
JasminDreasond committed Aug 15, 2023
1 parent e816cbe commit 1783a93
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/app/atoms/text/Text.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function Text({
if (variant === 'h1') return <h1 className={textClass} style={style}>{children}</h1>;
if (variant === 'h2') return <h2 className={textClass} style={style}>{children}</h2>;
if (variant === 's1') return <h4 className={textClass} style={style}>{children}</h4>;
return <p className={textClass} style={style}>{children}</p>;
return (children && <p className={textClass} style={style}>{children}</p>);
}

Text.defaultProps = {
Expand Down
20 changes: 14 additions & 6 deletions src/app/molecules/message/Message.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,20 @@ const MessageAvatar = React.memo(({
// Message Header
const MessageHeader = React.memo(({
userId, username,
}) => (
<span className='username-base emoji-size-fix' style={{ color: colorMXID(userId) }}>
<span className='username'>{twemojifyReact(username)}</span>
<span className='user-id'>{twemojifyReact(userId)}</span>
</span>
));
}) => {

const mx = initMatrix.matrixClient;
const appAppearance = mx.getAccountData('pony.house.appearance')?.getContent() ?? {};
const tinyUsername = twemojifyReact(username);

return (
<span className='username-base emoji-size-fix' style={{ color: colorMXID(userId) }}>
<span className='username'>{tinyUsername}</span>
<span className='user-id'>{!appAppearance.isUNhoverDisabled ? twemojifyReact(userId) : tinyUsername}</span>
</span>
);

});

MessageHeader.propTypes = {
userId: PropTypes.string.isRequired,
Expand Down

0 comments on commit 1783a93

Please sign in to comment.