From b506eb44eb40aeec9770fe6f6404b26a866ffafe Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Fri, 26 Mar 2021 13:27:26 +1000 Subject: [PATCH] chat: update links to match spec --- .../apps/chat/components/ChatMessage.tsx | 20 +----------------- .../src/views/components/RemoteContent.tsx | 21 ++++++++++++------- 2 files changed, 15 insertions(+), 26 deletions(-) diff --git a/pkg/interface/src/views/apps/chat/components/ChatMessage.tsx b/pkg/interface/src/views/apps/chat/components/ChatMessage.tsx index 16925e6db4..75fca57036 100644 --- a/pkg/interface/src/views/apps/chat/components/ChatMessage.tsx +++ b/pkg/interface/src/views/apps/chat/components/ChatMessage.tsx @@ -591,30 +591,12 @@ export const Message = ({ fontSize={1} lineHeight='20px' color='black' + width="fit-content" maxWidth="500px" > ); diff --git a/pkg/interface/src/views/components/RemoteContent.tsx b/pkg/interface/src/views/components/RemoteContent.tsx index f27ed91b2f..d3cb4fb6a9 100644 --- a/pkg/interface/src/views/components/RemoteContent.tsx +++ b/pkg/interface/src/views/components/RemoteContent.tsx @@ -123,20 +123,24 @@ return; }); } - wrapInLink(contents) { + wrapInLink(contents, textOnly = false) { const { style } = this.props; return ( - - + + { textOnly && ()} { e.stopPropagation(); }} href={this.props.url} flexShrink={0} whiteSpace="nowrap" overflow="hidden" textOverflow="ellipsis" - width="calc(100% - 24px)" + width={textOnly ? "calc(100%-24px)" : "fit-content"} style={{ color: 'inherit', textDecoration: 'none', ...style }} className="word-break-all" target="_blank" @@ -185,6 +189,9 @@ return; style={style} onLoad={onLoad} onError={this.onError} + height="100%" + width="100%" + objectFit="contain" {...imageProps} {...props} /> @@ -235,7 +242,7 @@ return; {renderUrl ? this.wrapInLink({(this.state.embed && this.state.embed.title) ? this.state.embed.title - : (text || url)}) + : (text || url)}, true) : null} {this.state.embed !== 'error' && this.state.embed?.html && !unfold ?