Commit 27a868f0 authored by nitipon.eth's avatar nitipon.eth Committed by GitHub

fix(SafariSquareDots): fixed by using border-top-with instead of bord… (#2474)

* fix(SafariSquareDots): fixed by using border-top-with instead of border-width

* fix(SafariSqaureDots): fixed by using a min width of 5px and then following the width of the screen if the screen is too wide

* fix(SafariSquareDots): fixed by using Dot SVG instead of border-style CSS

* fix(SafariSquareDots):  Fixed code follows suggestions from the Pull Request

* regenerate snapshots
Co-authored-by: default avatarNITIPON CHINGTHONGCHAI <nitipon.chingthongchai@scb.co.th>
Co-authored-by: default avatarJustin Domingue <judo@uniswap.org>
parent 03c3fdef
<svg width="100%" height="35" viewBox="800 0 300 200" xmlns="http://www.w3.org/2000/svg">
<line x1="0" x2="2000" y1="100" y2="100" stroke="currentColor" stroke-width="20" stroke-linecap="round" stroke-dasharray="1, 45"/>
</svg>
...@@ -9,6 +9,8 @@ import { Box } from 'rebass' ...@@ -9,6 +9,8 @@ import { Box } from 'rebass'
import styled from 'styled-components/macro' import styled from 'styled-components/macro'
import { TYPE } from 'theme' import { TYPE } from 'theme'
import { ReactComponent as DotLine } from '../../assets/svg/dot_line.svg'
export interface RoutingDiagramEntry { export interface RoutingDiagramEntry {
percent: Percent percent: Percent
path: [Currency, Currency, FeeAmount][] path: [Currency, Currency, FeeAmount][]
...@@ -40,13 +42,18 @@ const PoolBadge = styled(Badge)` ...@@ -40,13 +42,18 @@ const PoolBadge = styled(Badge)`
` `
const DottedLine = styled.div` const DottedLine = styled.div`
border-color: ${({ theme }) => theme.bg4}; display: flex;
border-top-style: dotted; align-items: center;
border-width: 4px;
height: 0px;
position: absolute; position: absolute;
width: calc(100%); width: calc(100%);
z-index: 1; z-index: 1;
opacity: 0.5;
`
const DotColor = styled(DotLine)`
path {
stroke: ${({ theme }) => theme.bg4};
}
` `
const OpaqueBadge = styled(Badge)` const OpaqueBadge = styled(Badge)`
...@@ -82,7 +89,9 @@ export default function RoutingDiagram({ ...@@ -82,7 +89,9 @@ export default function RoutingDiagram({
function Route({ percent, path }: { percent: RoutingDiagramEntry['percent']; path: RoutingDiagramEntry['path'] }) { function Route({ percent, path }: { percent: RoutingDiagramEntry['percent']; path: RoutingDiagramEntry['path'] }) {
return ( return (
<RouteRow> <RouteRow>
<DottedLine /> <DottedLine>
<DotColor />
</DottedLine>
<OpaqueBadge> <OpaqueBadge>
<TYPE.small fontSize={12} style={{ wordBreak: 'normal' }}> <TYPE.small fontSize={12} style={{ wordBreak: 'normal' }}>
{percent.toSignificant(2)}% {percent.toSignificant(2)}%
......
...@@ -13,10 +13,16 @@ exports[`renders multi route 1`] = ` ...@@ -13,10 +13,16 @@ exports[`renders multi route 1`] = `
class="sc-bdnxRM Row-sc-nrd8cx-0 RoutingDiagram__RouteRow-sc-o1ook0-2 lmTMKd itvFNV fzMiot" class="sc-bdnxRM Row-sc-nrd8cx-0 RoutingDiagram__RouteRow-sc-o1ook0-2 lmTMKd itvFNV fzMiot"
> >
<div <div
class="RoutingDiagram__DottedLine-sc-o1ook0-4 gwivhA" class="RoutingDiagram__DottedLine-sc-o1ook0-4 kkXINS"
/> >
<svg
class="RoutingDiagram__DotColor-sc-o1ook0-5 kgYqrO"
>
dot_line.svg
</svg>
</div>
<div <div
class="Badge-sc-1mhw5si-0 RoutingDiagram__OpaqueBadge-sc-o1ook0-5 gayll cvyxdH" class="Badge-sc-1mhw5si-0 RoutingDiagram__OpaqueBadge-sc-o1ook0-6 gayll khxosM"
> >
<div <div
class="theme__TextWrapper-sc-18nh1jk-0 cWOfab css-15li2d9" class="theme__TextWrapper-sc-18nh1jk-0 cWOfab css-15li2d9"
...@@ -56,10 +62,16 @@ exports[`renders multi route 1`] = ` ...@@ -56,10 +62,16 @@ exports[`renders multi route 1`] = `
class="sc-bdnxRM Row-sc-nrd8cx-0 RoutingDiagram__RouteRow-sc-o1ook0-2 lmTMKd itvFNV fzMiot" class="sc-bdnxRM Row-sc-nrd8cx-0 RoutingDiagram__RouteRow-sc-o1ook0-2 lmTMKd itvFNV fzMiot"
> >
<div <div
class="RoutingDiagram__DottedLine-sc-o1ook0-4 gwivhA" class="RoutingDiagram__DottedLine-sc-o1ook0-4 kkXINS"
/> >
<svg
class="RoutingDiagram__DotColor-sc-o1ook0-5 kgYqrO"
>
dot_line.svg
</svg>
</div>
<div <div
class="Badge-sc-1mhw5si-0 RoutingDiagram__OpaqueBadge-sc-o1ook0-5 gayll cvyxdH" class="Badge-sc-1mhw5si-0 RoutingDiagram__OpaqueBadge-sc-o1ook0-6 gayll khxosM"
> >
<div <div
class="theme__TextWrapper-sc-18nh1jk-0 cWOfab css-15li2d9" class="theme__TextWrapper-sc-18nh1jk-0 cWOfab css-15li2d9"
...@@ -122,10 +134,16 @@ exports[`renders single route 1`] = ` ...@@ -122,10 +134,16 @@ exports[`renders single route 1`] = `
class="sc-bdnxRM Row-sc-nrd8cx-0 RoutingDiagram__RouteRow-sc-o1ook0-2 lmTMKd itvFNV fzMiot" class="sc-bdnxRM Row-sc-nrd8cx-0 RoutingDiagram__RouteRow-sc-o1ook0-2 lmTMKd itvFNV fzMiot"
> >
<div <div
class="RoutingDiagram__DottedLine-sc-o1ook0-4 gwivhA" class="RoutingDiagram__DottedLine-sc-o1ook0-4 kkXINS"
/> >
<svg
class="RoutingDiagram__DotColor-sc-o1ook0-5 kgYqrO"
>
dot_line.svg
</svg>
</div>
<div <div
class="Badge-sc-1mhw5si-0 RoutingDiagram__OpaqueBadge-sc-o1ook0-5 gayll cvyxdH" class="Badge-sc-1mhw5si-0 RoutingDiagram__OpaqueBadge-sc-o1ook0-6 gayll khxosM"
> >
<div <div
class="theme__TextWrapper-sc-18nh1jk-0 cWOfab css-15li2d9" class="theme__TextWrapper-sc-18nh1jk-0 cWOfab css-15li2d9"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment