From e3a0d158909baf87503348b800f50de5d75a6785 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Thu, 19 Dec 2019 10:04:40 +1100 Subject: [PATCH] add showcompose on showcompose click --- _locales/en/messages.json | 15 +++++ stylesheets/_session.scss | 2 +- .../_session_theme_dark_left_pane.scss | 51 +++++++++++++++++ .../session/LeftPaneMessageSection.tsx | 57 +++++++++++++++++-- 4 files changed, 118 insertions(+), 7 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index dc0cb3b3e..dd6e4e4c9 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -2393,5 +2393,20 @@ }, "searchForAKeyPhrase": { "message": "Search for a key phrase or contact" + }, + "enterRecipient": { + "message": "Enter Recipient" + }, + "enterSessionID": { + "message": "Enter Session ID" + }, + "pasteSessionIDRecipient": { + "message": "Paste Session ID of recipient" + }, + "usersCanShareTheir...": { + "message": "Users can share their Session ID by going into their account settings and clicking \"Share Public Key\"." + }, + "searchByIDOrDisplayName": { + "message": "Search by ID # or DIsplay Name" } } diff --git a/stylesheets/_session.scss b/stylesheets/_session.scss index 28c132073..07f911419 100644 --- a/stylesheets/_session.scss +++ b/stylesheets/_session.scss @@ -110,7 +110,7 @@ div.spacer-lg { width: 100%; } @mixin session-dark-background-gradient { - background: linear-gradient(90deg, #121212, #171717) !important; + background: linear-gradient(90deg, #121212 100%, #171717 0%) !important; } $session-transition-duration: 0.25s; diff --git a/stylesheets/_session_theme_dark_left_pane.scss b/stylesheets/_session_theme_dark_left_pane.scss index 8fb428f70..c55ebe192 100644 --- a/stylesheets/_session_theme_dark_left_pane.scss +++ b/stylesheets/_session_theme_dark_left_pane.scss @@ -109,6 +109,57 @@ font-size: 25px; flex-grow: 1; } + + &__list { + height: -webkit-fill-available; + } + + &-compose{ + @include session-dark-background-gradient; + height: -webkit-fill-available; + .session-icon .exit { + padding: 13px; + } + + h3, + h2 { + color: $session-color-white; + font-size: 22px; + font-weight: bold; + text-align: center; + } + + h3 { + font-size: 18px; + padding-top: 22px; + } + + &-border-container { + position: relative; + margin-bottom: 50px; + } + + .white { + position: absolute; + color: none; + height: 1px; + width: -webkit-fill-available; + opacity: 0.3; + } + + .green { + position: absolute; + color: $session-color-green; + background-color: $session-color-green; + height: 6px; + width: 130px; + left: 50%; + margin-left: -65px; + top: 50%; + margin-top:6px; + } + } + } .session-search-input { diff --git a/ts/components/session/LeftPaneMessageSection.tsx b/ts/components/session/LeftPaneMessageSection.tsx index 9fa342ab8..c5d3440ef 100644 --- a/ts/components/session/LeftPaneMessageSection.tsx +++ b/ts/components/session/LeftPaneMessageSection.tsx @@ -58,6 +58,8 @@ export class LeftPaneMessageSection extends React.Component { }; this.updateSearchBound = this.updateSearch.bind(this); + this.handleComposeClick = this.handleComposeClick.bind(this); + this.handleOnPasteSessionID = this.handleOnPasteSessionID.bind(this); this.debouncedSearch = debounce(this.search.bind(this), 20); } @@ -168,7 +170,7 @@ export class LeftPaneMessageSection extends React.Component {
{window.i18n('messagesHeader')}
- + ); } @@ -178,16 +180,49 @@ export class LeftPaneMessageSection extends React.Component {
{this.renderHeader()} - - {this.renderList()} + {this.state.showComposeView ? this.renderCompose() : this.renderConversations()}
); } + public renderCompose() : JSX.Element { + + return ( +
+ +

+ {window.i18n('enterRecipient')} +

+

+ {window.i18n('enterSessionID')} +

+
+
+
+
+ +
+ ); + } + + public renderConversations() { + + return ( +
+ + {this.renderList()} +
+ ); + } + public updateSearch(searchTerm: string) { const { updateSearchTerm, clearSearch } = this.props; @@ -233,4 +268,14 @@ export class LeftPaneMessageSection extends React.Component { }); } } + + private handleComposeClick() { + this.setState((state: any) => { + return { showComposeView: !state.showComposeView }; + }); + } + + private handleOnPasteSessionID() { + console.log('handleOnPasteSessionID'); + } }