EmbeddedChat icon indicating copy to clipboard operation
EmbeddedChat copied to clipboard

Created a new branch to resolve conflicts and fixed the issue of appe…

Open devanshkansagra opened this issue 1 year ago • 1 comments

Brief Title

Fixed the issue of appearence of pinned messages when pinning it with emojis

My code changes

PinnedAttachment.js

import MessageEmoji from '../MessageEmoji/MessageEmoji'
import RCContext from '../../context/RCInstance';
import { Avatar } from '../Avatar';


const PinnedAttachment = ({ attachment }) => {
  const { RCInstance } = useContext(RCContext);
  const getUserAvatarUrl = (username) => {
    const host = RCInstance.getHost();
    const URL = `${host}/avatar/${username}`;
    return URL;
  };
  return (
    <Box
      style={{
        borderInlineStart: '1px solid currentColor',
      }}
    >
      <Box style={{paddingLeft: '0.8rem', paddingTop: '0.3rem'}}>
        <Avatar
          url={getUserAvatarUrl(attachment?.author_name)}
          alt="avatar"
          size={attachment?.text.t ? '1.2em' : '1.5em'}
        />&nbsp;&nbsp;<>{attachment?.author_name}</>
      </Box><br/>
      <Box style={{paddingLeft: '1rem', paddingBottom: '0.7rem'}}>{attachment?.text ? (
        <MessageEmoji body={attachment?.text} />
      ) : (
        attachment?.txt
      )}</Box>
    </Box>
  )
}

Fixes #374

Video/Screenshots

The issue

image

After Fixing: image

devanshkansagra avatar Feb 06 '24 04:02 devanshkansagra

Hello maintainers, Can you please review my Pull Request so that I can follow up. Thank you

devanshkansagra avatar Feb 08 '24 16:02 devanshkansagra