From eb84fe7da35507e943752e9503b98dbadee29572 Mon Sep 17 00:00:00 2001 From: fmtabbara Date: Thu, 8 Sep 2022 12:06:19 +0100 Subject: [PATCH] use svg for node path --- .../components/TestMyNode/Overview/index.tsx | 8 +- .../components/TestMyNode/Results/index.tsx | 17 +-- nym-wallet/src/svg-icons/node-path.tsx | 128 ++++++++++++++++++ 3 files changed, 138 insertions(+), 15 deletions(-) create mode 100644 nym-wallet/src/svg-icons/node-path.tsx diff --git a/nym-wallet/src/components/TestMyNode/Overview/index.tsx b/nym-wallet/src/components/TestMyNode/Overview/index.tsx index 735c8dcdb8..25bbdbadc0 100644 --- a/nym-wallet/src/components/TestMyNode/Overview/index.tsx +++ b/nym-wallet/src/components/TestMyNode/Overview/index.tsx @@ -22,11 +22,11 @@ const content = [ ]; export const Overview = ({ onStartTest }: { onStartTest: () => void }) => ( - - - + + + - + {content.map(DescriptionItem)} diff --git a/nym-wallet/src/components/TestMyNode/Results/index.tsx b/nym-wallet/src/components/TestMyNode/Results/index.tsx index 0784ec83b1..a35d6401c3 100644 --- a/nym-wallet/src/components/TestMyNode/Results/index.tsx +++ b/nym-wallet/src/components/TestMyNode/Results/index.tsx @@ -5,6 +5,7 @@ import format from 'date-fns/format'; import { ResultsCard } from '../components/ResultsCard'; import { ResultsCardDetail } from '../components/ResultsCardDetail'; import { PathChip } from '../components/PathChip'; +import { NodePath } from 'src/svg-icons/node-path'; const NodeSpeed = ({ Mbps, performance }: { Mbps: number; performance: 'poor' | 'fair' | 'good' }) => ( ( ); -const Path = ({ layer }: { layer: number }) => ( +const Path = ({ layer }: { layer: '1' | '2' | '3' | 'gateway' }) => ( - - - - - - - - - + + + ); @@ -82,7 +77,7 @@ export const Results = () => ( - + diff --git a/nym-wallet/src/svg-icons/node-path.tsx b/nym-wallet/src/svg-icons/node-path.tsx new file mode 100644 index 0000000000..6d87aefcfe --- /dev/null +++ b/nym-wallet/src/svg-icons/node-path.tsx @@ -0,0 +1,128 @@ +import React from 'react'; + +// fill="#FB6E4E" fill-opacity="0.05" +// text #1D2125 +// white bg #FBFBFB +// orange bg #FB6E4E + +const withHighlight = (shouldHighlight: boolean) => ({ + background: shouldHighlight ? '#FB6E4E' : '#FBFBFB', + text: shouldHighlight ? '#FB6E4E' : '#1D2125', + bgOpacity: shouldHighlight ? '0.05' : '1', +}); + +export const NodePath = ({ layer }: { layer: '1' | '2' | '3' | 'gateway' }) => ( + + + + + + + + + + + + + + + + + + + + + + +);