Merge pull request #1989 from Bilb/disable-settings-video-feature-off

make sure click to trust sender renders without new lines
This commit is contained in:
Audric Ackermann 2021-10-27 15:05:15 +11:00 committed by GitHub
commit 151d4884f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 5 deletions

View File

@ -8,7 +8,7 @@ import { SessionIcon } from '../../session/icon';
import { SessionButtonColor } from '../../session/SessionButton';
const StyledTrustSenderUI = styled.div`
padding: 'var(--margins-md)';
padding-inline: var(--margins-xs);
display: flex;
align-items: center;
`;
@ -16,6 +16,7 @@ const StyledTrustSenderUI = styled.div`
const ClickToDownload = styled.div`
cursor: pointer;
padding: var(--margins-xs) var(--margins-md);
white-space: nowrap;
`;
export const ClickToTrustSender = (props: { messageId: string }) => {

View File

@ -15,7 +15,7 @@ import { MessageStatus } from './MessageStatus';
export type MessageContentWithStatusSelectorProps = Pick<
MessageRenderingProps,
'direction' | 'isDeleted'
'direction' | 'isDeleted' | 'isTrustedForAttachmentDownload'
> & { hasAttachments: boolean };
type Props = {
@ -48,7 +48,7 @@ export const MessageContentWithStatuses = (props: Props) => {
if (!contentProps) {
return null;
}
const { direction, isDeleted, hasAttachments } = contentProps;
const { direction, isDeleted, hasAttachments, isTrustedForAttachmentDownload } = contentProps;
const isIncoming = direction === 'incoming';
return (
@ -56,7 +56,7 @@ export const MessageContentWithStatuses = (props: Props) => {
className={classNames('module-message', `module-message--${direction}`)}
role="button"
onClick={onClickOnMessageOuterContainer}
style={{ width: hasAttachments ? 'min-content' : 'auto' }}
style={{ width: hasAttachments && isTrustedForAttachmentDownload ? 'min-content' : 'auto' }}
>
<MessageStatus messageId={messageId} isCorrectSide={isIncoming} />
<div>

View File

@ -1023,12 +1023,18 @@ export const getMessageContentWithStatusesSelectorProps = createSelector(
return undefined;
}
const { direction, isDeleted, attachments } = props.propsForMessage;
const {
direction,
isDeleted,
attachments,
isTrustedForAttachmentDownload,
} = props.propsForMessage;
const msgProps: MessageContentWithStatusSelectorProps = {
direction,
isDeleted,
hasAttachments: Boolean(attachments?.length) || false,
isTrustedForAttachmentDownload,
};
return msgProps;