small UI fixes for caption editor

pull/1381/head
Audric Ackermann 4 years ago
parent 82b59f808d
commit 60a4fcbfcc
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -2158,12 +2158,10 @@
// Module: Caption Editor // Module: Caption Editor
.module-caption-editor { .module-caption-editor {
@include themify($themes) { background-color: rgba(0, 0, 0, 0.8);
background-color: themed('inboxBackground');
}
z-index: 20; z-index: 20;
position: absolute; position: fixed;
left: 0; left: 0;
right: 0; right: 0;
top: 0; top: 0;
@ -2172,6 +2170,10 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%; height: 100%;
.session-button {
margin-inline-start: 15px;
}
} }
.module-caption-editor__close-button { .module-caption-editor__close-button {
@ -2184,9 +2186,8 @@
width: 30px; width: 30px;
height: 30px; height: 30px;
z-index: 2; z-index: 2;
@include themify($themes) { // the background of the lightbox is dark
@include color-svg('../images/x-16.svg', themed('textColor')); @include color-svg('../images/x-16.svg', white);
}
} }
.module-caption-editor__media-container { .module-caption-editor__media-container {
@ -2240,15 +2241,21 @@
.module-caption-editor__input-container { .module-caption-editor__input-container {
display: flex; display: flex;
.session-input-with-label-container { input::placeholder {
@include themify($themes) { color: white;
color: themed('textColor');
background-color: themed('inputBackground');
} }
.session-input-with-label-container {
color: black;
background-color: $inputBackgroundColor;
width: 30vw;
border-radius: 100px; border-radius: 100px;
@include themify($themes) { #session-input-floating-label {
padding: $session-margin-sm; padding: $session-margin-sm;
} }
label.session-input-with-label-container.filled { label.session-input-with-label-container.filled {
visibility: hidden; visibility: hidden;
} }
@ -2264,12 +2271,6 @@
} }
} }
.module-caption-editor {
.session-button {
margin-inline-start: 15px;
}
}
.module-caption-editor__caption-input { .module-caption-editor__caption-input {
height: 36px; height: 36px;
font-size: 14px; font-size: 14px;

@ -746,22 +746,6 @@
background-color: $color-gray-05; background-color: $color-gray-05;
} }
// Module: Caption Editor
.module-caption-editor {
background-color: $color-black;
}
.module-caption-editor__close-button {
@include color-svg('../images/x-16.svg', $color-white);
}
.module-caption-editor__media-container {
background-color: $color-black;
}
// Module: Search Results
.module-search-results__conversations-header { .module-search-results__conversations-header {
color: $color-gray-05; color: $color-gray-05;
} }

@ -8,6 +8,7 @@ $accentDarkTheme: #00f782;
$borderLightTheme: #f1f1f1; // search for references on ts TODO: make this exposed on ts $borderLightTheme: #f1f1f1; // search for references on ts TODO: make this exposed on ts
$borderDarkTheme: rgba($white, 0.06); $borderDarkTheme: rgba($white, 0.06);
$inputBackgroundColor: #8e8e93;
$borderAvatarColor: unquote( $borderAvatarColor: unquote(
'#00000059' '#00000059'
@ -22,7 +23,7 @@ $themes: (
modalBackground: #fcfcfc, modalBackground: #fcfcfc,
fakeChatBubbleBackground: #f5f5f5, fakeChatBubbleBackground: #f5f5f5,
// input // input
inputBackground: rgba(#8e8e93, 0.12), inputBackground: rgba($inputBackgroundColor, 0.12),
// text // text
textColor: $black, textColor: $black,
textColorSubtle: #a0a0a0, textColorSubtle: #a0a0a0,
@ -72,7 +73,7 @@ $themes: (
modalBackground: #101011, modalBackground: #101011,
fakeChatBubbleBackground: #212121, fakeChatBubbleBackground: #212121,
// input // input
inputBackground: rgba(#8e8e93, 0.12), inputBackground: rgba($inputBackgroundColor, 0.12),
// text // text
textColor: $white, textColor: $white,
textColorSubtle: #a0a0a0, textColorSubtle: #a0a0a0,

@ -53,7 +53,7 @@ export class CaptionEditor extends React.Component<Props, State> {
} }
public renderObject() { public renderObject() {
const { url, attachment } = this.props; const { url, onClose, attachment } = this.props;
const { contentType } = attachment || { contentType: null }; const { contentType } = attachment || { contentType: null };
const isImageTypeSupported = GoogleChrome.isImageTypeSupported(contentType); const isImageTypeSupported = GoogleChrome.isImageTypeSupported(contentType);
@ -63,6 +63,7 @@ export class CaptionEditor extends React.Component<Props, State> {
className="module-caption-editor__image" className="module-caption-editor__image"
alt={window.i18n('imageAttachmentAlt')} alt={window.i18n('imageAttachmentAlt')}
src={url} src={url}
onClick={onClose}
/> />
); );
} }
@ -106,14 +107,13 @@ export class CaptionEditor extends React.Component<Props, State> {
onEnterPressed={this.onSave} onEnterPressed={this.onSave}
value={caption} value={caption}
/> />
{caption ? (
<SessionButton <SessionButton
text={window.i18n('save')} text={window.i18n('save')}
onClick={this.onSave} onClick={this.onSave}
buttonType={SessionButtonType.Brand} buttonType={SessionButtonType.Brand}
buttonColor={SessionButtonColor.Green} buttonColor={SessionButtonColor.Green}
disabled={!caption}
/> />
) : null}
</div> </div>
</div> </div>
</div> </div>

@ -28,10 +28,9 @@ import * as MIME from '../../../types/MIME';
import { SessionFileDropzone } from './SessionFileDropzone'; import { SessionFileDropzone } from './SessionFileDropzone';
import { ConversationType } from '../../../state/ducks/conversations'; import { ConversationType } from '../../../state/ducks/conversations';
import { MessageView } from '../../MainViewController'; import { MessageView } from '../../MainViewController';
import { getMessageById, removeMessage } from '../../../../js/modules/data'; import { getMessageById } from '../../../../js/modules/data';
import { pushUnblockToSend } from '../../../session/utils/Toast'; import { pushUnblockToSend } from '../../../session/utils/Toast';
import { MessageDetail } from '../../conversation/MessageDetail'; import { MessageDetail } from '../../conversation/MessageDetail';
import { Toast } from 'react-toastify/dist/components';
interface State { interface State {
// Message sending progress // Message sending progress
@ -652,7 +651,10 @@ export class SessionConversation extends React.Component<Props, State> {
this.updateSendingProgress(100, -1); this.updateSendingProgress(100, -1);
} }
public async deleteMessagesById(messageIds: Array<string>, askUserForConfirmation: boolean) { public async deleteMessagesById(
messageIds: Array<string>,
askUserForConfirmation: boolean
) {
// Get message objects // Get message objects
const { conversationKey, messages } = this.props; const { conversationKey, messages } = this.props;
@ -660,9 +662,7 @@ export class SessionConversation extends React.Component<Props, State> {
conversationKey conversationKey
); );
const selectedMessages = messages.filter(message => const selectedMessages = messages.filter(message =>
messageIds.find( messageIds.find(selectedMessage => selectedMessage === message.id)
selectedMessage => selectedMessage === message.id
)
); );
const multiple = selectedMessages.length > 1; const multiple = selectedMessages.length > 1;

@ -244,5 +244,10 @@ export function pushYouLeftTheGroup() {
} }
export function pushDeleted() { export function pushDeleted() {
pushToastSuccess('deleted', window.i18n('deleted'), undefined, SessionIconType.Check); pushToastSuccess(
'deleted',
window.i18n('deleted'),
undefined,
SessionIconType.Check
);
} }

Loading…
Cancel
Save