Skip to content

Commit

Permalink
fix: safari flipcard not working
Browse files Browse the repository at this point in the history
  • Loading branch information
viet-nv committed Jul 26, 2023
1 parent 99587dd commit 826b7b9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/pages/MyEarnings/ElasticPools/SinglePosition/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ const FlipCardFront = styled.div`
position: absolute;
width: 100%;
height: 100%;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
`

Expand Down Expand Up @@ -105,6 +104,13 @@ const SinglePosition: React.FC<Props> = ({
currency1,
}

// Can not interact with flipcard on safari. fuck apple
const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent)

if (isSafari) {
return <FlipCard>{isViewEarnings ? <EarningView {...props} /> : <PositionView {...props} />}</FlipCard>
}

return (
<FlipCard>
<FlipCardInner flip={!isViewEarnings}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const CustomButton = styled.div<{ isActive: boolean }>`
font-weight: 500;
font-size: 12px;
transition: all 0.2s ease;
height: 32px;
display: flex;
align-items: center;
gap: 2px;
Expand Down

0 comments on commit 826b7b9

Please sign in to comment.