Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Standardised Quoted Message Behaviour #2399

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: changed sass to styled for QuoteAuthor
  • Loading branch information
yougotwill committed Jul 21, 2022
commit 4dad75c2b51f6bc0bf6b8697e6ba36426dd988a2
36 changes: 0 additions & 36 deletions stylesheets/_quote.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,6 @@
}
}

// This is related to the quote logic inside messages
.module-quote {
&--outgoing {
.module-quote__primary__author {
color: var(--color-sent-message-text);
font-weight: bold;

.module-contact-name {
font-weight: bold;
}
}
}

&--incoming {
.module-quote__primary__author {
color: var(--color-received-message-text);
font-weight: bold;
.module-contact-name {
font-weight: bold;
}
}
}
}

.module-quote__icon-container__icon--file {
@include color-svg('../images/file.svg', $color-loki-green);
}
Expand Down Expand Up @@ -89,18 +65,6 @@
max-width: 100%;
}

.module-quote__primary__author {
font-size: 13px;
line-height: 18px;
font-weight: 300;
color: $color-gray-90;
margin-bottom: 5px;

overflow-x: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}

.module-quote__primary__profile-name {
font-style: italic;
}
Expand Down
26 changes: 19 additions & 7 deletions ts/components/conversation/message/message-content/Quote.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,23 @@ import { MessageBody } from './MessageBody';
import { useIsPrivate } from '../../../../hooks/useParamSelector';
import styled from 'styled-components';

const StyledQuoteAuthor = styled.div<{ isIncoming: boolean }>`
color: ${props =>
props.isIncoming ? `var(--color-received-message-text)` : `var(--color-sent-message-text)`};
font-size: 13px;
font-weight: bold;
line-height: 18px;
margin-bottom: 5px;

overflow-x: hidden;
white-space: nowrap;
text-overflow: ellipsis;

.module-contact-name {
font-weight: bold;
}
`;

const StyledQuoteText = styled.div<{ isIncoming: boolean }>`
display: -webkit-box;
-webkit-box-orient: vertical;
Expand Down Expand Up @@ -295,12 +312,7 @@ const QuoteAuthor = (props: QuoteAuthorProps) => {
const { authorProfileName, author, authorName, isFromMe, isIncoming } = props;

return (
<div
className={classNames(
'module-quote__primary__author',
isIncoming ? 'module-quote__primary__author--incoming' : null
)}
>
<StyledQuoteAuthor isIncoming={isIncoming}>
{isFromMe ? (
window.i18n('you')
) : (
Expand All @@ -312,7 +324,7 @@ const QuoteAuthor = (props: QuoteAuthorProps) => {
shouldShowPubkey={Boolean(props.showPubkeyForAuthor)}
/>
)}
</div>
</StyledQuoteAuthor>
);
};

Expand Down
2 changes: 1 addition & 1 deletion ts/receiver/queuedJob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { PubKey } from '../session/types';
import _ from 'lodash';
import { getConversationController } from '../session/conversations';
import { ConversationModel, ConversationTypeEnum } from '../models/conversation';
import { MessageModel, sliceQuoteText } from '../models/message';
import { MessageModel } from '../models/message';
import { getMessageCountByType, getMessagesBySentAt } from '../../ts/data/data';

import { SignalService } from '../protobuf';
Expand Down