From cd2b416694e79408dbcf4b8430f4165eccbf7356 Mon Sep 17 00:00:00 2001 From: Jannis Mattheis Date: Fri, 8 Aug 2025 14:34:32 +0200 Subject: [PATCH] fix: less whitespace in message & add app name --- ui/src/common/DefaultPage.tsx | 2 +- ui/src/layout/Layout.tsx | 3 +- ui/src/message/Message.tsx | 180 +++++++++++++++++++++++++--------- 3 files changed, 134 insertions(+), 51 deletions(-) diff --git a/ui/src/common/DefaultPage.tsx b/ui/src/common/DefaultPage.tsx index e7fa1b0..40550e3 100644 --- a/ui/src/common/DefaultPage.tsx +++ b/ui/src/common/DefaultPage.tsx @@ -17,7 +17,7 @@ const DefaultPage: FC> = ({
- + {title} {rightControl} diff --git a/ui/src/layout/Layout.tsx b/ui/src/layout/Layout.tsx index a658a24..75f6cc1 100644 --- a/ui/src/layout/Layout.tsx +++ b/ui/src/layout/Layout.tsx @@ -24,10 +24,11 @@ const useStyles = makeStyles()((theme: Theme) => ({ content: { margin: '0 auto', marginTop: 64, - padding: theme.spacing(4), + padding: theme.spacing(3), width: '100%', [theme.breakpoints.down('sm')]: { marginTop: 0, + padding: theme.spacing(1), }, }, })); diff --git a/ui/src/message/Message.tsx b/ui/src/message/Message.tsx index a9db7e3..02a55fc 100644 --- a/ui/src/message/Message.tsx +++ b/ui/src/message/Message.tsx @@ -18,8 +18,11 @@ const PREVIEW_LENGTH = 500; const useStyles = makeStyles()((theme: Theme) => ({ header: { display: 'flex', - flexWrap: 'wrap', - marginBottom: 0, + width: '100%', + alignItems: 'start', + alignContent: 'center', + paddingBottom: 5, + wordBreak: 'break-all', }, headerTitle: { flex: 1, @@ -29,17 +32,21 @@ const useStyles = makeStyles()((theme: Theme) => ({ marginRight: -15, }, wrapperPadding: { - marginBottom: 12, + marginBottom: theme.spacing(2), + [theme.breakpoints.down('sm')]: { + marginBottom: theme.spacing(1), + }, }, messageContentWrapper: { minWidth: 200, width: '100%', }, image: { - marginRight: 15, + width: 50, + height: 50, [theme.breakpoints.down('md')]: { - width: 32, - height: 32, + width: 30, + height: 30, }, }, date: { @@ -50,7 +57,9 @@ const useStyles = makeStyles()((theme: Theme) => ({ }, }, imageWrapper: { - display: 'flex', + marginRight: 15, + width: 50, + height: 50, }, plainContent: { whiteSpace: 'pre-wrap', @@ -64,6 +73,7 @@ const useStyles = makeStyles()((theme: Theme) => ({ }, '& p': { margin: 0, + wordBreak: 'break-word', }, '& a': { color: '#ff7f50', @@ -121,7 +131,7 @@ const Message = ({ const {classes} = useStyles(); const [expanded, setExpanded] = React.useState(initialExpanded); const [isOverflowing, setOverflowing] = React.useState(false); - const dateWrapped = useMediaQuery(theme.breakpoints.down('md')); + const smallHeader = useMediaQuery(theme.breakpoints.down('md')); React.useEffect(() => { setOverflowing(!!previewRef && previewRef.scrollHeight > previewRef.clientHeight); @@ -150,48 +160,33 @@ const Message = ({ borderLeftWidth: 6, borderLeftStyle: 'solid', }}> -
-
- {image !== null ? ( - {`${appName} - ) : null} -
-
-
- - {title} - - - - - - - -
+ {smallHeader ? ( + + ) : ( + + )} - - {renderContent()} - -
+
+ + {renderContent()} +
{isOverflowing && (