diff --git a/js/views/inbox_view.js b/js/views/inbox_view.js
index 980a6c17d..757b6db18 100644
--- a/js/views/inbox_view.js
+++ b/js/views/inbox_view.js
@@ -7,8 +7,7 @@
i18n,
Whisper,
textsecure,
- Signal,
- clipboard
+ Signal
*/
// eslint-disable-next-line func-names
@@ -87,13 +86,6 @@
this.render();
this.$el.attr('tabindex', '1');
- this.mainHeaderView = new Whisper.MainHeaderView({
- el: this.$('.main-header-placeholder'),
- items: this.getMainHeaderItems(),
- });
- this.onPasswordUpdated();
- this.on('password-updated', () => this.onPasswordUpdated());
-
this.conversation_stack = new Whisper.ConversationStack({
el: this.$('.conversation-stack'),
model: { window: options.window },
@@ -145,7 +137,6 @@
conversation => conversation.cachedProps
);
- // FIXME: Add our contacts here as well? getContactCollection
const initialState = {
conversations: {
conversationLookup: Signal.Util.makeLookup(conversations, 'id'),
@@ -338,57 +329,6 @@
onClick(e) {
this.closeRecording(e);
},
- getMainHeaderItems() {
- return [
- this._mainHeaderItem('copyPublicKey', () => {
- const ourNumber = textsecure.storage.user.getNumber();
- clipboard.writeText(ourNumber);
-
- this.showToastMessageInGutter(i18n('copiedPublicKey'));
- }),
- this._mainHeaderItem('editDisplayName', () => {
- window.Whisper.events.trigger('onEditProfile');
- }),
- this._mainHeaderItem('showSeed', () => {
- window.Whisper.events.trigger('showSeedDialog');
- }),
- ];
- },
- async onPasswordUpdated() {
- const hasPassword = await Signal.Data.getPasswordHash();
- const items = this.getMainHeaderItems();
-
- const showPasswordDialog = (type, resolve) =>
- Whisper.events.trigger('showPasswordDialog', {
- type,
- resolve,
- });
-
- const passwordItem = (textKey, type) =>
- this._mainHeaderItem(textKey, () =>
- showPasswordDialog(type, () => {
- this.showToastMessageInGutter(i18n(`${textKey}Success`));
- })
- );
-
- if (hasPassword) {
- items.push(
- passwordItem('changePassword', 'change'),
- passwordItem('removePassword', 'remove')
- );
- } else {
- items.push(passwordItem('setPassword', 'set'));
- }
-
- this.mainHeaderView.updateItems(items);
- },
- _mainHeaderItem(textKey, onClick) {
- return {
- id: textKey,
- text: i18n(textKey),
- onClick,
- };
- },
showToastMessageInGutter(message) {
const toast = new Whisper.MessageToastView({
message,
diff --git a/package.json b/package.json
index bd6c5d27d..4dc3398c0 100644
--- a/package.json
+++ b/package.json
@@ -78,9 +78,9 @@
"intl-tel-input": "12.1.15",
"jquery": "3.3.1",
"js-sha512": "0.8.0",
+ "js-yaml": "3.13.0",
"jsbn": "1.1.0",
"libsodium-wrappers": "^0.7.4",
- "js-yaml": "3.13.0",
"linkify-it": "2.0.3",
"lodash": "4.17.11",
"mkdirp": "0.5.1",
@@ -96,6 +96,7 @@
"react": "16.8.3",
"react-contextmenu": "2.11.0",
"react-dom": "16.8.3",
+ "react-portal": "^4.2.0",
"react-redux": "6.0.1",
"react-virtualized": "9.21.0",
"read-last-lines": "1.3.0",
@@ -132,6 +133,7 @@
"@types/qs": "6.5.1",
"@types/react": "16.8.5",
"@types/react-dom": "16.8.2",
+ "@types/react-portal": "^4.0.2",
"@types/react-redux": "7.0.1",
"@types/react-virtualized": "9.18.12",
"@types/redux-logger": "3.0.7",
diff --git a/stylesheets/_conversation.scss b/stylesheets/_conversation.scss
index 2f1fee424..8495b38f5 100644
--- a/stylesheets/_conversation.scss
+++ b/stylesheets/_conversation.scss
@@ -316,10 +316,7 @@
bottom: 62px;
text-align: center;
- padding-left: 16px;
- padding-right: 16px;
- padding-top: 8px;
- padding-bottom: 8px;
+ padding: 8px 16px;
border-radius: 4px;
z-index: 100;
diff --git a/stylesheets/_index.scss b/stylesheets/_index.scss
index 6a09e840d..a0bf73772 100644
--- a/stylesheets/_index.scss
+++ b/stylesheets/_index.scss
@@ -1,3 +1,7 @@
+.conversation-stack {
+ position: relative;
+}
+
.conversation-stack,
.new-conversation,
.inbox,
@@ -183,10 +187,12 @@ h4.section-toggle,
}
.left-pane-placeholder {
- height: 100%;
+ flex-grow: 1;
+ display: flex;
}
+
.left-pane-wrapper {
- height: 100%;
+ flex: 1;
}
.conversation-stack {
diff --git a/stylesheets/_modules.scss b/stylesheets/_modules.scss
index e9075dd81..aa3050134 100644
--- a/stylesheets/_modules.scss
+++ b/stylesheets/_modules.scss
@@ -5,7 +5,6 @@
display: flex;
flex-direction: column;
align-items: flex-start;
- margin-right: 8px;
overflow-x: hidden;
}
@@ -17,7 +16,7 @@
user-select: none;
}
-.module-contact-name__profile-number {
+.module-contact-name__profile-number.italic {
font-style: italic;
}
@@ -1852,10 +1851,6 @@
.module-avatar {
background-color: $color-dark-85;
}
-
- .module-contact-name {
- margin-right: 0px;
- }
}
.module-conversation-list-item--has-unread {
@@ -2199,7 +2194,16 @@
// Module: Main Header
-.main-header-title-wrapper {
+.module-main-header {
+ display: flex;
+ flex-direction: column;
+ border-bottom: 1px solid $color-dark-90;
+ color: $color-dark-05;
+}
+
+.module-main-header__title {
+ height: 55px;
+ padding-left: 16px;
flex: 1;
flex-direction: row;
display: flex;
@@ -2211,10 +2215,20 @@
}
}
-.main-header-content-wrapper {
+.module-main-header__menu {
color: $color-dark-05;
+ overflow: hidden;
+
+ .accordian {
+ margin-top: -100%;
+ transition: margin-top 0.35s ease-out;
+
+ &.expanded {
+ margin-top: 0;
+ }
+ }
- div {
+ .menu-item {
padding: 12px;
background-color: $color-dark-90;
user-select: none;
@@ -2226,25 +2240,7 @@
}
}
-.main-header-wrapper {
- overflow-x: hidden;
- flex: 1;
-}
-
-.module-main-header {
- height: $header-height;
- width: 300px;
-
- padding-left: 16px;
-
- display: flex;
- flex-direction: row;
- align-items: center;
-
- border-bottom: 1px solid $color-gray-15;
-}
-
-.main-header-content-toggle {
+.module-main-header-content-toggle {
width: 3em;
line-height: 3em;
font-weight: bold;
@@ -2265,7 +2261,7 @@
}
}
-.main-header-content-toggle-visible::after {
+.module-main-header-content-toggle-visible::after {
transform: rotate(180deg);
}
@@ -2278,39 +2274,50 @@
}
.module-main-header__search {
- margin-left: 12px;
+ margin: 8px;
position: relative;
}
-.module-main-header__search__input {
- height: 28px;
- width: 228px;
+.module-main-header__search__icon {
+ background-color: $color-light-35;
+}
- border-radius: 14px;
- border: solid 1px $color-gray-15;
+.module-main-header__search__input {
+ color: $color-dark-05;
+ background-color: $color-gray-95;
+ border: 1px solid $color-light-60;
+ padding: 0 26px 0 30px;
+ margin-left: 8px;
+ margin-right: 8px;
+ outline: 0;
+ height: 32px;
+ width: calc(100% - 16px);
+ outline-offset: -2px;
+ font-size: 14px;
+ line-height: 18px;
+ font-weight: normal;
- padding-left: 30px;
- padding-right: 30px;
+ position: relative;
+ border-radius: 4px;
- color: $color-gray-90;
- font-size: 14px;
+ &:focus {
+ outline: solid 1px $blue;
+ }
&::placeholder {
color: $color-gray-45;
}
-
- &:focus {
- border: solid 1px blue;
- outline: none;
- }
}
.module-main-header__search__icon {
+ content: '';
+ display: inline-block;
+ width: 18px;
+ height: 26px;
+ background-color: $color-light-35;
position: absolute;
- left: 8px;
- top: 6px;
- height: 16px;
- width: 16px;
+ left: 14px;
+ top: 3px;
cursor: text;
@include color-svg('../images/search.svg', $color-gray-60);
@@ -2318,8 +2325,8 @@
.module-main-header__search__cancel-icon {
position: absolute;
- right: 8px;
- top: 7px;
+ right: 16px;
+ top: 9px;
height: 14px;
width: 14px;
cursor: pointer;
@@ -3157,7 +3164,6 @@
// Module: Left Pane
.module-left-pane {
- background-color: $color-dark-85;
border-right: 1px solid $color-dark-90;
display: inline-flex;
@@ -3172,6 +3178,28 @@
flex-grow: 0;
}
+.module-left-pane__tabs {
+ color: $color-dark-05;
+ background-color: $color-dark-75;
+ display: flex;
+ flex-direction: row;
+
+ .tab {
+ width: 50%;
+ padding: 16px;
+ text-align: center;
+ cursor: pointer;
+
+ &:hover {
+ background-color: $color-dark-72;
+ }
+ }
+
+ .tab.selected {
+ background-color: #383c46;
+ }
+}
+
.module-left-pane__archive-header {
height: 48px;
width: 100%;
@@ -3249,24 +3277,43 @@
display: flex;
flex-direction: row;
align-items: center;
-
- padding: 8px 16px;
-
cursor: pointer;
+ padding: 8px 16px;
+ opacity: 0.7;
- &:hover {
- background-color: $color-gray-05;
+ &.valid {
+ opacity: 1;
}
}
+.module-start-new-conversation__avatar {
+ display: inline-block;
+ height: 48px;
+ width: 48px;
+ border-radius: 50%;
+ background-size: cover;
+ vertical-align: middle;
+ text-align: center;
+ line-height: 48px;
+ overflow-x: hidden;
+ text-overflow: ellipsis;
+ color: #ffffff;
+ font-size: 18px;
+ background-color: #616161;
+}
+
.module-start-new-conversation__content {
overflow: hidden;
margin-left: 12px;
+ flex: 1;
}
.module-start-new-conversation__number {
- overflow-x: hidden;
+ margin: 0;
+ font-size: 1em;
text-overflow: ellipsis;
+ overflow-x: hidden;
+ text-align: left;
font-weight: 300;
}
diff --git a/test/app/fixtures/menu-mac-os-setup.json b/test/app/fixtures/menu-mac-os-setup.json
index 324178c72..18936a5b1 100644
--- a/test/app/fixtures/menu-mac-os-setup.json
+++ b/test/app/fixtures/menu-mac-os-setup.json
@@ -1,6 +1,6 @@
[
{
- "label": "Signal Desktop",
+ "label": "Loki Messenger",
"submenu": [
{
"label": "About Loki Messenger",
diff --git a/test/app/fixtures/menu-mac-os.json b/test/app/fixtures/menu-mac-os.json
index c7d2a1587..d00db642d 100644
--- a/test/app/fixtures/menu-mac-os.json
+++ b/test/app/fixtures/menu-mac-os.json
@@ -1,6 +1,6 @@
[
{
- "label": "Signal Desktop",
+ "label": "Loki Messenger",
"submenu": [
{
"label": "About Loki Messenger",
diff --git a/test/modules/types/contact_test.js b/test/modules/types/contact_test.js
index e9732be10..c835f38d9 100644
--- a/test/modules/types/contact_test.js
+++ b/test/modules/types/contact_test.js
@@ -42,6 +42,7 @@ describe('Contact', () => {
assert.deepEqual(result, message.contact[0]);
});
+ // LOKI: Phone number stays the same
it('turns phone numbers to e164 format', async () => {
const upgradeAttachment = sinon
.stub()
@@ -71,7 +72,7 @@ describe('Contact', () => {
number: [
{
type: 1,
- value: '+12025550099',
+ value: '(202) 555-0099',
},
],
};
diff --git a/ts/components/ConversationListItem.tsx b/ts/components/ConversationListItem.tsx
index 65c7d60f0..c158a5372 100644
--- a/ts/components/ConversationListItem.tsx
+++ b/ts/components/ConversationListItem.tsx
@@ -1,5 +1,8 @@
import React from 'react';
import classNames from 'classnames';
+import { isEmpty } from 'lodash';
+import { ContextMenu, ContextMenuTrigger, MenuItem } from 'react-contextmenu';
+import { Portal } from 'react-portal';
import { Avatar } from './Avatar';
import { MessageBody } from './conversation/MessageBody';
@@ -8,7 +11,6 @@ import { ContactName } from './conversation/ContactName';
import { TypingAnimation } from './conversation/TypingAnimation';
import { Colors, LocalizerType } from '../types/Util';
-import { ContextMenu, ContextMenuTrigger, MenuItem } from 'react-contextmenu';
export type PropsData = {
id: string;
@@ -34,6 +36,7 @@ export type PropsData = {
isBlocked?: boolean;
isOnline?: boolean;
hasNickname?: boolean;
+ isFriendItem?: boolean;
};
type PropsHousekeeping = {
@@ -109,6 +112,7 @@ export class ConversationListItem extends React.PureComponent
{
name,
phoneNumber,
profileName,
+ isFriendItem,
} = this.props;
return (
@@ -132,21 +136,23 @@ export class ConversationListItem extends React.PureComponent {
/>
)}
0
- ? 'module-conversation-list-item__header__date--has-unread'
- : null
- )}
- >
-
-
0
+ ? 'module-conversation-list-item__header__date--has-unread'
+ : null
+ )}
+ >
+
+