Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
fix(SafariSquareDots): fixed by using border-top-with instead of bord… (
Browse files Browse the repository at this point in the history
#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: NITIPON CHINGTHONGCHAI <[email protected]>
Co-authored-by: Justin Domingue <[email protected]>
  • Loading branch information
3 people authored Oct 11, 2021
1 parent 03c3fde commit 27a868f
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 14 deletions.
3 changes: 3 additions & 0 deletions src/assets/svg/dot_line.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 14 additions & 5 deletions src/components/RoutingDiagram/RoutingDiagram.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { Box } from 'rebass'
import styled from 'styled-components/macro'
import { TYPE } from 'theme'

import { ReactComponent as DotLine } from '../../assets/svg/dot_line.svg'

export interface RoutingDiagramEntry {
percent: Percent
path: [Currency, Currency, FeeAmount][]
Expand Down Expand Up @@ -40,13 +42,18 @@ const PoolBadge = styled(Badge)`
`

const DottedLine = styled.div`
border-color: ${({ theme }) => theme.bg4};
border-top-style: dotted;
border-width: 4px;
height: 0px;
display: flex;
align-items: center;
position: absolute;
width: calc(100%);
z-index: 1;
opacity: 0.5;
`

const DotColor = styled(DotLine)`
path {
stroke: ${({ theme }) => theme.bg4};
}
`

const OpaqueBadge = styled(Badge)`
Expand Down Expand Up @@ -82,7 +89,9 @@ export default function RoutingDiagram({
function Route({ percent, path }: { percent: RoutingDiagramEntry['percent']; path: RoutingDiagramEntry['path'] }) {
return (
<RouteRow>
<DottedLine />
<DottedLine>
<DotColor />
</DottedLine>
<OpaqueBadge>
<TYPE.small fontSize={12} style={{ wordBreak: 'normal' }}>
{percent.toSignificant(2)}%
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,16 @@ exports[`renders multi route 1`] = `
class="sc-bdnxRM Row-sc-nrd8cx-0 RoutingDiagram__RouteRow-sc-o1ook0-2 lmTMKd itvFNV fzMiot"
>
<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
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
class="theme__TextWrapper-sc-18nh1jk-0 cWOfab css-15li2d9"
Expand Down Expand Up @@ -56,10 +62,16 @@ exports[`renders multi route 1`] = `
class="sc-bdnxRM Row-sc-nrd8cx-0 RoutingDiagram__RouteRow-sc-o1ook0-2 lmTMKd itvFNV fzMiot"
>
<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
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
class="theme__TextWrapper-sc-18nh1jk-0 cWOfab css-15li2d9"
Expand Down Expand Up @@ -122,10 +134,16 @@ exports[`renders single route 1`] = `
class="sc-bdnxRM Row-sc-nrd8cx-0 RoutingDiagram__RouteRow-sc-o1ook0-2 lmTMKd itvFNV fzMiot"
>
<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
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
class="theme__TextWrapper-sc-18nh1jk-0 cWOfab css-15li2d9"
Expand Down

0 comments on commit 27a868f

Please sign in to comment.