Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixed the theme for chat reply feature #1409

Merged
merged 3 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -155,15 +155,15 @@ 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
{`${replyPayloadManager.payload.fromDID
?.split(':')[1]
.slice(-6)}`}
.slice(0, 6)}...${replyPayloadManager.payload.fromDID?.split(':')[1].slice(-6)}`}
abhishek-01k marked this conversation as resolved.
Show resolved Hide resolved
</Span>
</Span>
<CardRenderer
Expand All @@ -173,12 +173,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'};
`;
Loading