Commit ec3552bb authored by Jack Short's avatar Jack Short Committed by GitHub

style: updating bag styles (#4724)

* updating footer

* bag optimizations

* correct margins for price change rows

* pay button color

* adding fiat values

* using bodySmall
parent 57836026
...@@ -17,7 +17,7 @@ export const bagContainer = style([ ...@@ -17,7 +17,7 @@ export const bagContainer = style([
{ {
'@media': { '@media': {
[`(min-width: ${breakpoints.md}px)`]: { [`(min-width: ${breakpoints.md}px)`]: {
width: '316px', width: '360px',
height: 'calc(100vh - 72px)', height: 'calc(100vh - 72px)',
}, },
}, },
...@@ -26,7 +26,7 @@ export const bagContainer = style([ ...@@ -26,7 +26,7 @@ export const bagContainer = style([
export const assetsContainer = style([ export const assetsContainer = style([
sprinkles({ sprinkles({
paddingX: '32', paddingX: '16',
maxHeight: 'full', maxHeight: 'full',
overflowY: 'scroll', overflowY: 'scroll',
}), }),
......
...@@ -323,6 +323,7 @@ const Bag = () => { ...@@ -323,6 +323,7 @@ const Bag = () => {
{unavailableAssets.length > 0 && ( {unavailableAssets.length > 0 && (
<UnavailableAssetsHeaderRow <UnavailableAssetsHeaderRow
assets={unavailableAssets} assets={unavailableAssets}
usdPrice={fetchedPriceData}
clearUnavailableAssets={() => setItemsInBag(availableItems)} clearUnavailableAssets={() => setItemsInBag(availableItems)}
didOpenUnavailableAssets={didOpenUnavailableAssets} didOpenUnavailableAssets={didOpenUnavailableAssets}
setDidOpenUnavailableAssets={setDidOpenUnavailableAssets} setDidOpenUnavailableAssets={setDidOpenUnavailableAssets}
...@@ -333,6 +334,7 @@ const Bag = () => { ...@@ -333,6 +334,7 @@ const Bag = () => {
<PriceChangeBagRow <PriceChangeBagRow
key={asset.id} key={asset.id}
asset={asset} asset={asset}
usdPrice={fetchedPriceData}
markAssetAsReviewed={markAssetAsReviewed} markAssetAsReviewed={markAssetAsReviewed}
top={index === 0 && unavailableAssets.length === 0} top={index === 0 && unavailableAssets.length === 0}
isMobile={isMobile} isMobile={isMobile}
...@@ -344,6 +346,7 @@ const Bag = () => { ...@@ -344,6 +346,7 @@ const Bag = () => {
<BagRow <BagRow
key={asset.id} key={asset.id}
asset={asset} asset={asset}
usdPrice={fetchedPriceData}
removeAsset={removeAssetFromBag} removeAsset={removeAssetFromBag}
showRemove={true} showRemove={true}
isMobile={isMobile} isMobile={isMobile}
......
...@@ -9,7 +9,7 @@ export const footerContainer = sprinkles({ ...@@ -9,7 +9,7 @@ export const footerContainer = sprinkles({
export const footer = style([ export const footer = style([
sprinkles({ sprinkles({
background: 'backgroundSurface', background: 'backgroundModule',
color: 'textPrimary', color: 'textPrimary',
paddingX: '16', paddingX: '16',
paddingY: '12', paddingY: '12',
...@@ -38,7 +38,6 @@ export const payButton = style([ ...@@ -38,7 +38,6 @@ export const payButton = style([
body, body,
sprinkles({ sprinkles({
background: 'blue400', background: 'blue400',
color: 'textPrimary',
border: 'none', border: 'none',
borderRadius: '12', borderRadius: '12',
paddingY: '12', paddingY: '12',
...@@ -54,19 +53,3 @@ export const payButton = style([ ...@@ -54,19 +53,3 @@ export const payButton = style([
}, },
}, },
]) ])
export const ethPill = style([
sprinkles({
background: 'backgroundSurface',
gap: '8',
paddingY: '4',
paddingLeft: '4',
paddingRight: '12',
fontSize: '20',
fontWeight: 'semibold',
borderRadius: 'round',
}),
{
lineHeight: '24px',
},
])
import { BigNumber } from '@ethersproject/bignumber' import { BigNumber } from '@ethersproject/bignumber'
import ethereumLogoUrl from 'assets/images/ethereum-logo.png'
import Loader from 'components/Loader' import Loader from 'components/Loader'
import { Box } from 'nft/components/Box' import { Box } from 'nft/components/Box'
import { Column, Row } from 'nft/components/Flex' import { Column, Row } from 'nft/components/Flex'
import { bodySmall, headlineMedium, subheadSmall } from 'nft/css/common.css' import { bodySmall, headlineSmall } from 'nft/css/common.css'
import { BagStatus } from 'nft/types' import { BagStatus } from 'nft/types'
import { ethNumberStandardFormatter, formatWeiToDecimal } from 'nft/utils/currency' import { ethNumberStandardFormatter, formatWeiToDecimal } from 'nft/utils'
import { useModalIsOpen, useToggleWalletModal } from 'state/application/hooks' import { useModalIsOpen, useToggleWalletModal } from 'state/application/hooks'
import { ApplicationModal } from 'state/application/reducer' import { ApplicationModal } from 'state/application/reducer'
...@@ -61,20 +60,18 @@ export const BagFooter = ({ ...@@ -61,20 +60,18 @@ export const BagFooter = ({
borderTopRightRadius={showWarning ? '0' : '12'} borderTopRightRadius={showWarning ? '0' : '12'}
className={styles.footer} className={styles.footer}
> >
<Box marginBottom="8" style={{ lineHeight: '20px', opacity: '0.54' }} className={subheadSmall}> <Column gap="4" paddingTop="8" paddingBottom="20">
Total
</Box>
<Column marginBottom="16">
<Row justifyContent="space-between"> <Row justifyContent="space-between">
<Box className={headlineMedium}>{`${formatWeiToDecimal(totalEthPrice.toString())}`}</Box> <Box fontWeight="semibold" className={headlineSmall}>
<Row className={styles.ethPill}> Total
<Box as="img" src={ethereumLogoUrl} alt="Ethereum" width="24" height="24" /> </Box>
ETH <Box fontWeight="semibold" className={headlineSmall}>
</Row> {`${formatWeiToDecimal(totalEthPrice.toString())} ETH`}
</Box>
</Row> </Row>
<Box fontWeight="normal" style={{ lineHeight: '20px', opacity: '0.6' }} className={bodySmall}> <Row justifyContent="flex-end" color="textSecondary" className={bodySmall}>
{`${ethNumberStandardFormatter(totalUsdPrice, true)}`} {`${ethNumberStandardFormatter(totalUsdPrice, true)}`}
</Box> </Row>
</Column> </Column>
<Row <Row
as="button" as="button"
...@@ -89,7 +86,7 @@ export const BagFooter = ({ ...@@ -89,7 +86,7 @@ export const BagFooter = ({
} }
}} }}
> >
{isPending && <Loader size="20px" stroke="backgroundSurface" />} {isPending && <Loader size="20px" stroke="white" />}
{!isConnected || walletModalIsOpen {!isConnected || walletModalIsOpen
? 'Connect wallet' ? 'Connect wallet'
: bagStatus === BagStatus.FETCHING_FINAL_ROUTE || bagStatus === BagStatus.CONFIRMING_IN_WALLET : bagStatus === BagStatus.FETCHING_FINAL_ROUTE || bagStatus === BagStatus.CONFIRMING_IN_WALLET
......
...@@ -5,7 +5,8 @@ import { sprinkles, themeVars, vars } from 'nft/css/sprinkles.css' ...@@ -5,7 +5,8 @@ import { sprinkles, themeVars, vars } from 'nft/css/sprinkles.css'
export const bagRow = style([ export const bagRow = style([
sprinkles({ sprinkles({
color: 'textPrimary', color: 'textPrimary',
padding: '4', paddingX: '12',
paddingY: '8',
gap: '12', gap: '12',
cursor: 'pointer', cursor: 'pointer',
height: 'full', height: 'full',
...@@ -15,7 +16,7 @@ export const bagRow = style([ ...@@ -15,7 +16,7 @@ export const bagRow = style([
marginLeft: '-4px', marginLeft: '-4px',
marginRight: '-4px', marginRight: '-4px',
':hover': { ':hover': {
background: themeVars.colors.backgroundOutline, background: themeVars.colors.backgroundModule,
}, },
}, },
]) ])
...@@ -25,6 +26,7 @@ export const unavailableAssetsContainer = sprinkles({ ...@@ -25,6 +26,7 @@ export const unavailableAssetsContainer = sprinkles({
gap: '12', gap: '12',
color: 'textPrimary', color: 'textPrimary',
paddingY: '16', paddingY: '16',
marginX: '8',
borderStyle: 'solid', borderStyle: 'solid',
borderWidth: '1px', borderWidth: '1px',
borderColor: 'transparent', borderColor: 'transparent',
...@@ -38,6 +40,7 @@ export const priceChangeColumn = sprinkles({ ...@@ -38,6 +40,7 @@ export const priceChangeColumn = sprinkles({
gap: '8', gap: '8',
color: 'textPrimary', color: 'textPrimary',
paddingY: '16', paddingY: '16',
marginX: '8',
borderStyle: 'solid', borderStyle: 'solid',
borderWidth: '1px', borderWidth: '1px',
borderColor: 'transparent', borderColor: 'transparent',
...@@ -47,15 +50,11 @@ export const priceChangeColumn = sprinkles({ ...@@ -47,15 +50,11 @@ export const priceChangeColumn = sprinkles({
}) })
export const priceChangeRow = style([ export const priceChangeRow = style([
bodySmall,
sprinkles({ sprinkles({
color: 'textTertiary', color: 'gold',
gap: '4', gap: '4',
fontSize: '14',
fontWeight: 'normal',
}), }),
{
lineHeight: '20px',
},
]) ])
export const unavailableAssetRow = style([ export const unavailableAssetRow = style([
...@@ -113,9 +112,20 @@ export const removeButton = style([ ...@@ -113,9 +112,20 @@ export const removeButton = style([
}, },
]) ])
export const removeBagRowButton = style([
buttonTextSmall,
sprinkles({
background: 'backgroundInteractive',
color: 'textPrimary',
paddingX: '14',
paddingY: '12',
borderRadius: '12',
}),
])
export const bagRowImage = sprinkles({ export const bagRowImage = sprinkles({
width: '72', width: '56',
height: '72', height: '56',
borderRadius: '8', borderRadius: '8',
}) })
...@@ -132,19 +142,12 @@ export const unavailableImage = style([ ...@@ -132,19 +142,12 @@ export const unavailableImage = style([
}), }),
]) ])
export const removeAssetOverlay = style([
sprinkles({
position: 'absolute',
right: '4',
top: '4',
}),
])
export const bagRowPrice = style([ export const bagRowPrice = style([
sprinkles({ sprinkles({
gap: '4', gap: '4',
fontSize: '16', fontSize: '16',
fontWeight: 'normal', fontWeight: 'semibold',
flexShrink: '0',
}), }),
{ {
lineHeight: '24px', lineHeight: '24px',
...@@ -153,27 +156,25 @@ export const bagRowPrice = style([ ...@@ -153,27 +156,25 @@ export const bagRowPrice = style([
export const assetName = style([ export const assetName = style([
sprinkles({ sprinkles({
fontSize: '14', fontSize: '16',
fontWeight: 'semibold', fontWeight: 'medium',
overflow: 'hidden', overflow: 'hidden',
textOverflow: 'ellipsis', textOverflow: 'ellipsis',
whiteSpace: 'nowrap', whiteSpace: 'nowrap',
}), }),
{ {
lineHeight: '20px', lineHeight: '24px',
}, },
]) ])
export const collectionName = style([ export const collectionName = style([
buttonTextSmall, bodySmall,
sprinkles({ sprinkles({
overflow: 'hidden', overflow: 'hidden',
whiteSpace: 'nowrap', whiteSpace: 'nowrap',
textOverflow: 'ellipsis', textOverflow: 'ellipsis',
color: 'textSecondary',
}), }),
{
lineHeight: '20px',
},
]) ])
export const icon = sprinkles({ export const icon = sprinkles({
......
This diff is collapsed.
export * from './asset'
export * from './buildActivityAsset' export * from './buildActivityAsset'
export * from './buildSellObject' export * from './buildSellObject'
export * from './calcPoolPrice' export * from './calcPoolPrice'
......
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