Skip to content
Open
20,181 changes: 10,735 additions & 9,446 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

22 changes: 17 additions & 5 deletions src/Content/Embed/EmbedVideo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ function ThumbnailWrapper({
onClick={() => setHideThumbnail(true)}
onError={() => setError(true)}
style={{
width: adjustedWidth,
height: adjustedHeight,
backgroundImage: `url(${error ? discordImageFailure : thumbnail})`,
width: "100%",
height: "auto",
maxWidth: adjustedWidth,
maxHeight: adjustedHeight,
}}
>
<Styles.Image src={error ? discordImageFailure : thumbnail} />
<Styles.VideoThumbnailPlayButtonContainer>
<Styles.VideoThumbnailPlayButton
width={12}
Expand All @@ -61,6 +63,11 @@ interface EmbedVideoProps
}

function EmbedVideo(props: EmbedVideoProps) {
const { width: adjustedWidth, height: adjustedHeight } = useSize(
props.width,
props.height
);

if (props.proxyUrl)
return (
<ThumbnailWrapper
Expand Down Expand Up @@ -94,8 +101,13 @@ function EmbedVideo(props: EmbedVideoProps) {
height={props.height}
>
<Styles.VideoIframe
width={400}
height={225}
width="100%"
height="100%"
style={{
maxWidth: adjustedWidth,
maxHeight: adjustedHeight,
aspectRatio:"16 / 9"
}}
src={url.toString()}
allowFullScreen={true}
/>
Expand Down
22 changes: 15 additions & 7 deletions src/Content/Embed/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,21 @@ function Embed({ embed, images }: EmbedProps) {
/>
)}
{images && images.length > 0 && (
<Styles.Images nImages={images.length as 1 | 2 | 3 | 4}>
{images.map((image) => (
<Styles.ImageGridImageContainer key={image.url}>
<EmbeddedImage embedImage={image} withMargin />
</Styles.ImageGridImageContainer>
))}
</Styles.Images>
// <Styles.Images nImages={images.length}>
// {images.map((image) => (
// <Styles.ImageGridImageContainer key={image.url}>
// <EmbeddedImage embedImage={image} withMargin />
// </Styles.ImageGridImageContainer>
// ))}
// </Styles.Images>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just remove it?

Copy link
Member

@mason-rogers mason-rogers Mar 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd personally opt for making a const like MAX_IMAGES, then we can use images.slice(0, MAX_IMAGES)

since we may want to allow showing 4 images at some point

<EmbeddedImage
embedImage={images[0]}
withMargin
image={images[0]}
width={images[0].width}
height={images[0].height}
type="EmbedImage"
/>
)}

{(embed.footer || embed.timestamp) && (
Expand Down
9 changes: 9 additions & 0 deletions src/Content/Embed/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ export const Embed = styled.withConfig({
},
},
},
"@media (max-width: 319px)": {
maxWidth: "45vw",
},
"@media (min-width: 320px) and (max-width: 413px)": {
maxWidth: "55vw",
},
"@media (min-width: 414px) and (max-width: 833px)": {
maxWidth: "65vw",
},
});

export const ContentAndThumbnail = styled.withConfig({
Expand Down
7 changes: 7 additions & 0 deletions src/Content/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export const ContentContainer = styled.withConfig({
color: theme.colors.primaryOpacity80,
fontWeight: 400,
lineHeight: "1.375rem",
wordBreak: "break-all",

variants: {
didFailToSend: {
Expand All @@ -85,6 +86,12 @@ export const ContentContainer = styled.withConfig({
},
},
},
"@media (max-width: 413px)": {
maxWidth: "160px",
},
"@media (min-width: 414px) and (max-width: 833px)": {
maxWidth: "290px",
},
});

export const ReplyAccessoryText = styled.withConfig({
Expand Down
1 change: 1 addition & 0 deletions src/Message/Components/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,6 @@ export const ActionRow = styled.withConfig({
})("div", {
display: "flex",
flexDirection: "row",
flexWrap: "wrap",
gap: theme.space.large,
});
6 changes: 6 additions & 0 deletions src/Message/style/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ export const Message = styled.withConfig({
},
},
},
"@media (max-width: 319px)": {
paddingRight: `0px`,
},
"@media (min-width: 320px) and (max-width: 833px)": {
paddingRight: `8px`,
},
}
);

Expand Down
2 changes: 1 addition & 1 deletion src/stories/Wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ const StorybookStyles = styled("div", {
[`--${prefix}-fonts-main`]:
'"gg sans","Noto Sans","Helvetica Neue",Helvetica,Arial,sans-serif',
fontFamily: theme.fonts.main,
padding: 40,
padding: "40px 0px",
});

// eslint-disable-next-line func-style
Expand Down