Skip to content

Commit be6af5b

Browse files
author
bibakroy
committed
Enhance video embedding and responsive styles for better layout on various screen sizes
1 parent 8aba1fb commit be6af5b

File tree

6 files changed

+30
-9
lines changed

6 files changed

+30
-9
lines changed

src/Content/Embed/EmbedVideo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ function EmbedVideo(props: EmbedVideoProps) {
104104
width="100%"
105105
height="100%"
106106
style={{
107-
height: adjustedHeight,
108107
maxWidth: adjustedWidth,
109108
maxHeight: adjustedHeight,
109+
aspectRatio:"16 / 9"
110110
}}
111111
src={url.toString()}
112112
allowFullScreen={true}

src/Content/Embed/index.tsx

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,21 @@ function Embed({ embed, images }: EmbedProps) {
148148
/>
149149
)}
150150
{images && images.length > 0 && (
151-
<Styles.Images nImages={images.length as 1 | 2 | 3 | 4}>
152-
{images.map((image) => (
153-
<Styles.ImageGridImageContainer key={image.url}>
154-
<EmbeddedImage embedImage={image} withMargin />
155-
</Styles.ImageGridImageContainer>
156-
))}
157-
</Styles.Images>
151+
// <Styles.Images nImages={images.length}>
152+
// {images.map((image) => (
153+
// <Styles.ImageGridImageContainer key={image.url}>
154+
// <EmbeddedImage embedImage={image} withMargin />
155+
// </Styles.ImageGridImageContainer>
156+
// ))}
157+
// </Styles.Images>
158+
<EmbeddedImage
159+
embedImage={images[0]}
160+
withMargin
161+
image={images[0]}
162+
width={images[0].width}
163+
height={images[0].height}
164+
type="EmbedImage"
165+
/>
158166
)}
159167

160168
{(embed.footer || embed.timestamp) && (

src/Content/Embed/style.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ export const Embed = styled.withConfig({
2828
},
2929
},
3030
},
31+
"@media (max-width: 413px)": {
32+
maxWidth: "170px",
33+
},
34+
"@media (min-width: 414px) and (max-width: 833px)": {
35+
maxWidth: "260px",
36+
},
3137
});
3238

3339
export const ContentAndThumbnail = styled.withConfig({

src/Content/style.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export const ContentContainer = styled.withConfig({
6060
color: theme.colors.primaryOpacity80,
6161
fontWeight: 400,
6262
lineHeight: "1.375rem",
63+
wordBreak: "break-all",
6364

6465
variants: {
6566
didFailToSend: {
@@ -87,7 +88,9 @@ export const ContentContainer = styled.withConfig({
8788
},
8889
"@media (max-width: 413px)": {
8990
maxWidth: "160px",
90-
wordBreak: "break-all"
91+
},
92+
"@media (min-width: 414px) and (max-width: 833px)": {
93+
maxWidth: "290px",
9194
},
9295
});
9396

src/Message/Components/style.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,6 @@ export const ActionRow = styled.withConfig({
8686
})("div", {
8787
display: "flex",
8888
flexDirection: "row",
89+
flexWrap: "wrap",
8990
gap: theme.space.large,
9091
});

src/Message/style/message.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ export const Message = styled.withConfig({
8383
},
8484
},
8585
},
86+
"@media (max-width: 833px)": {
87+
padding: `2px 10px 2px ${theme.sizes.messageLeftPadding}`,
88+
},
8689
}
8790
);
8891

0 commit comments

Comments
 (0)