diff --git a/stylesheets/_global.scss b/stylesheets/_global.scss index 658071d55..6e39e09cc 100644 --- a/stylesheets/_global.scss +++ b/stylesheets/_global.scss @@ -115,23 +115,6 @@ a { } } -.new-group-update { - .summary { - margin: 10px; - } - - .members .contact { - box-shadow: none; - border-bottom: 1px solid #eee; - .last-message, - .last-timestamp { - display: none; - } - } -} - -$unread-badge-size: 21px; - .banner { z-index: 100; diff --git a/stylesheets/_index.scss b/stylesheets/_index.scss index 0bd53bf66..d3d3a53d9 100644 --- a/stylesheets/_index.scss +++ b/stylesheets/_index.scss @@ -52,21 +52,6 @@ .avatar-center-inner { display: flex; } - - .upload-btn-background { - background-color: #ffffff70; - align-self: center; - margin-inline-start: -24px; - margin-top: 40px; - z-index: 1; - border-radius: 8px; - } -} - -.expired { - .gutter { - height: calc(100% - 48px); - } } .scrollable { @@ -183,55 +168,6 @@ input.search { } } -.last-timestamp { - font-size: smaller; - float: right; - margin: 0 10px; - color: $grey; -} - -.new-contact { - display: none; - cursor: pointer; - opacity: 0.7; - .contact-details .number { - display: block; - font-style: italic; - padding-inline-end: 8px; - } - - &.valid { - opacity: 1; - } -} - -.index { - .gutter .new-group-update-form { - display: none; - padding: 0.5em; - } - - .last-message { - margin: 6px 0 0; - font-size: $font-size-small; - } - - .gutter .timestamp { - position: absolute; - top: 14px; - right: 12px; - color: $grey; - } -} - -.conversations .unread .contact-details { - .name, - .last-message, - .last-timestamp { - font-weight: bold; - } -} - .hint { margin: 10px; padding: 1em; diff --git a/stylesheets/_modal.scss b/stylesheets/_modal.scss index 28256b4c6..94eeff6fb 100644 --- a/stylesheets/_modal.scss +++ b/stylesheets/_modal.scss @@ -146,38 +146,6 @@ } } -.nickname-dialog { - .message { - font-style: italic; - color: $grey; - font-size: 12px; - margin-bottom: 16px; - } -} - -.seed-dialog { - .title { - font-weight: bold; - } - - .fields { - margin-top: 20px; - } - - .seed { - padding: 20px 0; - font-style: oblique; - } - - .qr-image { - transition: $session-transition-duration; - opacity: 10%; - &:hover { - opacity: 100%; - } - } -} - .loki-dialog { & ~ .index.inbox { // filter: blur(2px); // FIXME enable back once modals are moved to react @@ -192,12 +160,6 @@ } } -.nickname-dialog { - .message { - color: $color-light-35; - } -} - .edit-profile-dialog { .session-modal__header__title { font-size: $session-font-lg; diff --git a/stylesheets/_modules.scss b/stylesheets/_modules.scss index 5f05f5b3e..7beab63ca 100644 --- a/stylesheets/_modules.scss +++ b/stylesheets/_modules.scss @@ -136,7 +136,7 @@ } .module-message__generic-attachment__file-size { - font-size: 11px; + font-size: var(--font-size-xs); line-height: 16px; letter-spacing: 0.3px; margin-top: 3px; @@ -233,7 +233,7 @@ .module-message__author { margin-top: $session-margin-sm; margin-bottom: $session-margin-xs; - font-size: 13px; + font-size: var(--font-size-sm); font-weight: 300; line-height: 18px; overflow-x: hidden; @@ -655,7 +655,7 @@ top: -6px; font-weight: 300; - font-size: 11px; + font-size: var(--font-size-xs); letter-spacing: 0.25px; height: 16px; @@ -717,7 +717,7 @@ flex-grow: 1; flex-shrink: 1; - font-size: 13px; + font-size: var(--font-size-sm); line-height: 18px; color: $color-gray-25; @@ -1252,7 +1252,7 @@ .module-staged-link-preview__location { margin-top: 4px; color: $color-gray-60; - font-size: 11px; + font-size: var(--font-size-xs); height: 16px; letter-spacing: 0.25px; text-transform: uppercase; diff --git a/stylesheets/_quote.scss b/stylesheets/_quote.scss index 31a990a60..1c05a339b 100644 --- a/stylesheets/_quote.scss +++ b/stylesheets/_quote.scss @@ -104,7 +104,7 @@ } .module-quote__primary__author { - font-size: 13px; + font-size: var(--font-size-sm); line-height: 18px; font-weight: 300; color: $color-gray-90; @@ -138,7 +138,7 @@ .module-quote__primary__type-label { font-style: italic; color: $color-gray-90; - font-size: 13px; + font-size: var(--font-size-sm); line-height: 18px; } @@ -273,7 +273,7 @@ &-warning__text { margin-inline-start: 6px; color: $color-gray-90; - font-size: 13px; + font-size: var(--font-size-sm); line-height: 18px; } } diff --git a/stylesheets/_session.scss b/stylesheets/_session.scss index 156128ed2..a489dcd50 100644 --- a/stylesheets/_session.scss +++ b/stylesheets/_session.scss @@ -280,8 +280,7 @@ textarea { font-size: $session-font-md; &-text { - @include session-color-subtle(var(--color-text)); - + color: var(--color-text-subtle); font-weight: 400; font-size: $session-font-sm; line-height: $session-font-sm; @@ -883,14 +882,9 @@ label { font-size: $session-font-sm; font-weight: 100; max-width: 700px; - @include session-color-subtle(var(--color-text)); + color: var(--color-text-subtle); } - &__content { - label { - @include session-color-subtle(var(--color-text)); - } - } &__selection { .session-toggle { transition: $session-transition-duration; @@ -978,60 +972,10 @@ label { border-radius: 3px; } -.seed-dialog { - &__description { - max-width: $session-modal-size-lg; - } -} - .messages li { transition: $session-transition-duration !important; } -.session-radio-group fieldset { - border: none; - margin-inline-start: $session-margin-sm; - margin-top: $session-margin-sm; -} - -.session-radio-group fieldset { - input[type='radio'] { - opacity: 0; - position: absolute; - cursor: pointer; - } - - label { - margin-inline-end: 1em; - cursor: pointer; - } - - label:before { - content: ''; - display: inline-block; - width: 0.5em; - height: 0.5em; - margin-inline-end: 0.8em; - border-radius: 100%; - vertical-align: 0px; - border: 2px solid rgba($session-color-white, 0.6); - padding: 0.2em; - background: none; - border-color: var(--color-accent); - - background-clip: content-box; - transition: $session-transition-duration; - } - - input:hover + label:before { - background: var(--color-accent); - } - - input:checked + label:before { - background: var(--color-accent); - } -} - .session-id-editable { padding: $session-margin-lg; @@ -1132,17 +1076,6 @@ input { } } -.session-nickname-wrapper { - position: absolute; - height: 100%; - width: 100%; - display: flex; - - .session-modal { - margin: auto auto; - } -} - .messages-container { .session-icon-button { display: flex; @@ -1168,27 +1101,11 @@ input { } .group-member-list { - &__container { - padding: 2px 0px; - width: 100%; - max-height: 400px; - overflow-y: auto; - border: var(--border-session); - } - &__selection { height: 100%; display: flex; flex-direction: column; } - - &__no-contacts { - font-family: $session-font-mono; - background: var(--color-cell-background); - - text-align: center; - padding: 20px; - } } .create-group-name-input { diff --git a/stylesheets/_session_constants.scss b/stylesheets/_session_constants.scss index 77fc41039..c73021af0 100644 --- a/stylesheets/_session_constants.scss +++ b/stylesheets/_session_constants.scss @@ -124,10 +124,6 @@ $session-font-h4: 16px; display: inline-block; } -@mixin session-color-subtle($color) { - color: subtle($color); -} - @mixin pulse-color($color, $duration, $repetition) { animation: pulseColor $duration $repetition; diff --git a/stylesheets/_session_left_pane.scss b/stylesheets/_session_left_pane.scss index 0093765d9..877b88c37 100644 --- a/stylesheets/_session_left_pane.scss +++ b/stylesheets/_session_left_pane.scss @@ -1,18 +1,12 @@ $session-compose-margin: 20px; -.gutter { - width: 380px !important; - transition: none; - background: var(--color-cell-background); -} - .module-conversation { // default conversation list item text color &__user__profile { &-number, &-name { font-weight: bold; - font-size: 15px; + font-size: var(--font-size-md); color: var(--color-text-subtle); } @@ -305,7 +299,7 @@ $session-compose-margin: 20px; display: flex; .session-button { - font-size: 11px; + font-size: var(--font-size-xs); padding: 6px; height: auto; margin: 0px; diff --git a/stylesheets/_session_signin.scss b/stylesheets/_session_signin.scss index b9f04832b..8343f2f4b 100644 --- a/stylesheets/_session_signin.scss +++ b/stylesheets/_session_signin.scss @@ -152,8 +152,8 @@ &-terms-conditions-agreement { padding-top: $session-margin-md; - @include session-color-subtle(var(--color-text)); + color: var(--color-text-subtle); text-align: center; font-size: 12px; @@ -161,12 +161,12 @@ white-space: nowrap; font-weight: bold; text-decoration: none; - @include session-color-subtle(var(--color-text)); + color: var(--color-text-subtle); transition: $session-transition-duration; &:visited &:link { - @include session-color-subtle(var(--color-text)); + color: var(--color-text-subtle); } &:hover { @@ -178,8 +178,8 @@ session-description-long { padding-top: 0; padding-bottom: 20px; - @include session-color-subtle(var(--color-text)); + color: var(--color-text-subtle); text-align: center; font-size: 12px; line-height: 20px; @@ -206,8 +206,7 @@ border: none; background: transparent; color: var(--color-text); - - font-size: 15px; + font-size: var(--font-size-md); line-height: 18px; text-align: center; overflow-wrap: break-word; @@ -223,7 +222,7 @@ [contenteditable='true']:empty::before { content: attr(placeholder); - @include session-color-subtle(var(--color-text)); - font-size: 13px; + color: var(--color-text-subtle); + font-size: var(--font-size-sm); } diff --git a/stylesheets/_theme_dark.scss b/stylesheets/_theme_dark.scss index 7c08a070c..3791e1fdb 100644 --- a/stylesheets/_theme_dark.scss +++ b/stylesheets/_theme_dark.scss @@ -72,16 +72,6 @@ } } - .last-timestamp { - color: $grey; - } - - .index { - .gutter .timestamp { - color: $grey; - } - } - .hint { color: white; border: 2px dashed white; diff --git a/ts/components/SessionInboxView.tsx b/ts/components/SessionInboxView.tsx index 428ae27ce..034c56f97 100644 --- a/ts/components/SessionInboxView.tsx +++ b/ts/components/SessionInboxView.tsx @@ -29,6 +29,7 @@ import { ExpirationTimerOptions } from '../util/expiringMessages'; // moment does not support es-419 correctly (and cause white screen on app start) import moment from 'moment'; +import styled from 'styled-components'; // Default to the locale from env. It will be overriden if moment // does not recognize it with what moment knows which is the closest. @@ -43,6 +44,12 @@ type State = { isInitialLoadComplete: boolean; }; +const StyledGutter = styled.div` + width: 380px !important; + transition: none; + background: var(--color-cell-background); +`; + export class SessionInboxView extends React.Component { private store: any; @@ -69,10 +76,7 @@ export class SessionInboxView extends React.Component {
-
-
- {this.renderLeftPane()} -
+ {this.renderLeftPane()} diff --git a/ts/components/basic/SessionRadio.tsx b/ts/components/basic/SessionRadio.tsx index 3831dfe4e..314bb88f4 100644 --- a/ts/components/basic/SessionRadio.tsx +++ b/ts/components/basic/SessionRadio.tsx @@ -1,17 +1,55 @@ import React from 'react'; +import styled, { CSSProperties } from 'styled-components'; import { Flex } from '../basic/Flex'; // tslint:disable: react-unused-props-and-state -interface Props { +type Props = { label: string; value: string; active: boolean; - group?: string; - onClick: (value: string) => any; -} + inputName?: string; + onClick: (value: string) => void; +}; + +const StyledInput = styled.input` + opacity: 0; + position: absolute; + cursor: pointer; + width: calc(var(--filled-size) + var(--outline-offset)); + height: calc(var(--filled-size) + var(--outline-offset)); + + :checked + label:before, + :hover + label:before { + background: var(--color-accent); + } +`; + +const StyledLabel = styled.label` + cursor: pointer; + + :before { + content: ''; + display: inline-block; + width: var(--filled-size); + height: var(--filled-size); + margin-inline-end: var(--margin-end); + border-radius: 100%; + + transition: var(--default-duration); + padding: 7px; + outline-offset: var(--outline-offset); + outline: var(--color-text) solid 1px; + border: none; + margin-top: 5px; + + :hover { + background: var(--color-accent); + } + } +`; export const SessionRadio = (props: Props) => { - const { label, group, value, active, onClick } = props; + const { label, inputName, value, active, onClick } = props; function clickHandler(e: any) { e.stopPropagation(); @@ -19,18 +57,49 @@ export const SessionRadio = (props: Props) => { } return ( - - + - + ); }; + +export const SessionRadioInput = ( + props: Pick +) => { + const { active, onClick, inputName, value } = props; + function clickHandler(e: any) { + e.stopPropagation(); + onClick(value); + } + + return ( + + ); +}; diff --git a/ts/components/basic/SessionRadioGroup.tsx b/ts/components/basic/SessionRadioGroup.tsx index 43b3f5442..eedfeaa40 100644 --- a/ts/components/basic/SessionRadioGroup.tsx +++ b/ts/components/basic/SessionRadioGroup.tsx @@ -1,4 +1,5 @@ import React, { useEffect, useState } from 'react'; +import styled from 'styled-components'; import { SessionRadio } from './SessionRadio'; @@ -10,6 +11,12 @@ interface Props { onClick: (selectedValue: string) => any; } +const StyledFieldSet = styled.fieldset` + border: none; + margin-inline-start: var(--margins-sm); + margin-top: var(--margins-sm); +`; + export const SessionRadioGroup = (props: Props) => { const [activeItem, setActiveItem] = useState(''); const { items, group, initialItem } = props; @@ -19,26 +26,24 @@ export const SessionRadioGroup = (props: Props) => { }, []); return ( -
-
- {items.map(item => { - const itemIsActive = item.value === activeItem; + + {items.map(item => { + const itemIsActive = item.value === activeItem; - return ( - { - setActiveItem(value); - props.onClick(value); - }} - /> - ); - })} -
-
+ return ( + { + setActiveItem(value); + props.onClick(value); + }} + /> + ); + })} + ); }; diff --git a/ts/components/conversation/ExpireTimer.tsx b/ts/components/conversation/ExpireTimer.tsx index 6409a24cc..dc60f7774 100644 --- a/ts/components/conversation/ExpireTimer.tsx +++ b/ts/components/conversation/ExpireTimer.tsx @@ -17,7 +17,7 @@ const ExpireTimerCount = styled.div<{ color: string; }>` margin-inline-start: 6px; - font-size: 11px; + font-size: var(--font-size-xs); line-height: 16px; letter-spacing: 0.3px; text-transform: uppercase; @@ -27,7 +27,7 @@ const ExpireTimerCount = styled.div<{ const ExpireTimerBucket = styled.div` margin-inline-start: 6px; - font-size: 11px; + font-size: var(--font-size-xs); line-height: 16px; letter-spacing: 0.3px; text-transform: uppercase; diff --git a/ts/components/conversation/SessionLastSeenIndicator.tsx b/ts/components/conversation/SessionLastSeenIndicator.tsx index ca41d3e44..cccc8df55 100644 --- a/ts/components/conversation/SessionLastSeenIndicator.tsx +++ b/ts/components/conversation/SessionLastSeenIndicator.tsx @@ -24,7 +24,7 @@ const LastSeenBar = styled.div` const LastSeenText = styled.div` margin-top: 3px; - font-size: 11px; + font-size: var(--font-size-xs); line-height: 26px; letter-spacing: 0.3px; text-transform: uppercase; diff --git a/ts/components/conversation/Timestamp.tsx b/ts/components/conversation/Timestamp.tsx index 7d427510a..b92ea04ca 100644 --- a/ts/components/conversation/Timestamp.tsx +++ b/ts/components/conversation/Timestamp.tsx @@ -14,7 +14,7 @@ type Props = { const UPDATE_FREQUENCY = 60 * 1000; const TimestampContainerNotListItem = styled.div` - font-size: 11px; + font-size: var(--font-size-xs); line-height: 16px; letter-spacing: 0.3px; text-transform: uppercase; diff --git a/ts/components/leftpane/MessageRequestsBanner.tsx b/ts/components/leftpane/MessageRequestsBanner.tsx index 073ab7fd1..6839f5f16 100644 --- a/ts/components/leftpane/MessageRequestsBanner.tsx +++ b/ts/components/leftpane/MessageRequestsBanner.tsx @@ -29,7 +29,7 @@ const StyledMessageRequestBanner = styled.div` const StyledMessageRequestBannerHeader = styled.span` font-weight: bold; - font-size: 15px; + font-size: var(--font-size-md); color: var(--color-text-subtle); padding-left: var(--margins-xs); margin-inline-start: 12px; diff --git a/ts/components/leftpane/conversation-list-item/HeaderItem.tsx b/ts/components/leftpane/conversation-list-item/HeaderItem.tsx index ade13aa47..5a1749897 100644 --- a/ts/components/leftpane/conversation-list-item/HeaderItem.tsx +++ b/ts/components/leftpane/conversation-list-item/HeaderItem.tsx @@ -96,7 +96,7 @@ const MentionAtSymbol = styled.span` margin-inline-start: 5px; font-weight: 300; - font-size: 11px; + font-size: var(--font-size-xs); letter-spacing: 0.25px; height: 16px; diff --git a/ts/components/leftpane/overlay/OverlayClosedGroup.tsx b/ts/components/leftpane/overlay/OverlayClosedGroup.tsx index 5255bc60b..b18b92af6 100644 --- a/ts/components/leftpane/overlay/OverlayClosedGroup.tsx +++ b/ts/components/leftpane/overlay/OverlayClosedGroup.tsx @@ -14,6 +14,7 @@ import { getPrivateContactsPubkeys } from '../../../state/selectors/conversation import { SpacerLG } from '../../basic/Text'; import { MainViewController } from '../../MainViewController'; import useKey from 'react-use/lib/useKey'; +import styled from 'styled-components'; export const OverlayClosedGroup = () => { const dispatch = useDispatch(); @@ -85,9 +86,11 @@ export const OverlayClosedGroup = () => { -
+ {noContactsForClosedGroup ? ( -
{window.i18n('noContactsForGroup')}
+ + {window.i18n('noContactsForGroup')} + ) : (
{privateContactsPubkeys.map((memberPubkey: string) => ( @@ -105,7 +108,7 @@ export const OverlayClosedGroup = () => { ))}
)} -
+ @@ -120,3 +123,18 @@ export const OverlayClosedGroup = () => {
); }; + +const StyledMemberListNoContacts = styled.div` + font-family: var(--font-font-mono); + background: var(--color-cell-background); + text-align: center; + padding: 20px; +`; + +const StyledGroupMemberListContainer = styled.div` + padding: 2px 0px; + width: 100%; + max-height: 400px; + overflow-y: auto; + border: var(--border-session); +`; diff --git a/ts/components/leftpane/overlay/choose-action/ContactsListWithBreaks.tsx b/ts/components/leftpane/overlay/choose-action/ContactsListWithBreaks.tsx index 625392edb..7d0223e78 100644 --- a/ts/components/leftpane/overlay/choose-action/ContactsListWithBreaks.tsx +++ b/ts/components/leftpane/overlay/choose-action/ContactsListWithBreaks.tsx @@ -99,7 +99,7 @@ const StyledContactSection = styled.div` display: flex; .session-button { - font-size: 11px; + font-size: var(--font-size-xs); padding: 6px; height: auto; margin: 0px; diff --git a/ts/components/search/MessageSearchResults.tsx b/ts/components/search/MessageSearchResults.tsx index 546226330..f3d6c1705 100644 --- a/ts/components/search/MessageSearchResults.tsx +++ b/ts/components/search/MessageSearchResults.tsx @@ -141,7 +141,7 @@ const ResultBody = styled.div` margin-top: 1px; flex-shrink: 1; - font-size: 13px; + font-size: var(--font-size-sm); color: var(--color-text-subtle); @@ -157,7 +157,7 @@ const StyledTimestampContaimer = styled.div` flex-shrink: 0; margin-inline-start: 6px; - font-size: 11px; + font-size: var(--font-size-xs); line-height: 16px; letter-spacing: 0.3px; diff --git a/ts/components/search/SearchResults.tsx b/ts/components/search/SearchResults.tsx index d48151c28..668a9aef1 100644 --- a/ts/components/search/SearchResults.tsx +++ b/ts/components/search/SearchResults.tsx @@ -20,7 +20,7 @@ const StyledSeparatorSection = styled.div` color: var(--color-text); - font-size: 13px; + font-size: var(--font-size-sm); font-weight: 400; letter-spacing: 0; `; diff --git a/ts/session/apis/snode_api/onions.ts b/ts/session/apis/snode_api/onions.ts index 5180debe7..db64540d8 100644 --- a/ts/session/apis/snode_api/onions.ts +++ b/ts/session/apis/snode_api/onions.ts @@ -804,6 +804,7 @@ async function sendOnionRequestHandlingSnodeEject({ decodingSymmetricKey = result.decodingSymmetricKey; } catch (e) { window?.log?.warn('sendOnionRequestNoRetries error message: ', e.message); + // const isTimeout = (e.message && isString(e.message) && (e.message as string).toLowerCase().includes('network timeout at')) if (e.code === 'ENETUNREACH' || e.message === 'ENETUNREACH' || throwErrors) { throw e; }