Commit 48855f48 authored by cartcrom's avatar cartcrom Committed by GitHub

feat: animated review expando (#7440)

* feat: animated review expando

* test: update snapshots

* fix: pr comments + spacing
parent f09ded1a
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11.6376 8.86202C11.8982 9.12269 11.8982 9.54407 11.6376 9.80473L8.97089 12.4714C8.84089 12.6014 8.6702 12.6667 8.49954 12.6667C8.32887 12.6667 8.15818 12.6014 8.02818 12.4714L5.36152 9.80473C5.10085 9.54407 5.10085 9.12269 5.36152 8.86202C5.62218 8.60136 6.04356 8.60136 6.30422 8.86202L8.49954 11.0573L10.6948 8.86202C10.9555 8.60136 11.3769 8.60136 11.6376 8.86202ZM6.30422 7.13807L8.49954 4.94275L10.6948 7.13807C10.8248 7.26807 10.9955 7.33338 11.1662 7.33338C11.3369 7.33338 11.5076 7.26807 11.6376 7.13807C11.8982 6.8774 11.8982 6.45602 11.6376 6.19536L8.97089 3.52869C8.71022 3.26802 8.28885 3.26802 8.02818 3.52869L5.36152 6.19536C5.10085 6.45602 5.10085 6.8774 5.36152 7.13807C5.62218 7.39873 6.04356 7.39873 6.30422 7.13807Z" fill="#5E5E5E"/>
</svg>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11.1376 11.5287C11.3982 11.7894 11.3982 12.2107 11.1376 12.4714C11.0076 12.6014 10.8369 12.6667 10.6662 12.6667C10.4955 12.6667 10.3248 12.6014 10.1948 12.4714L7.99954 10.2761L5.80422 12.4714C5.54356 12.7321 5.12218 12.7321 4.86152 12.4714C4.60085 12.2107 4.60085 11.7894 4.86152 11.5287L7.52818 8.86202C7.78885 8.60136 8.21022 8.60136 8.47089 8.86202L11.1376 11.5287ZM7.52818 7.13807C7.65818 7.26807 7.82887 7.33338 7.99954 7.33338C8.1702 7.33338 8.34089 7.26807 8.47089 7.13807L11.1376 4.4714C11.3982 4.21073 11.3982 3.78936 11.1376 3.52869C10.8769 3.26802 10.4555 3.26802 10.1948 3.52869L7.99954 5.724L5.80422 3.52869C5.54356 3.26802 5.12218 3.26802 4.86152 3.52869C4.60085 3.78936 4.60085 4.21073 4.86152 4.4714L7.52818 7.13807Z" fill="#5E5E5E"/>
</svg>
import { animated, useSpring } from 'react-spring' import { animated, useSpring, UseSpringProps } from 'react-spring'
import useResizeObserver from 'use-resize-observer' import useResizeObserver from 'use-resize-observer'
type AnimatedDropdownProps = React.PropsWithChildren<{ open: boolean; springProps?: UseSpringProps }>
/** /**
* @param open conditional to show content or hide * @param open conditional to show content or hide
* @param springProps additional props to include in spring animation
* @returns Wrapper to smoothly hide and expand content * @returns Wrapper to smoothly hide and expand content
*/ */
export default function AnimatedDropdown({ open, children }: React.PropsWithChildren<{ open: boolean }>) { export default function AnimatedDropdown({ open, springProps, children }: AnimatedDropdownProps) {
const { ref, height } = useResizeObserver() const { ref, height } = useResizeObserver()
const props = useSpring({ const props = useSpring({
...@@ -20,6 +22,7 @@ export default function AnimatedDropdown({ open, children }: React.PropsWithChil ...@@ -20,6 +22,7 @@ export default function AnimatedDropdown({ open, children }: React.PropsWithChil
clamp: true, clamp: true,
velocity: 0.01, velocity: 0.01,
}, },
...springProps,
}) })
return ( return (
<animated.div <animated.div
......
...@@ -188,7 +188,7 @@ export function ConfirmationModalContent({ ...@@ -188,7 +188,7 @@ export function ConfirmationModalContent({
</Row> </Row>
{topContent()} {topContent()}
</AutoColumn> </AutoColumn>
{bottomContent && <BottomSection gap="12px">{bottomContent()}</BottomSection>} {bottomContent && <BottomSection gap="16px">{bottomContent()}</BottomSection>}
</Wrapper> </Wrapper>
) )
} }
......
...@@ -9,6 +9,7 @@ import { SUPPORTED_GAS_ESTIMATE_CHAIN_IDS } from 'constants/chains' ...@@ -9,6 +9,7 @@ import { SUPPORTED_GAS_ESTIMATE_CHAIN_IDS } from 'constants/chains'
import useHoverProps from 'hooks/useHoverProps' import useHoverProps from 'hooks/useHoverProps'
import { useIsMobile } from 'nft/hooks' import { useIsMobile } from 'nft/hooks'
import React, { PropsWithChildren, useEffect, useState } from 'react' import React, { PropsWithChildren, useEffect, useState } from 'react'
import { animated, SpringValue } from 'react-spring'
import { InterfaceTrade, TradeFillType } from 'state/routing/types' import { InterfaceTrade, TradeFillType } from 'state/routing/types'
import { isPreviewTrade, isUniswapXTrade } from 'state/routing/utils' import { isPreviewTrade, isUniswapXTrade } from 'state/routing/utils'
import { useUserSlippageTolerance } from 'state/user/hooks' import { useUserSlippageTolerance } from 'state/user/hooks'
...@@ -238,11 +239,12 @@ function ValueWrapper({ children, lineItem, labelHovered, syncing }: ValueWrappe ...@@ -238,11 +239,12 @@ function ValueWrapper({ children, lineItem, labelHovered, syncing }: ValueWrappe
) )
} }
interface SwapLineItemProps { export interface SwapLineItemProps {
trade: InterfaceTrade trade: InterfaceTrade
syncing: boolean syncing: boolean
allowedSlippage: Percent allowedSlippage: Percent
type: SwapLineItemType type: SwapLineItemType
animatedOpacity?: SpringValue<number>
} }
function SwapLineItem(props: SwapLineItemProps) { function SwapLineItem(props: SwapLineItemProps) {
...@@ -252,6 +254,7 @@ function SwapLineItem(props: SwapLineItemProps) { ...@@ -252,6 +254,7 @@ function SwapLineItem(props: SwapLineItemProps) {
if (!LineItem) return null if (!LineItem) return null
return ( return (
<animated.div style={{ opacity: props.animatedOpacity }}>
<RowBetween> <RowBetween>
<LabelText {...hoverProps} hasTooltip={!!LineItem.TooltipBody} data-testid="swap-li-label"> <LabelText {...hoverProps} hasTooltip={!!LineItem.TooltipBody} data-testid="swap-li-label">
<LineItem.Label /> <LineItem.Label />
...@@ -260,6 +263,7 @@ function SwapLineItem(props: SwapLineItemProps) { ...@@ -260,6 +263,7 @@ function SwapLineItem(props: SwapLineItemProps) {
<LineItem.Value /> <LineItem.Value />
</ValueWrapper> </ValueWrapper>
</RowBetween> </RowBetween>
</animated.div>
) )
} }
......
...@@ -2,28 +2,33 @@ import { Trans } from '@lingui/macro' ...@@ -2,28 +2,33 @@ import { Trans } from '@lingui/macro'
import { BrowserEvent, InterfaceElementName, SwapEventName } from '@uniswap/analytics-events' import { BrowserEvent, InterfaceElementName, SwapEventName } from '@uniswap/analytics-events'
import { Percent } from '@uniswap/sdk-core' import { Percent } from '@uniswap/sdk-core'
import { TraceEvent } from 'analytics' import { TraceEvent } from 'analytics'
import AnimatedDropdown from 'components/AnimatedDropdown'
import Column from 'components/Column' import Column from 'components/Column'
import SpinningLoader from 'components/Loader/SpinningLoader' import SpinningLoader from 'components/Loader/SpinningLoader'
import { SwapResult } from 'hooks/useSwapCallback' import { SwapResult } from 'hooks/useSwapCallback'
import useTransactionDeadline from 'hooks/useTransactionDeadline' import useTransactionDeadline from 'hooks/useTransactionDeadline'
import { ReactNode } from 'react' import ms from 'ms'
import { ReactNode, useState } from 'react'
import { AlertTriangle } from 'react-feather' import { AlertTriangle } from 'react-feather'
import { easings, useSpring } from 'react-spring'
import { InterfaceTrade, RouterPreference } from 'state/routing/types' import { InterfaceTrade, RouterPreference } from 'state/routing/types'
import { isClassicTrade } from 'state/routing/utils' import { isClassicTrade } from 'state/routing/utils'
import { useRouterPreference, useUserSlippageTolerance } from 'state/user/hooks' import { useRouterPreference, useUserSlippageTolerance } from 'state/user/hooks'
import styled, { useTheme } from 'styled-components' import styled, { useTheme } from 'styled-components'
import { ThemedText } from 'theme/components' import { Separator, ThemedText } from 'theme/components'
import getRoutingDiagramEntries from 'utils/getRoutingDiagramEntries' import getRoutingDiagramEntries from 'utils/getRoutingDiagramEntries'
import { formatSwapButtonClickEventProperties } from 'utils/loggingFormatters' import { formatSwapButtonClickEventProperties } from 'utils/loggingFormatters'
import { ReactComponent as ExpandoIconClosed } from '../../assets/svg/expando-icon-closed.svg'
import { ReactComponent as ExpandoIconOpened } from '../../assets/svg/expando-icon-opened.svg'
import { ButtonError, SmallButtonPrimary } from '../Button' import { ButtonError, SmallButtonPrimary } from '../Button'
import Row, { AutoRow, RowBetween, RowFixed } from '../Row' import Row, { AutoRow, RowBetween, RowFixed } from '../Row'
import { SwapCallbackError, SwapShowAcceptChanges } from './styled' import { SwapCallbackError, SwapShowAcceptChanges } from './styled'
import { SwapLineItemType } from './SwapLineItem' import { SwapLineItemProps, SwapLineItemType } from './SwapLineItem'
import SwapLineItem from './SwapLineItem' import SwapLineItem from './SwapLineItem'
const DetailsContainer = styled(Column)` const DetailsContainer = styled(Column)`
padding: 0 8px; padding-bottom: 8px;
` `
const StyledAlertTriangle = styled(AlertTriangle)` const StyledAlertTriangle = styled(AlertTriangle)`
...@@ -33,9 +38,45 @@ const StyledAlertTriangle = styled(AlertTriangle)` ...@@ -33,9 +38,45 @@ const StyledAlertTriangle = styled(AlertTriangle)`
const ConfirmButton = styled(ButtonError)` const ConfirmButton = styled(ButtonError)`
height: 56px; height: 56px;
margin-top: 10px;
` `
const DropdownControllerWrapper = styled.div`
display: flex;
align-items: center;
margin-right: -6px;
padding: 0 16px;
min-width: fit-content;
white-space: nowrap;
`
const DropdownButton = styled.button`
padding: 0;
margin-top: 16px;
height: 28px;
text-decoration: none;
display: flex;
background: none;
border: none;
align-items: center;
cursor: pointer;
`
function DropdownController({ open, onClick }: { open: boolean; onClick: () => void }) {
return (
<DropdownButton onClick={onClick}>
<Separator />
<DropdownControllerWrapper>
<ThemedText.BodySmall color="neutral2">
{open ? <Trans>Show less</Trans> : <Trans>Show more</Trans>}
</ThemedText.BodySmall>
{open ? <ExpandoIconOpened /> : <ExpandoIconClosed />}
</DropdownControllerWrapper>
<Separator />
</DropdownButton>
)
}
export default function SwapModalFooter({ export default function SwapModalFooter({
trade, trade,
allowedSlippage, allowedSlippage,
...@@ -66,17 +107,16 @@ export default function SwapModalFooter({ ...@@ -66,17 +107,16 @@ export default function SwapModalFooter({
const [routerPreference] = useRouterPreference() const [routerPreference] = useRouterPreference()
const routes = isClassicTrade(trade) ? getRoutingDiagramEntries(trade) : undefined const routes = isClassicTrade(trade) ? getRoutingDiagramEntries(trade) : undefined
const theme = useTheme() const theme = useTheme()
const [showMore, setShowMore] = useState(false)
const lineItemProps = { trade, allowedSlippage, syncing: false } const lineItemProps = { trade, allowedSlippage, syncing: false }
return ( return (
<> <>
<DropdownController open={showMore} onClick={() => setShowMore(!showMore)} />
<DetailsContainer gap="md"> <DetailsContainer gap="md">
<SwapLineItem {...lineItemProps} type={SwapLineItemType.EXCHANGE_RATE} /> <SwapLineItem {...lineItemProps} type={SwapLineItemType.EXCHANGE_RATE} />
<SwapLineItem {...lineItemProps} type={SwapLineItemType.PRICE_IMPACT} /> <ExpandableLineItems {...lineItemProps} open={showMore} />
<SwapLineItem {...lineItemProps} type={SwapLineItemType.MAX_SLIPPAGE} />
<SwapLineItem {...lineItemProps} type={SwapLineItemType.MAXIMUM_INPUT} />
<SwapLineItem {...lineItemProps} type={SwapLineItemType.MINIMUM_OUTPUT} />
<SwapLineItem {...lineItemProps} type={SwapLineItemType.INPUT_TOKEN_FEE_ON_TRANSFER} /> <SwapLineItem {...lineItemProps} type={SwapLineItemType.INPUT_TOKEN_FEE_ON_TRANSFER} />
<SwapLineItem {...lineItemProps} type={SwapLineItemType.OUTPUT_TOKEN_FEE_ON_TRANSFER} /> <SwapLineItem {...lineItemProps} type={SwapLineItemType.OUTPUT_TOKEN_FEE_ON_TRANSFER} />
<SwapLineItem {...lineItemProps} type={SwapLineItemType.NETWORK_COST} /> <SwapLineItem {...lineItemProps} type={SwapLineItemType.NETWORK_COST} />
...@@ -141,3 +181,43 @@ export default function SwapModalFooter({ ...@@ -141,3 +181,43 @@ export default function SwapModalFooter({
</> </>
) )
} }
function AnimatedLineItem(props: SwapLineItemProps & { open: boolean; delay: number }) {
const { open, delay } = props
const animatedProps = useSpring({
animatedOpacity: open ? 1 : 0,
config: { duration: ms('300ms'), easing: easings.easeOutSine },
delay,
})
return <SwapLineItem {...props} {...animatedProps} />
}
function ExpandableLineItems(props: { trade: InterfaceTrade; allowedSlippage: Percent; open: boolean }) {
const { open, trade, allowedSlippage } = props
if (!trade) return null
const lineItemProps = { trade, allowedSlippage, syncing: false, open }
return (
<AnimatedDropdown
open={open}
springProps={{
marginTop: open ? 0 : -12,
config: {
duration: ms('200ms'),
easing: easings.easeOutSine,
},
}}
>
<Column gap="md">
<AnimatedLineItem {...lineItemProps} type={SwapLineItemType.PRICE_IMPACT} delay={ms('50ms')} />
<AnimatedLineItem {...lineItemProps} type={SwapLineItemType.MAX_SLIPPAGE} delay={ms('100ms')} />
<AnimatedLineItem {...lineItemProps} type={SwapLineItemType.MINIMUM_OUTPUT} delay={ms('120ms')} />
<AnimatedLineItem {...lineItemProps} type={SwapLineItemType.MAXIMUM_INPUT} delay={ms('120ms')} />
</Column>
</AnimatedDropdown>
)
}
...@@ -6,14 +6,10 @@ import { InterfaceTrade } from 'state/routing/types' ...@@ -6,14 +6,10 @@ import { InterfaceTrade } from 'state/routing/types'
import { isPreviewTrade } from 'state/routing/utils' import { isPreviewTrade } from 'state/routing/utils'
import { Field } from 'state/swap/actions' import { Field } from 'state/swap/actions'
import styled from 'styled-components' import styled from 'styled-components'
import { Divider, ThemedText } from 'theme/components' import { ThemedText } from 'theme/components'
import { SwapModalHeaderAmount } from './SwapModalHeaderAmount' import { SwapModalHeaderAmount } from './SwapModalHeaderAmount'
const Rule = styled(Divider)`
margin: 16px 2px 24px 2px;
`
const HeaderContainer = styled(AutoColumn)` const HeaderContainer = styled(AutoColumn)`
margin-top: 16px; margin-top: 16px;
` `
...@@ -50,7 +46,7 @@ export default function SwapModalHeader({ ...@@ -50,7 +46,7 @@ export default function SwapModalHeader({
isLoading={isPreviewTrade(trade) && trade.tradeType === TradeType.EXACT_INPUT} isLoading={isPreviewTrade(trade) && trade.tradeType === TradeType.EXACT_INPUT}
tooltipText={ tooltipText={
trade.tradeType === TradeType.EXACT_INPUT ? ( trade.tradeType === TradeType.EXACT_INPUT ? (
<ThemedText.BodySmall> <ThemedText.Caption>
<Trans> <Trans>
Output is estimated. You will receive at least{' '} Output is estimated. You will receive at least{' '}
<b> <b>
...@@ -58,9 +54,9 @@ export default function SwapModalHeader({ ...@@ -58,9 +54,9 @@ export default function SwapModalHeader({
</b>{' '} </b>{' '}
or the transaction will revert. or the transaction will revert.
</Trans> </Trans>
</ThemedText.BodySmall> </ThemedText.Caption>
) : ( ) : (
<ThemedText.BodySmall> <ThemedText.Caption>
<Trans> <Trans>
Input is estimated. You will sell at most{' '} Input is estimated. You will sell at most{' '}
<b> <b>
...@@ -68,12 +64,11 @@ export default function SwapModalHeader({ ...@@ -68,12 +64,11 @@ export default function SwapModalHeader({
</b>{' '} </b>{' '}
or the transaction will revert. or the transaction will revert.
</Trans> </Trans>
</ThemedText.BodySmall> </ThemedText.Caption>
) )
} }
/> />
</Column> </Column>
<Rule />
</HeaderContainer> </HeaderContainer>
) )
} }
...@@ -61,7 +61,7 @@ export function SwapModalHeaderAmount({ ...@@ -61,7 +61,7 @@ export function SwapModalHeaderAmount({
<Column gap="xs"> <Column gap="xs">
<ThemedText.BodySecondary> <ThemedText.BodySecondary>
<MouseoverTooltip text={tooltipText} disabled={!tooltipText}> <MouseoverTooltip text={tooltipText} disabled={!tooltipText}>
<Label cursor="help">{label}</Label> <Label cursor={tooltipText ? 'help' : undefined}>{label}</Label>
</MouseoverTooltip> </MouseoverTooltip>
</ThemedText.BodySecondary> </ThemedText.BodySecondary>
<Column gap="xs"> <Column gap="xs">
......
...@@ -327,6 +327,7 @@ exports[`SwapDetailsDropdown.tsx renders a trade 1`] = ` ...@@ -327,6 +327,7 @@ exports[`SwapDetailsDropdown.tsx renders a trade 1`] = `
<div <div
class="c18" class="c18"
/> />
<div>
<div <div
class="c2 c3 c4" class="c2 c3 c4"
> >
...@@ -352,6 +353,8 @@ exports[`SwapDetailsDropdown.tsx renders a trade 1`] = ` ...@@ -352,6 +353,8 @@ exports[`SwapDetailsDropdown.tsx renders a trade 1`] = `
</div> </div>
</div> </div>
</div> </div>
</div>
<div>
<div <div
class="c2 c3 c4" class="c2 c3 c4"
> >
...@@ -380,6 +383,8 @@ exports[`SwapDetailsDropdown.tsx renders a trade 1`] = ` ...@@ -380,6 +383,8 @@ exports[`SwapDetailsDropdown.tsx renders a trade 1`] = `
</div> </div>
</div> </div>
</div> </div>
</div>
<div>
<div <div
class="c2 c3 c4" class="c2 c3 c4"
> >
...@@ -434,9 +439,11 @@ exports[`SwapDetailsDropdown.tsx renders a trade 1`] = ` ...@@ -434,9 +439,11 @@ exports[`SwapDetailsDropdown.tsx renders a trade 1`] = `
</div> </div>
</div> </div>
</div> </div>
</div>
<div <div
class="c18" class="c18"
/> />
<div>
<div <div
class="c2 c3 c4" class="c2 c3 c4"
> >
...@@ -466,5 +473,6 @@ exports[`SwapDetailsDropdown.tsx renders a trade 1`] = ` ...@@ -466,5 +473,6 @@ exports[`SwapDetailsDropdown.tsx renders a trade 1`] = `
</div> </div>
</div> </div>
</div> </div>
</div>
</DocumentFragment> </DocumentFragment>
`; `;
...@@ -2,6 +2,74 @@ ...@@ -2,6 +2,74 @@
exports[`SwapModalFooter.tsx matches base snapshot, test trade exact input 1`] = ` exports[`SwapModalFooter.tsx matches base snapshot, test trade exact input 1`] = `
<DocumentFragment> <DocumentFragment>
.c3 {
color: #7D7D7D;
}
.c1 {
width: 100%;
height: 1px;
background-color: #22222212;
}
.c2 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
margin-right: -6px;
padding: 0 16px;
min-width: -webkit-fit-content;
min-width: -moz-fit-content;
min-width: fit-content;
white-space: nowrap;
}
.c0 {
padding: 0;
margin-top: 16px;
height: 28px;
-webkit-text-decoration: none;
text-decoration: none;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
background: none;
border: none;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
cursor: pointer;
}
<button
class="c0"
>
<div
class="c1"
/>
<div
class="c2"
>
<div
class="c3 css-142zc9n"
>
Show more
</div>
<svg>
expando-icon-closed.svg
</svg>
</div>
<div
class="c1"
/>
</button>
.c2 { .c2 {
box-sizing: border-box; box-sizing: border-box;
margin: 0; margin: 0;
...@@ -68,14 +136,14 @@ exports[`SwapModalFooter.tsx matches base snapshot, test trade exact input 1`] = ...@@ -68,14 +136,14 @@ exports[`SwapModalFooter.tsx matches base snapshot, test trade exact input 1`] =
justify-content: space-between; justify-content: space-between;
} }
.c5 {
color: #222222;
}
.c11 { .c11 {
color: #7D7D7D; color: #7D7D7D;
} }
.c5 {
color: #222222;
}
.c0 { .c0 {
display: -webkit-box; display: -webkit-box;
display: -webkit-flex; display: -webkit-flex;
...@@ -151,12 +219,13 @@ exports[`SwapModalFooter.tsx matches base snapshot, test trade exact input 1`] = ...@@ -151,12 +219,13 @@ exports[`SwapModalFooter.tsx matches base snapshot, test trade exact input 1`] =
} }
.c1 { .c1 {
padding: 0 8px; padding-bottom: 8px;
} }
<div <div
class="c0 c1" class="c0 c1"
> >
<div>
<div <div
class="c2 c3 c4" class="c2 c3 c4"
> >
...@@ -188,6 +257,17 @@ exports[`SwapModalFooter.tsx matches base snapshot, test trade exact input 1`] = ...@@ -188,6 +257,17 @@ exports[`SwapModalFooter.tsx matches base snapshot, test trade exact input 1`] =
</div> </div>
</div> </div>
</div> </div>
</div>
<div
style="height: 0px; margin-top: -12px; overflow: hidden; width: 100%; min-width: min-content; will-change: height;"
>
<div>
<div
class="c0"
>
<div
style="opacity: 0;"
>
<div <div
class="c2 c3 c4" class="c2 c3 c4"
> >
...@@ -213,6 +293,10 @@ exports[`SwapModalFooter.tsx matches base snapshot, test trade exact input 1`] = ...@@ -213,6 +293,10 @@ exports[`SwapModalFooter.tsx matches base snapshot, test trade exact input 1`] =
</div> </div>
</div> </div>
</div> </div>
</div>
<div
style="opacity: 0;"
>
<div <div
class="c2 c3 c4" class="c2 c3 c4"
> >
...@@ -241,6 +325,10 @@ exports[`SwapModalFooter.tsx matches base snapshot, test trade exact input 1`] = ...@@ -241,6 +325,10 @@ exports[`SwapModalFooter.tsx matches base snapshot, test trade exact input 1`] =
</div> </div>
</div> </div>
</div> </div>
</div>
<div
style="opacity: 0;"
>
<div <div
class="c2 c3 c4" class="c2 c3 c4"
> >
...@@ -262,6 +350,11 @@ exports[`SwapModalFooter.tsx matches base snapshot, test trade exact input 1`] = ...@@ -262,6 +350,11 @@ exports[`SwapModalFooter.tsx matches base snapshot, test trade exact input 1`] =
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
</div>
</div>
<div>
<div <div
class="c2 c3 c4" class="c2 c3 c4"
> >
...@@ -317,6 +410,7 @@ exports[`SwapModalFooter.tsx matches base snapshot, test trade exact input 1`] = ...@@ -317,6 +410,7 @@ exports[`SwapModalFooter.tsx matches base snapshot, test trade exact input 1`] =
</div> </div>
</div> </div>
</div> </div>
</div>
.c0 { .c0 {
box-sizing: border-box; box-sizing: border-box;
margin: 0; margin: 0;
...@@ -467,7 +561,6 @@ exports[`SwapModalFooter.tsx matches base snapshot, test trade exact input 1`] = ...@@ -467,7 +561,6 @@ exports[`SwapModalFooter.tsx matches base snapshot, test trade exact input 1`] =
.c6 { .c6 {
height: 56px; height: 56px;
margin-top: 10px;
} }
<div <div
...@@ -490,6 +583,78 @@ exports[`SwapModalFooter.tsx matches base snapshot, test trade exact input 1`] = ...@@ -490,6 +583,78 @@ exports[`SwapModalFooter.tsx matches base snapshot, test trade exact input 1`] =
exports[`SwapModalFooter.tsx renders a preview trade while disabling submission 1`] = ` exports[`SwapModalFooter.tsx renders a preview trade while disabling submission 1`] = `
<DocumentFragment> <DocumentFragment>
.c3 {
color: #7D7D7D;
}
.c1 {
width: 100%;
height: 1px;
background-color: #22222212;
}
.c2 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
margin-right: -6px;
padding: 0 16px;
min-width: -webkit-fit-content;
min-width: -moz-fit-content;
min-width: fit-content;
white-space: nowrap;
}
.c0 {
padding: 0;
margin-top: 16px;
height: 28px;
-webkit-text-decoration: none;
text-decoration: none;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
background: none;
border: none;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
cursor: pointer;
}
@media (max-width:960px) {
}
<button
class="c0"
>
<div
class="c1"
/>
<div
class="c2"
>
<div
class="c3 css-142zc9n"
>
Show more
</div>
<svg>
expando-icon-closed.svg
</svg>
</div>
<div
class="c1"
/>
</button>
.c2 { .c2 {
box-sizing: border-box; box-sizing: border-box;
margin: 0; margin: 0;
...@@ -538,14 +703,14 @@ exports[`SwapModalFooter.tsx renders a preview trade while disabling submission ...@@ -538,14 +703,14 @@ exports[`SwapModalFooter.tsx renders a preview trade while disabling submission
justify-content: space-between; justify-content: space-between;
} }
.c5 {
color: #222222;
}
.c13 { .c13 {
color: #7D7D7D; color: #7D7D7D;
} }
.c5 {
color: #222222;
}
.c0 { .c0 {
display: -webkit-box; display: -webkit-box;
display: -webkit-flex; display: -webkit-flex;
...@@ -639,7 +804,7 @@ exports[`SwapModalFooter.tsx renders a preview trade while disabling submission ...@@ -639,7 +804,7 @@ exports[`SwapModalFooter.tsx renders a preview trade while disabling submission
} }
.c1 { .c1 {
padding: 0 8px; padding-bottom: 8px;
} }
@media (max-width:960px) { @media (max-width:960px) {
...@@ -649,6 +814,7 @@ exports[`SwapModalFooter.tsx renders a preview trade while disabling submission ...@@ -649,6 +814,7 @@ exports[`SwapModalFooter.tsx renders a preview trade while disabling submission
<div <div
class="c0 c1" class="c0 c1"
> >
<div>
<div <div
class="c2 c3 c4" class="c2 c3 c4"
> >
...@@ -674,6 +840,17 @@ exports[`SwapModalFooter.tsx renders a preview trade while disabling submission ...@@ -674,6 +840,17 @@ exports[`SwapModalFooter.tsx renders a preview trade while disabling submission
</button> </button>
</div> </div>
</div> </div>
</div>
<div
style="height: 0px; margin-top: -12px; overflow: hidden; width: 100%; min-width: min-content; will-change: height;"
>
<div>
<div
class="c0"
>
<div
style="opacity: 0;"
>
<div <div
class="c2 c3 c4" class="c2 c3 c4"
> >
...@@ -700,6 +877,10 @@ exports[`SwapModalFooter.tsx renders a preview trade while disabling submission ...@@ -700,6 +877,10 @@ exports[`SwapModalFooter.tsx renders a preview trade while disabling submission
</div> </div>
</div> </div>
</div> </div>
</div>
<div
style="opacity: 0;"
>
<div <div
class="c2 c3 c4" class="c2 c3 c4"
> >
...@@ -728,6 +909,10 @@ exports[`SwapModalFooter.tsx renders a preview trade while disabling submission ...@@ -728,6 +909,10 @@ exports[`SwapModalFooter.tsx renders a preview trade while disabling submission
</div> </div>
</div> </div>
</div> </div>
</div>
<div
style="opacity: 0;"
>
<div <div
class="c2 c3 c4" class="c2 c3 c4"
> >
...@@ -749,6 +934,11 @@ exports[`SwapModalFooter.tsx renders a preview trade while disabling submission ...@@ -749,6 +934,11 @@ exports[`SwapModalFooter.tsx renders a preview trade while disabling submission
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
</div>
</div>
<div>
<div <div
class="c2 c3 c4" class="c2 c3 c4"
> >
...@@ -776,6 +966,7 @@ exports[`SwapModalFooter.tsx renders a preview trade while disabling submission ...@@ -776,6 +966,7 @@ exports[`SwapModalFooter.tsx renders a preview trade while disabling submission
</div> </div>
</div> </div>
</div> </div>
</div>
.c0 { .c0 {
box-sizing: border-box; box-sizing: border-box;
margin: 0; margin: 0;
...@@ -977,7 +1168,6 @@ exports[`SwapModalFooter.tsx renders a preview trade while disabling submission ...@@ -977,7 +1168,6 @@ exports[`SwapModalFooter.tsx renders a preview trade while disabling submission
.c6 { .c6 {
height: 56px; height: 56px;
margin-top: 10px;
} }
@media (max-width:960px) { @media (max-width:960px) {
......
...@@ -34,14 +34,6 @@ exports[`SwapModalHeader.tsx matches base snapshot, test trade exact input 1`] = ...@@ -34,14 +34,6 @@ exports[`SwapModalHeader.tsx matches base snapshot, test trade exact input 1`] =
color: #222222; color: #222222;
} }
.c13 {
width: 100%;
height: 1px;
border-width: 0;
margin: 0;
background-color: #22222212;
}
.c2 { .c2 {
display: -webkit-box; display: -webkit-box;
display: -webkit-flex; display: -webkit-flex;
...@@ -111,13 +103,14 @@ exports[`SwapModalHeader.tsx matches base snapshot, test trade exact input 1`] = ...@@ -111,13 +103,14 @@ exports[`SwapModalHeader.tsx matches base snapshot, test trade exact input 1`] =
} }
.c9 { .c9 {
cursor: help;
color: #7D7D7D; color: #7D7D7D;
margin-right: 8px; margin-right: 8px;
} }
.c14 { .c13 {
margin: 16px 2px 24px 2px; cursor: help;
color: #7D7D7D;
margin-right: 8px;
} }
.c1 { .c1 {
...@@ -145,7 +138,6 @@ exports[`SwapModalHeader.tsx matches base snapshot, test trade exact input 1`] = ...@@ -145,7 +138,6 @@ exports[`SwapModalHeader.tsx matches base snapshot, test trade exact input 1`] =
<div> <div>
<div <div
class="c8 c9 css-142zc9n" class="c8 c9 css-142zc9n"
cursor="help"
> >
You pay You pay
</div> </div>
...@@ -192,7 +184,7 @@ exports[`SwapModalHeader.tsx matches base snapshot, test trade exact input 1`] = ...@@ -192,7 +184,7 @@ exports[`SwapModalHeader.tsx matches base snapshot, test trade exact input 1`] =
> >
<div> <div>
<div <div
class="c8 c9 css-142zc9n" class="c8 c13 css-142zc9n"
cursor="help" cursor="help"
> >
You receive You receive
...@@ -227,9 +219,6 @@ exports[`SwapModalHeader.tsx matches base snapshot, test trade exact input 1`] = ...@@ -227,9 +219,6 @@ exports[`SwapModalHeader.tsx matches base snapshot, test trade exact input 1`] =
</div> </div>
</div> </div>
</div> </div>
<div
class="c13 c14"
/>
</div> </div>
</DocumentFragment> </DocumentFragment>
`; `;
...@@ -268,14 +257,6 @@ exports[`SwapModalHeader.tsx renders ETH input token for an ETH input UniswapX s ...@@ -268,14 +257,6 @@ exports[`SwapModalHeader.tsx renders ETH input token for an ETH input UniswapX s
color: #222222; color: #222222;
} }
.c13 {
width: 100%;
height: 1px;
border-width: 0;
margin: 0;
background-color: #22222212;
}
.c2 { .c2 {
display: -webkit-box; display: -webkit-box;
display: -webkit-flex; display: -webkit-flex;
...@@ -345,13 +326,14 @@ exports[`SwapModalHeader.tsx renders ETH input token for an ETH input UniswapX s ...@@ -345,13 +326,14 @@ exports[`SwapModalHeader.tsx renders ETH input token for an ETH input UniswapX s
} }
.c9 { .c9 {
cursor: help;
color: #7D7D7D; color: #7D7D7D;
margin-right: 8px; margin-right: 8px;
} }
.c14 { .c13 {
margin: 16px 2px 24px 2px; cursor: help;
color: #7D7D7D;
margin-right: 8px;
} }
.c1 { .c1 {
...@@ -379,7 +361,6 @@ exports[`SwapModalHeader.tsx renders ETH input token for an ETH input UniswapX s ...@@ -379,7 +361,6 @@ exports[`SwapModalHeader.tsx renders ETH input token for an ETH input UniswapX s
<div> <div>
<div <div
class="c8 c9 css-142zc9n" class="c8 c9 css-142zc9n"
cursor="help"
> >
You pay You pay
</div> </div>
...@@ -426,7 +407,7 @@ exports[`SwapModalHeader.tsx renders ETH input token for an ETH input UniswapX s ...@@ -426,7 +407,7 @@ exports[`SwapModalHeader.tsx renders ETH input token for an ETH input UniswapX s
> >
<div> <div>
<div <div
class="c8 c9 css-142zc9n" class="c8 c13 css-142zc9n"
cursor="help" cursor="help"
> >
You receive You receive
...@@ -461,9 +442,6 @@ exports[`SwapModalHeader.tsx renders ETH input token for an ETH input UniswapX s ...@@ -461,9 +442,6 @@ exports[`SwapModalHeader.tsx renders ETH input token for an ETH input UniswapX s
</div> </div>
</div> </div>
</div> </div>
<div
class="c13 c14"
/>
</div> </div>
</DocumentFragment> </DocumentFragment>
`; `;
...@@ -502,14 +480,6 @@ exports[`SwapModalHeader.tsx renders preview trades with loading states 1`] = ` ...@@ -502,14 +480,6 @@ exports[`SwapModalHeader.tsx renders preview trades with loading states 1`] = `
color: #222222; color: #222222;
} }
.c13 {
width: 100%;
height: 1px;
border-width: 0;
margin: 0;
background-color: #22222212;
}
.c2 { .c2 {
display: -webkit-box; display: -webkit-box;
display: -webkit-flex; display: -webkit-flex;
...@@ -579,13 +549,14 @@ exports[`SwapModalHeader.tsx renders preview trades with loading states 1`] = ` ...@@ -579,13 +549,14 @@ exports[`SwapModalHeader.tsx renders preview trades with loading states 1`] = `
} }
.c9 { .c9 {
cursor: help;
color: #7D7D7D; color: #7D7D7D;
margin-right: 8px; margin-right: 8px;
} }
.c14 { .c13 {
margin: 16px 2px 24px 2px; cursor: help;
color: #7D7D7D;
margin-right: 8px;
} }
.c1 { .c1 {
...@@ -613,7 +584,6 @@ exports[`SwapModalHeader.tsx renders preview trades with loading states 1`] = ` ...@@ -613,7 +584,6 @@ exports[`SwapModalHeader.tsx renders preview trades with loading states 1`] = `
<div> <div>
<div <div
class="c8 c9 css-142zc9n" class="c8 c9 css-142zc9n"
cursor="help"
> >
You pay You pay
</div> </div>
...@@ -660,7 +630,7 @@ exports[`SwapModalHeader.tsx renders preview trades with loading states 1`] = ` ...@@ -660,7 +630,7 @@ exports[`SwapModalHeader.tsx renders preview trades with loading states 1`] = `
> >
<div> <div>
<div <div
class="c8 c9 css-142zc9n" class="c8 c13 css-142zc9n"
cursor="help" cursor="help"
> >
You receive You receive
...@@ -695,9 +665,6 @@ exports[`SwapModalHeader.tsx renders preview trades with loading states 1`] = ` ...@@ -695,9 +665,6 @@ exports[`SwapModalHeader.tsx renders preview trades with loading states 1`] = `
</div> </div>
</div> </div>
</div> </div>
<div
class="c13 c14"
/>
</div> </div>
</DocumentFragment> </DocumentFragment>
`; `;
...@@ -736,14 +703,6 @@ exports[`SwapModalHeader.tsx test trade exact output, no recipient 1`] = ` ...@@ -736,14 +703,6 @@ exports[`SwapModalHeader.tsx test trade exact output, no recipient 1`] = `
color: #222222; color: #222222;
} }
.c13 {
width: 100%;
height: 1px;
border-width: 0;
margin: 0;
background-color: #22222212;
}
.c2 { .c2 {
display: -webkit-box; display: -webkit-box;
display: -webkit-flex; display: -webkit-flex;
...@@ -813,13 +772,14 @@ exports[`SwapModalHeader.tsx test trade exact output, no recipient 1`] = ` ...@@ -813,13 +772,14 @@ exports[`SwapModalHeader.tsx test trade exact output, no recipient 1`] = `
} }
.c9 { .c9 {
cursor: help;
color: #7D7D7D; color: #7D7D7D;
margin-right: 8px; margin-right: 8px;
} }
.c14 { .c13 {
margin: 16px 2px 24px 2px; cursor: help;
color: #7D7D7D;
margin-right: 8px;
} }
.c1 { .c1 {
...@@ -847,7 +807,6 @@ exports[`SwapModalHeader.tsx test trade exact output, no recipient 1`] = ` ...@@ -847,7 +807,6 @@ exports[`SwapModalHeader.tsx test trade exact output, no recipient 1`] = `
<div> <div>
<div <div
class="c8 c9 css-142zc9n" class="c8 c9 css-142zc9n"
cursor="help"
> >
You pay You pay
</div> </div>
...@@ -894,7 +853,7 @@ exports[`SwapModalHeader.tsx test trade exact output, no recipient 1`] = ` ...@@ -894,7 +853,7 @@ exports[`SwapModalHeader.tsx test trade exact output, no recipient 1`] = `
> >
<div> <div>
<div <div
class="c8 c9 css-142zc9n" class="c8 c13 css-142zc9n"
cursor="help" cursor="help"
> >
You receive You receive
...@@ -929,9 +888,6 @@ exports[`SwapModalHeader.tsx test trade exact output, no recipient 1`] = ` ...@@ -929,9 +888,6 @@ exports[`SwapModalHeader.tsx test trade exact output, no recipient 1`] = `
</div> </div>
</div> </div>
</div> </div>
<div
class="c13 c14"
/>
</div> </div>
</DocumentFragment> </DocumentFragment>
`; `;
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