Skip to content

Commit

Permalink
Merge pull request #1990 from oxen-io/clearnet
Browse files Browse the repository at this point in the history
Do not break "Click to download media" txt
  • Loading branch information
Bilb authored Oct 27, 2021
2 parents 58f33db + 151d488 commit edccc8b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion ts/components/conversation/message/ClickToTrustSender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ 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;
`;

const ClickToDownload = styled.div`
cursor: pointer;
padding: var(--margins-xs) var(--margins-md);
white-space: nowrap;
`;

export const ClickToTrustSender = (props: { messageId: string }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { MessageStatus } from './MessageStatus';

export type MessageContentWithStatusSelectorProps = Pick<
MessageRenderingProps,
'direction' | 'isDeleted'
'direction' | 'isDeleted' | 'isTrustedForAttachmentDownload'
> & { hasAttachments: boolean };

type Props = {
Expand Down Expand Up @@ -48,15 +48,15 @@ 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 (
<div
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>
Expand Down
8 changes: 7 additions & 1 deletion ts/state/selectors/conversations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit edccc8b

Please sign in to comment.