feat: removed unneeded quote stylesheet and QuoteGenericFile

pull/2757/head
William Grant 2 years ago
parent 98e4474e75
commit 761a536b32

@ -1,200 +0,0 @@
// This is related to all quote logics
.module-quote {
position: relative;
cursor: pointer;
display: flex;
flex-direction: row;
align-items: stretch;
overflow: hidden;
border-left-width: 4px;
border-left-style: solid;
/* Primary */
&__primary {
flex-grow: 1;
padding-inline-start: 8px;
padding-inline-end: 8px;
max-width: 100%;
}
&__primary__profile-name {
font-style: italic;
}
&__primary__type-label {
font-style: italic;
font-size: var(--font-size-sm);
line-height: 18px;
color: var(--message-bubbles-received-text-color);
border-color: var(--message-bubbles-received-text-color);
}
&__primary__author {
font-size: var(--font-size-sm);
font-weight: bold;
line-height: 18px;
margin-bottom: 5px;
overflow-x: hidden;
white-space: nowrap;
text-overflow: ellipsis;
color: var(--message-bubbles-received-text-color);
.module-contact-name {
font-weight: bold;
}
}
&__primary__text {
font-size: 14px;
line-height: 18px;
text-align: start;
overflow-wrap: break-word;
word-wrap: break-word;
word-break: break-word;
white-space: pre-wrap;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
color: var(--message-bubbles-received-text-color);
a {
color: var(--message-bubbles-received-text-color);
}
}
&__primary__filename-label {
font-size: 12px;
}
/* Icons */
&__icon-container {
flex: initial;
min-width: 54px;
width: 54px;
max-height: 54px;
position: relative;
img {
width: 100%;
height: 100%;
object-fit: cover;
}
&__inner {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
}
&__circle-background {
display: flex;
align-items: center;
justify-content: center;
height: 32px;
width: 32px;
border-radius: 50%;
background-color: var(--chat-buttons-background-color);
&:hover {
background-color: var(--chat-buttons-background-hover-color);
}
}
&__icon {
width: 24px;
height: 24px;
&--file {
@include color-svg('../images/file.svg', var(--button-icon-stroke-color));
}
&--image {
@include color-svg('../images/image.svg', var(--button-icon-stroke-color));
}
&--microphone {
@include color-svg('../images/microphone.svg', var(--button-icon-stroke-color));
}
&--play {
@include color-svg('../images/play.svg', var(--chat-buttons-icon-color));
}
&--movie {
@include color-svg('../images/movie.svg', var(--button-icon-stroke-color));
}
}
}
/* Generic Files */
&__generic {
&-file {
display: flex;
flex-direction: row;
align-items: center;
}
&-file__icon {
background: url('../images/file-gradient.svg');
background-size: 75%;
background-repeat: no-repeat;
height: 28px;
width: 36px;
margin-inline-start: -4px;
margin-inline-end: -6px;
margin-bottom: 5px;
}
&-file__text {
font-size: 14px;
line-height: 18px;
color: var(--message-bubbles-received-text-color);
max-width: calc(100% - 26px);
overflow-x: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
/* Misc */
&--no-click {
cursor: auto;
}
}
/* Outgoing messages */
.module-quote--outgoing {
color: var(--message-bubbles-sent-text-color);
.module-quote {
&__primary__type-label {
color: var(--message-bubbles-sent-text-color);
border-color: var(--message-bubbles-sent-text-color);
}
&__primary__author {
color: var(--message-bubbles-sent-text-color);
}
&__primary__text {
color: var(--message-bubbles-sent-text-color);
a {
color: var(--message-bubbles-sent-text-color);
}
}
&__generic {
&-file__text {
color: var(--message-bubbles-sent-text-color);
}
}
}
}
.module-quote-container {
margin-bottom: var(--margins-xs);
margin-top: var(--margins-xs);
min-width: 300px; // if the quoted content is small it doesn't look very good so we set a minimum
padding-right: var(--margins-xs);
}

@ -27,7 +27,6 @@
// /////////////////// //
@import 'modules';
@import 'session';
@import 'quote';
@import 'rtl';
// Separate screens

@ -1,39 +0,0 @@
import React from 'react';
import classNames from 'classnames';
import { MIME } from '../../../../../types';
import { GoogleChrome } from '../../../../../util';
import { QuotePropsWithoutListener } from './Quote';
export const QuoteGenericFile = (
props: Pick<QuotePropsWithoutListener, 'attachment' | 'isIncoming'>
) => {
const { attachment, isIncoming } = props;
if (!attachment) {
return null;
}
const { fileName, contentType } = attachment;
const isGenericFile =
!GoogleChrome.isVideoTypeSupported(contentType) &&
!GoogleChrome.isImageTypeSupported(contentType) &&
!MIME.isAudio(contentType);
if (!isGenericFile) {
return null;
}
return (
<div className="module-quote__generic-file">
<div className="module-quote__generic-file__icon" />
<div
className={classNames(
'module-quote__generic-file__text',
isIncoming ? 'module-quote__generic-file__text--incoming' : null
)}
>
{fileName}
</div>
</div>
);
};
Loading…
Cancel
Save