diff --git a/stylesheets/_session.scss b/stylesheets/_session.scss index 4fbf56b6e0..6a3f363330 100644 --- a/stylesheets/_session.scss +++ b/stylesheets/_session.scss @@ -470,6 +470,7 @@ label { } &__close > div { float: left; + padding: $session-margin-xs; margin: 0px; } &__icons > div { @@ -1203,6 +1204,7 @@ input { flex-direction: column; margin: $session-margin-sm; align-items: flex-start; + position: relative; .onion__node { display: flex; @@ -1210,14 +1212,41 @@ input { align-items: center; margin: $session-margin-xs; - * { - margin: $session-margin-sm; + &:nth-child(2) { + margin-top: 0; + } + + &:nth-last-child(2) { + margin-bottom: 0; } .session-icon-button { margin: $session-margin-sm !important; } } + + .onion__node-list-lights { + position: relative; + } + .onion__node__country { + margin: $session-margin-sm; + } + + .onion__growing-icon { + flex-grow: 1; + display: flex; + align-items: center; + } + + .onion__vertical-line { + background: $onionPathLineColor; + position: absolute; + height: calc(100% - 2 * 15px); + margin: 15px calc(100% / 2 - 1px); + + width: 1px; + // z-index: -1; + } } .session-nickname-wrapper { diff --git a/stylesheets/themes.scss b/stylesheets/themes.scss index bd346b42bc..97cd50a3f8 100644 --- a/stylesheets/themes.scss +++ b/stylesheets/themes.scss @@ -11,6 +11,8 @@ $borderLightTheme: #f1f1f1; // search for references on ts TODO: make this expos $borderDarkTheme: rgba($white, 0.06); $inputBackgroundColor: #8e8e93; +$onionPathLineColor: rgba(#7a7a7a, 0.6); + $borderAvatarColor: unquote( '#00000059' ); // search for references on ts TODO: make this exposed on ts diff --git a/ts/components/OnionStatusPathDialog.tsx b/ts/components/OnionStatusPathDialog.tsx index 93fb7f0f5b..72c386aed6 100644 --- a/ts/components/OnionStatusPathDialog.tsx +++ b/ts/components/OnionStatusPathDialog.tsx @@ -8,7 +8,6 @@ import Electron from 'electron'; const { shell } = Electron; import { useDispatch, useSelector } from 'react-redux'; -import { StateType } from '../state/reducer'; import { SessionIcon, SessionIconButton, SessionIconSize, SessionIconType } from './session/icon'; import { SessionWrapperModal } from './session/SessionWrapperModal'; @@ -27,6 +26,7 @@ import { // tslint:disable-next-line: no-submodule-imports import useNetworkState from 'react-use/lib/useNetworkState'; import { SessionSpinner } from './session/SessionSpinner'; +import { Flex } from './basic/Flex'; export type StatusLightType = { glowStartDelay: number; @@ -56,53 +56,57 @@ const OnionPathModalInner = () => { <>

{window.i18n('onionPathIndicatorDescription')}

- {nodes.map((snode: Snode | any, index: number) => { - return ( - - ); - })} + +
+
+ + + {nodes.map((_snode: Snode | any, index: number) => { + return ( + + ); + })} + +
+ + {nodes.map((snode: Snode | any, index: number) => { + let labelText = snode.label + ? snode.label + : countryLookup.byIso(ip2country(snode.ip))?.country; + if (!labelText) { + labelText = window.i18n('unknownCountry'); + } + return labelText ?
{labelText}
: null; + })} +
+
); }; export type OnionNodeStatusLightType = { - snode: Snode; - label?: string; glowStartDelay: number; glowDuration: number; }; /** - * Component containing a coloured status light and an adjacent country label. + * Component containing a coloured status light. */ export const OnionNodeStatusLight = (props: OnionNodeStatusLightType): JSX.Element => { - const { snode, label, glowStartDelay, glowDuration } = props; + const { glowStartDelay, glowDuration } = props; const theme = useTheme(); - let labelText = label ? label : countryLookup.byIso(ip2country(snode.ip))?.country; - if (!labelText) { - labelText = window.i18n('unknownCountry'); - } return ( -
- - {labelText ? ( - <> -
{labelText}
- - ) : null} -
+ ); }; @@ -114,15 +118,17 @@ export const ModalStatusLight = (props: StatusLightType) => { const theme = useSelector(getTheme); return ( - +
+ +
); }; @@ -154,7 +160,7 @@ export const ActionPanelOnionStatusLight = (props: { return (