Commit 4a14db2d authored by Callil Capuozzo's avatar Callil Capuozzo Committed by GitHub

fix: Update pools page to match token table design (#4861)

* Update pool pages design

* Fix small text

* Mobile tweaks

* remove redesign flag
Co-authored-by: default avatarVignesh Mohankumar <me@vig.xyz>
parent a57c19bb
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import PositionListItem from 'components/PositionListItem' import PositionListItem from 'components/PositionListItem'
import Toggle from 'components/Toggle'
import React from 'react' import React from 'react'
import styled from 'styled-components/macro' import styled from 'styled-components/macro'
import { MEDIA_WIDTHS } from 'theme' import { MEDIA_WIDTHS } from 'theme'
...@@ -10,7 +9,8 @@ const DesktopHeader = styled.div` ...@@ -10,7 +9,8 @@ const DesktopHeader = styled.div`
display: none; display: none;
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
padding: 8px; padding: 16px;
border-bottom: 1px solid ${({ theme }) => theme.backgroundOutline};
@media screen and (min-width: ${MEDIA_WIDTHS.deprecated_upToSmall}px) { @media screen and (min-width: ${MEDIA_WIDTHS.deprecated_upToSmall}px) {
align-items: center; align-items: center;
...@@ -25,12 +25,14 @@ const DesktopHeader = styled.div` ...@@ -25,12 +25,14 @@ const DesktopHeader = styled.div`
const MobileHeader = styled.div` const MobileHeader = styled.div`
font-weight: medium; font-weight: medium;
font-size: 16px;
font-weight: 500;
padding: 8px; padding: 8px;
font-weight: 500;
padding: 16px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 16px;
border-bottom: 1px solid ${({ theme }) => theme.backgroundOutline};
@media screen and (min-width: ${MEDIA_WIDTHS.deprecated_upToSmall}px) { @media screen and (min-width: ${MEDIA_WIDTHS.deprecated_upToSmall}px) {
display: none; display: none;
...@@ -38,8 +40,8 @@ const MobileHeader = styled.div` ...@@ -38,8 +40,8 @@ const MobileHeader = styled.div`
@media screen and (max-width: ${MEDIA_WIDTHS.deprecated_upToExtraSmall}px) { @media screen and (max-width: ${MEDIA_WIDTHS.deprecated_upToExtraSmall}px) {
display: flex; display: flex;
flex-direction: column; flex-direction: row;
align-items: start; justify-content: space-between;
} }
` `
...@@ -49,16 +51,12 @@ const ToggleWrap = styled.div` ...@@ -49,16 +51,12 @@ const ToggleWrap = styled.div`
align-items: center; align-items: center;
` `
const ToggleLabel = styled.div` const ToggleLabel = styled.button`
opacity: ${({ theme }) => theme.opacity.hover}; cursor: pointer;
margin-right: 10px; background-color: transparent;
` border: none;
color: ${({ theme }) => theme.accentAction};
const MobileTogglePosition = styled.div` font-size: 1rem;
@media screen and (max-width: ${MEDIA_WIDTHS.deprecated_upToExtraSmall}px) {
position: absolute;
right: 20px;
}
` `
type PositionListProps = React.PropsWithChildren<{ type PositionListProps = React.PropsWithChildren<{
...@@ -79,34 +77,26 @@ export default function PositionList({ ...@@ -79,34 +77,26 @@ export default function PositionList({
<Trans>Your positions</Trans> <Trans>Your positions</Trans>
{positions && ' (' + positions.length + ')'} {positions && ' (' + positions.length + ')'}
</div> </div>
<ToggleWrap>
<ToggleLabel> <ToggleLabel
<Trans>Show closed positions</Trans>
</ToggleLabel>
<Toggle
id="desktop-hide-closed-positions" id="desktop-hide-closed-positions"
isActive={!userHideClosedPositions} onClick={() => {
toggle={() => {
setUserHideClosedPositions(!userHideClosedPositions) setUserHideClosedPositions(!userHideClosedPositions)
}} }}
/> >
</ToggleWrap> {userHideClosedPositions ? <Trans>Show closed positions</Trans> : <Trans>Hide closed positions</Trans>}
</ToggleLabel>
</DesktopHeader> </DesktopHeader>
<MobileHeader> <MobileHeader>
<Trans>Your positions</Trans> <Trans>Your positions</Trans>
<ToggleWrap> <ToggleWrap>
<ToggleLabel> <ToggleLabel
<Trans>Show closed positions</Trans> onClick={() => {
</ToggleLabel>
<MobileTogglePosition>
<Toggle
id="mobile-hide-closed-positions"
isActive={!userHideClosedPositions}
toggle={() => {
setUserHideClosedPositions(!userHideClosedPositions) setUserHideClosedPositions(!userHideClosedPositions)
}} }}
/> >
</MobileTogglePosition> {userHideClosedPositions ? <Trans>Show closed positions</Trans> : <Trans>Hide closed positions</Trans>}
</ToggleLabel>
</ToggleWrap> </ToggleWrap>
</MobileHeader> </MobileHeader>
{positions.map((p) => { {positions.map((p) => {
......
...@@ -23,29 +23,22 @@ import { DAI, USDC_MAINNET, USDT, WBTC, WRAPPED_NATIVE_CURRENCY } from '../../co ...@@ -23,29 +23,22 @@ import { DAI, USDC_MAINNET, USDT, WBTC, WRAPPED_NATIVE_CURRENCY } from '../../co
const LinkRow = styled(Link)` const LinkRow = styled(Link)`
align-items: center; align-items: center;
border-radius: 20px;
display: flex; display: flex;
cursor: pointer; cursor: pointer;
user-select: none; user-select: none;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
color: ${({ theme }) => theme.deprecated_text1}; color: ${({ theme }) => theme.deprecated_text1};
margin: 8px 0;
padding: 16px; padding: 16px;
text-decoration: none; text-decoration: none;
font-weight: 500; font-weight: 500;
background-color: ${({ theme }) => theme.deprecated_bg1};
&:last-of-type {
margin: 8px 0 0 0;
}
& > div:not(:first-child) { & > div:not(:first-child) {
text-align: center; text-align: center;
} }
:hover { :hover {
background-color: ${({ theme }) => theme.deprecated_bg2}; background-color: ${({ theme }) => theme.hoverDefault};
} }
@media screen and (min-width: ${MEDIA_WIDTHS.deprecated_upToSmall}px) { @media screen and (min-width: ${MEDIA_WIDTHS.deprecated_upToSmall}px) {
...@@ -54,7 +47,7 @@ const LinkRow = styled(Link)` ...@@ -54,7 +47,7 @@ const LinkRow = styled(Link)`
${({ theme }) => theme.deprecated_mediaWidth.deprecated_upToSmall` ${({ theme }) => theme.deprecated_mediaWidth.deprecated_upToSmall`
flex-direction: column; flex-direction: column;
row-gap: 12px; row-gap: 8px;
`}; `};
` `
...@@ -74,29 +67,17 @@ const RangeLineItem = styled(DataLineItem)` ...@@ -74,29 +67,17 @@ const RangeLineItem = styled(DataLineItem)`
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
margin-top: 4px; margin-top: 4px;
width: 100%; width: 100%;
${({ theme }) => theme.deprecated_mediaWidth.deprecated_upToSmall`
background-color: ${({ theme }) => theme.deprecated_bg2};
border-radius: 12px;
padding: 8px 0;
`};
` `
const DoubleArrow = styled.span` const DoubleArrow = styled.span`
margin: 0 2px; margin: 0 2px;
color: ${({ theme }) => theme.deprecated_text3}; color: ${({ theme }) => theme.deprecated_text3};
${({ theme }) => theme.deprecated_mediaWidth.deprecated_upToSmall`
margin: 4px;
padding: 20px;
`};
` `
const RangeText = styled.span` const RangeText = styled.span`
/* background-color: ${({ theme }) => theme.deprecated_bg2}; */ padding: 0.25rem 0.25rem;
padding: 0.25rem 0.5rem;
border-radius: 8px; border-radius: 8px;
` `
...@@ -123,7 +104,7 @@ const DataText = styled.div` ...@@ -123,7 +104,7 @@ const DataText = styled.div`
font-size: 18px; font-size: 18px;
${({ theme }) => theme.deprecated_mediaWidth.deprecated_upToSmall` ${({ theme }) => theme.deprecated_mediaWidth.deprecated_upToSmall`
font-size: 14px; font-size: 18px;
`}; `};
` `
......
...@@ -134,10 +134,13 @@ const ResponsiveButtonPrimary = styled(ButtonPrimary)` ...@@ -134,10 +134,13 @@ const ResponsiveButtonPrimary = styled(ButtonPrimary)`
const MainContentWrapper = styled.main` const MainContentWrapper = styled.main`
background-color: ${({ theme }) => theme.deprecated_bg0}; background-color: ${({ theme }) => theme.deprecated_bg0};
padding: 8px; border: 1px solid ${({ theme }) => theme.backgroundOutline};
border-radius: 20px; padding: 0;
border-radius: 16px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.01), 0px 4px 8px rgba(0, 0, 0, 0.04), 0px 16px 24px rgba(0, 0, 0, 0.04),
0px 24px 32px rgba(0, 0, 0, 0.01);
` `
function PositionsLoadingPlaceholder() { function PositionsLoadingPlaceholder() {
...@@ -161,6 +164,7 @@ function PositionsLoadingPlaceholder() { ...@@ -161,6 +164,7 @@ function PositionsLoadingPlaceholder() {
function WrongNetworkCard() { function WrongNetworkCard() {
const theme = useTheme() const theme = useTheme()
return ( return (
<> <>
<PageWrapper> <PageWrapper>
......
...@@ -58,12 +58,13 @@ export const Dots = styled.span` ...@@ -58,12 +58,13 @@ export const Dots = styled.span`
` `
export const LoadingRows = styled(BaseLoadingRows)` export const LoadingRows = styled(BaseLoadingRows)`
padding-top: 48px; padding-top: 36px;
min-width: 75%; min-width: 75%;
max-width: 960px; max-width: 960px;
grid-column-gap: 0.5em; grid-column-gap: 0.5em;
grid-row-gap: 0.8em; grid-row-gap: 0.8em;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(3, 1fr);
padding: 8px;
& > div:nth-child(4n + 1) { & > div:nth-child(4n + 1) {
grid-column: 1 / 3; grid-column: 1 / 3;
......
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