diff --git a/src/Content/Attachment/style.ts b/src/Content/Attachment/style.ts index ec54bb3..a47fd48 100644 --- a/src/Content/Attachment/style.ts +++ b/src/Content/Attachment/style.ts @@ -21,6 +21,9 @@ export const ImageAttachment = styled.withConfig({ }, }, }, + "@media (max-width: 413px)": { + maxWidth: "60vw", + }, }); export const LazyImagePlaceholder = styled.withConfig({ @@ -318,6 +321,7 @@ export const AttachmentContainer = styled.withConfig({ borderRadius: 3, width: "fit-content", flexWrap: "wrap", + position: "relative", variants: { withoutChildren: { @@ -351,6 +355,9 @@ export const AttachmentFileName = styled.withConfig({ "&:hover": { textDecoration: "underline", }, + "@media (max-width: 339px)": { + maxWidth: "35vw", + }, }); export const AttachmentFileSize = styled.withConfig({ @@ -373,6 +380,12 @@ export const DownloadIcon = styled.withConfig({ "&:hover": { opacity: 1, }, + "@media (max-width: 339px)": { + position: "absolute", + right: 2, + top: 10, + marginLeft: 0, + }, }); export const ExtraUserInterface = styled.withConfig({ @@ -382,6 +395,10 @@ export const ExtraUserInterface = styled.withConfig({ flexBasis: "100%", marginTop: theme.space.large, display: "flex", + "@media (max-width: 339px)": { + marginTop: "10px", + maxWidth: "55vw", + }, }); export const AttachmentAudioControls = styled.withConfig({ @@ -393,4 +410,7 @@ export const AttachmentAudioControls = styled.withConfig({ outline: "none", borderRadius: 3, maxWidth: "70vw", + "@media (max-width: 433px)": { + maxWidth: "60vw" + } }); diff --git a/src/Content/Embed/EmbedVideo.tsx b/src/Content/Embed/EmbedVideo.tsx index f75b74e..81a2b27 100644 --- a/src/Content/Embed/EmbedVideo.tsx +++ b/src/Content/Embed/EmbedVideo.tsx @@ -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, }} > + diff --git a/src/Content/Embed/index.tsx b/src/Content/Embed/index.tsx index 6ac4c9d..ed86582 100644 --- a/src/Content/Embed/index.tsx +++ b/src/Content/Embed/index.tsx @@ -14,6 +14,7 @@ import ExternalLink from "../../ExternalLink"; import { error } from "../../utils/error"; import useSize from "src/Content/Embed/useSize"; +// const MAX_IMAGES = 1; export interface EmbedProps { embed: APIEmbed; images: APIEmbedImage[] | undefined; @@ -148,13 +149,18 @@ function Embed({ embed, images }: EmbedProps) { /> )} {images && images.length > 0 && ( - - {images.map((image) => ( - - - - ))} - + // + // {images.slice(0, MAX_IMAGES).map((image) => ( + // + // + // + // ))} + // + )} {(embed.footer || embed.timestamp) && ( diff --git a/src/Content/Embed/style.ts b/src/Content/Embed/style.ts index 267b411..153f278 100644 --- a/src/Content/Embed/style.ts +++ b/src/Content/Embed/style.ts @@ -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({ diff --git a/src/Content/style.ts b/src/Content/style.ts index 843d3a3..6b570fb 100644 --- a/src/Content/style.ts +++ b/src/Content/style.ts @@ -60,6 +60,7 @@ export const ContentContainer = styled.withConfig({ color: theme.colors.primaryOpacity80, fontWeight: 400, lineHeight: "1.375rem", + wordBreak: "break-all", variants: { didFailToSend: { @@ -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({ diff --git a/src/Message/Components/style.ts b/src/Message/Components/style.ts index 3730ff6..4d73d7d 100644 --- a/src/Message/Components/style.ts +++ b/src/Message/Components/style.ts @@ -86,5 +86,6 @@ export const ActionRow = styled.withConfig({ })("div", { display: "flex", flexDirection: "row", + flexWrap: "wrap", gap: theme.space.large, }); diff --git a/src/Message/style/author.ts b/src/Message/style/author.ts index 892ab9b..0d41734 100644 --- a/src/Message/style/author.ts +++ b/src/Message/style/author.ts @@ -9,6 +9,7 @@ export const MessageAuthor = styled.withConfig({ componentId: commonComponentId, })("span", { display: "inline-flex", + wordBreak: "break-all", variants: { clickable: { @@ -19,6 +20,9 @@ export const MessageAuthor = styled.withConfig({ }, }, }, + "@media (max-width: 319px)": { + flexWrap: 'wrap' + }, }); export const Username = styled.withConfig({ @@ -30,7 +34,6 @@ export const Username = styled.withConfig({ fontSize: theme.fontSizes.l, display: "inline", verticalAlign: "baseline", - whiteSpace: "nowrap", lineHeight: `1.375rem`, variants: { @@ -64,7 +67,10 @@ export const Avatar = styled.withConfig({ transform: "translateX(-50%)", marginTop: "calc(4px - .125rem)", zIndex: 1, -}); + "@media (max-width: 319px)": { + left: `calc(${theme.sizes.messageLeftPadding} / 3)`, + } +},); export const StillAvatar = styled.withConfig({ displayName: "message-author-still-avatar", diff --git a/src/Message/style/message.ts b/src/Message/style/message.ts index 53ca466..de34c7f 100644 --- a/src/Message/style/message.ts +++ b/src/Message/style/message.ts @@ -83,6 +83,13 @@ export const Message = styled.withConfig({ }, }, }, + "@media (max-width: 319px)": { + paddingRight: `0px`, + paddingLeft: `calc(${theme.sizes.messageLeftPadding} - 15px)`, + }, + "@media (min-width: 320px) and (max-width: 833px)": { + paddingRight: `8px`, + }, } ); diff --git a/src/stories/Wrapper.tsx b/src/stories/Wrapper.tsx index f7fce22..7e0bcb3 100644 --- a/src/stories/Wrapper.tsx +++ b/src/stories/Wrapper.tsx @@ -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