diff --git a/js/background.js b/js/background.js index ba1ce12d1..91d35bd38 100644 --- a/js/background.js +++ b/js/background.js @@ -820,7 +820,6 @@ confirmDialog.render(); }; - window.showQRDialog = window.owsDesktopApp.appView.showQRDialog; window.showSeedDialog = window.owsDesktopApp.appView.showSeedDialog; window.showPasswordDialog = window.owsDesktopApp.appView.showPasswordDialog; diff --git a/stylesheets/_session.scss b/stylesheets/_session.scss index 18a4339d9..49ff5a8d8 100644 --- a/stylesheets/_session.scss +++ b/stylesheets/_session.scss @@ -219,6 +219,10 @@ $session_message-container-border-radius: 5px; margin-right: 5px; } +.message-wrapper { + font-family: 'SF Pro Text'; +} + .session-button { @mixin transparent-background($textAndBorderColor) { background-color: Transparent; @@ -870,7 +874,7 @@ label { height: 68.45px; } } - + .avatar-center-inner { position: relative; @@ -891,8 +895,8 @@ label { padding-top: 3px; background-color: $session-color-white; transition: $session-transition-duration; - - &:hover{ + + &:hover { filter: brightness(90%); } @@ -900,7 +904,7 @@ label { opacity: 1; } } - } + } .image-upload-section { display: flex; @@ -912,15 +916,15 @@ label { height: 80px; border-radius: 100%; background-color: rgba($session-color-black, 0.72); - box-shadow: 0px 0px 3px 0.5px rgba(0,0,0,0.75); + box-shadow: 0px 0px 3px 0.5px rgba(0, 0, 0, 0.75); opacity: 0; transition: $session-transition-duration; - &:after{ - content: "Edit"; + &:after { + content: 'Edit'; } - &:hover{ + &:hover { opacity: 1; } } @@ -939,22 +943,30 @@ label { } .session-id-section { + display: flex; + flex-direction: column; + justify-content: center; + .panel-text-divider { margin-top: 35px; margin-bottom: 35px; } - &-display{ + &-display { text-align: center; word-break: break-all; font-size: $session-font-md; padding: 0px $session-margin-lg; - font-family: "SF Pro Text"; + font-family: 'SF Pro Text'; font-weight: 100; - color: rgba($session-color-white, 0.80); + color: rgba($session-color-white, 0.8); font-size: $session-font-md; padding: 0px $session-margin-sm; } + + .session-button { + width: 148px; + } } .profile-name { @@ -970,7 +982,7 @@ label { font-size: $session-font-md; background-color: $session-shade-5 !important; } - + &-uneditable { display: flex; align-items: center; @@ -981,7 +993,6 @@ label { font-size: $session-font-md; padding: 0px $session-margin-sm; } - } } } diff --git a/ts/components/EditProfileDialog.tsx b/ts/components/EditProfileDialog.tsx index 0afdf6607..e213bc2bd 100644 --- a/ts/components/EditProfileDialog.tsx +++ b/ts/components/EditProfileDialog.tsx @@ -3,7 +3,11 @@ import { QRCode } from 'react-qr-svg'; import { Avatar } from './Avatar'; -import { SessionButton, SessionButtonColor, SessionButtonType } from './session/SessionButton'; +import { + SessionButton, + SessionButtonColor, + SessionButtonType, +} from './session/SessionButton'; import { SessionIconButton, @@ -67,13 +71,18 @@ export class EditProfileDialog extends React.Component { const viewQR = this.state.mode === 'qr'; const sessionID = window.textsecure.storage.user.getNumber(); - const backButton = (viewEdit || viewQR) - ? [{ - iconType: SessionIconType.Chevron, - iconRotation: 90, - onClick: () => this.setState({mode: 'default'}), - }] - : undefined; + const backButton = + viewEdit || viewQR + ? [ + { + iconType: SessionIconType.Chevron, + iconRotation: 90, + onClick: () => { + this.setState({ mode: 'default' }); + }, + }, + ] + : undefined; return ( { headerReverse={viewEdit || viewQR} headerIconButtons={backButton} > -
+
{viewQR && this.renderQRView(sessionID)} {viewDefault && this.renderDefaultView()} @@ -93,18 +102,18 @@ export class EditProfileDialog extends React.Component {
{window.i18n('yourSessionID')}
-

- { sessionID } -

+

{sessionID}

+ +
-
- - { (viewDefault || viewQR) ? ( + {viewDefault || viewQR ? ( this.copySessionID(sessionID)} + onClick={() => { + this.copySessionID(sessionID); + }} /> ) : ( { /> )} -
- +
); @@ -130,6 +138,7 @@ export class EditProfileDialog extends React.Component { {this.renderAvatar()}
{ const el = this.inputEl.current; if (el) { @@ -148,12 +157,15 @@ export class EditProfileDialog extends React.Component {
this.setState({mode: 'qr'})} + role="button" + onClick={() => { + this.setState({ mode: 'qr' }); + }} >
@@ -162,31 +174,31 @@ export class EditProfileDialog extends React.Component { ); } - private renderDefaultView(){ + private renderDefaultView() { return ( <> - { this.renderProfileHeader() } + {this.renderProfileHeader()}
-

{ this.state.setProfileName }

+

{this.state.setProfileName}

this.setState({mode: 'edit'})} + onClick={() => { + this.setState({ mode: 'edit' }); + }} />
); } - - private renderEditView() { const placeholderText = window.i18n('displayName'); return ( <> - { this.renderProfileHeader() } + {this.renderProfileHeader()}
{ ); } - private renderQRView(sessionID: string){ + private renderQRView(sessionID: string) { const bgColor = '#FFFFFF'; const fgColor = '#1B1B1B'; - + return (
- +
); } diff --git a/ts/components/session/ActionsPanel.tsx b/ts/components/session/ActionsPanel.tsx index 602c8cb2b..f1dceb134 100644 --- a/ts/components/session/ActionsPanel.tsx +++ b/ts/components/session/ActionsPanel.tsx @@ -42,7 +42,8 @@ const Section = ({ ? () => { type === SectionType.Profile ? window.showEditProfileDialog() - : onSelect(type); + : /* tslint:disable-next-line:no-void-expression */ + onSelect(type); } : undefined; diff --git a/ts/components/session/SessionModal.tsx b/ts/components/session/SessionModal.tsx index c9078d11d..1d4c45808 100644 --- a/ts/components/session/SessionModal.tsx +++ b/ts/components/session/SessionModal.tsx @@ -2,7 +2,7 @@ import React from 'react'; import classNames from 'classnames'; import { SessionIconButton, SessionIconSize, SessionIconType } from './icon/'; -import { SessionButton, SessionButtonType, SessionButtonColor } from './SessionButton'; +import { SessionButtonColor, SessionButtonType } from './SessionButton'; interface Props { title: string; @@ -11,7 +11,7 @@ interface Props { showExitIcon?: boolean; showHeader?: boolean; headerReverse?: boolean; - //Maximum of two icons in header + //Maximum of two icons or buttons in header headerIconButtons?: Array<{ iconType: SessionIconType; iconRotation: number; @@ -49,14 +49,25 @@ export class SessionModal extends React.PureComponent { } public render() { - const { title, headerIconButtons, showExitIcon, showHeader, headerReverse } = this.props; + const { + title, + headerIconButtons, + showExitIcon, + showHeader, + headerReverse, + } = this.props; const { isVisible } = this.state; return isVisible ? (
{showHeader ? ( <> -
+
{showExitIcon ? ( { return (
- + {shouldRenderPasswordLock ? ( this.renderPasswordLock() ) : ( diff --git a/ts/components/session/settings/SessionSettingsHeader.tsx b/ts/components/session/settings/SessionSettingsHeader.tsx index 5d3bf106b..0de5eb643 100644 --- a/ts/components/session/settings/SessionSettingsHeader.tsx +++ b/ts/components/session/settings/SessionSettingsHeader.tsx @@ -4,19 +4,19 @@ import { SessionIconButton, SessionIconSize, SessionIconType } from '../icon'; import { SessionSettingCategory, SettingsViewProps } from './SessionSettings'; import { SessionButton } from '../SessionButton'; -interface Props extends SettingsViewProps{ +interface Props extends SettingsViewProps { disableLinkDeviceButton: boolean | null; } export class SettingsHeader extends React.Component { public static defaultProps = { disableLinkDeviceButton: true, - } + }; public constructor(props: any) { super(props); this.state = { - disableLinkDeviceButton: this.props.disableLinkDeviceButton, + disableLinkDeviceButton: this.props.disableLinkDeviceButton, }; this.showAddLinkedDeviceModal = this.showAddLinkedDeviceModal.bind(this); }