Skip to content

Commit

Permalink
Merge pull request #1409 from push-protocol/chat-reply-issue-fixed
Browse files Browse the repository at this point in the history
fix: fixed the theme for chat reply feature
  • Loading branch information
abhishek-01k authored Oct 24, 2024
2 parents 3312dbc + 050e2a1 commit 85233ee
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useEffect, useState } from 'react';

// External Packages
import { TwitterTweetEmbed } from 'react-twitter-embed';
import styled from 'styled-components';

// Internal Compoonents
import { IFrame } from '../../../../../types';
Expand All @@ -11,9 +12,8 @@ import { checkTwitterUrl } from '../../../helpers/twitter';

import { FrameRenderer } from './FrameRenderer';
import { VideoRenderer } from './VideoRenderer';

// Internal Configs

import { device } from '../../../../../config/globals';
// Assets

// Interfaces & Types
Expand Down Expand Up @@ -149,6 +149,31 @@ export const PreviewRenderer = ({
frameData={initialized.frameData}
/>
) : !initialized.loading && !initialized.error && initialized.url && initialized.urlType === 'twitter' ? (
<TwitterTweetEmbed tweetId={initialized.url} />
<TwitterEmbedWrapper>
<TwitterTweetEmbed tweetId={initialized.url} />
</TwitterEmbedWrapper>
) : null;
};

const TwitterEmbedWrapper = styled.div`
width: 100%;
max-width: 550px;
margin: 0 auto;
overflow: hidden;
padding: 0 10px;
> div {
max-width: 100% !important;
}
iframe {
max-width: 100% !important;
}
@media (max-width: ${device.mobileL}) {
max-width: 100%;
iframe {
width: 100% !important;
}
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { CardRenderer } from '../../CardRenderer';

// Interfaces & Types
import { IMessagePayload } from '../../../exportedTypes';
import { pCAIP10ToWallet, shortenText } from '../../../../../helpers';

// Constants

Expand Down Expand Up @@ -155,15 +156,13 @@ export const ReplyCard = ({
<Span
padding="8px 12px 0px"
fontSize="10px"
color={theme.textColor?.chatSentBubbleText}
color={position ? `${theme.textColor?.chatSentBubbleText}` : `${theme.textColor?.chatReceivedBubbleText}`}
>
<Span
fontWeight="500"
padding="0px"
>
{`${replyPayloadManager.payload.fromDID?.split(':')[1].slice(0, 6)}...${replyPayloadManager.payload.fromDID
?.split(':')[1]
.slice(-6)}`}
{shortenText(pCAIP10ToWallet(replyPayloadManager.payload.fromDID), 6, true)}
</Span>
</Span>
<CardRenderer
Expand All @@ -173,12 +172,11 @@ export const ReplyCard = ({
previewMode={true}
/>
</Section>

)}
</ReplySection>
);
};

const ReplySection = styled(Section) <ReplySectionProps>`
const ReplySection = styled(Section)<ReplySectionProps>`
border-left: 4px solid ${({ borderBG }) => borderBG || 'transparent'};
`;

0 comments on commit 85233ee

Please sign in to comment.