Commit 16bb9470 authored by Charles Bachmeier's avatar Charles Bachmeier Committed by GitHub

feat: [ListV2] Changes based off Bug Bash (#5936)

* duration wrap

* better styling a different breakpoints

* throw error on listing same price

* don't show spinner on v2

* remove unused check

---------
Co-authored-by: default avatarCharles Bachmeier <charlie@genie.xyz>
parent 6dcfca24
...@@ -111,7 +111,7 @@ export const ListingButton = ({ onClick, buttonText, showWarningOverride = false ...@@ -111,7 +111,7 @@ export const ListingButton = ({ onClick, buttonText, showWarningOverride = false
!listing.overrideFloorPrice !listing.overrideFloorPrice
) )
listingsBelowFloor.push([asset, listing]) listingsBelowFloor.push([asset, listing])
else if (asset.floor_sell_order_price && listing.price > asset.floor_sell_order_price) else if (asset.floor_sell_order_price && listing.price >= asset.floor_sell_order_price)
listingsAboveSellOrderFloor.push([asset, listing]) listingsAboveSellOrderFloor.push([asset, listing])
} }
} }
...@@ -286,10 +286,18 @@ export const ListingButton = ({ onClick, buttonText, showWarningOverride = false ...@@ -286,10 +286,18 @@ export const ListingButton = ({ onClick, buttonText, showWarningOverride = false
}} }}
> >
{listingStatus === ListingStatus.SIGNING || listingStatus === ListingStatus.PENDING ? ( {listingStatus === ListingStatus.SIGNING || listingStatus === ListingStatus.PENDING ? (
<Row gap="8"> isNftListV2 ? (
<LoadingIcon stroke="backgroundSurface" height="20" width="20" /> listingStatus === ListingStatus.PENDING ? (
{listingStatus === ListingStatus.PENDING ? 'Pending' : 'Proceed in wallet'} 'Pending'
</Row> ) : (
'Proceed in wallet'
)
) : (
<Row gap="8">
<LoadingIcon stroke="backgroundSurface" height="20" width="20" />
{listingStatus === ListingStatus.PENDING ? 'Pending' : 'Proceed in wallet'}
</Row>
)
) : listingStatus === ListingStatus.APPROVED ? ( ) : listingStatus === ListingStatus.APPROVED ? (
'Complete!' 'Complete!'
) : listingStatus === ListingStatus.PAUSED ? ( ) : listingStatus === ListingStatus.PAUSED ? (
......
...@@ -12,7 +12,7 @@ import { BackArrowIcon } from 'nft/components/icons' ...@@ -12,7 +12,7 @@ import { BackArrowIcon } from 'nft/components/icons'
import { headlineLarge, headlineSmall } from 'nft/css/common.css' import { headlineLarge, headlineSmall } from 'nft/css/common.css'
import { themeVars } from 'nft/css/sprinkles.css' import { themeVars } from 'nft/css/sprinkles.css'
import { useBag, useIsMobile, useNFTList, useProfilePageState, useSellAsset } from 'nft/hooks' import { useBag, useIsMobile, useNFTList, useProfilePageState, useSellAsset } from 'nft/hooks'
import { LIST_PAGE_MARGIN, LIST_PAGE_MARGIN_MOBILE } from 'nft/pages/profile/shared' import { LIST_PAGE_MARGIN, LIST_PAGE_MARGIN_MOBILE, LIST_PAGE_MARGIN_TABLET } from 'nft/pages/profile/shared'
import { looksRareNonceFetcher } from 'nft/queries' import { looksRareNonceFetcher } from 'nft/queries'
import { ListingStatus, ProfilePageStateType } from 'nft/types' import { ListingStatus, ProfilePageStateType } from 'nft/types'
import { fetchPrice, formatEth, formatUsdPrice } from 'nft/utils' import { fetchPrice, formatEth, formatUsdPrice } from 'nft/utils'
...@@ -105,11 +105,15 @@ const FloatingConfirmationBar = styled(Row)` ...@@ -105,11 +105,15 @@ const FloatingConfirmationBar = styled(Row)`
max-width: 1200px; max-width: 1200px;
z-index: ${Z_INDEX.under_dropdown}; z-index: ${Z_INDEX.under_dropdown};
@media screen and (max-width: ${BREAKPOINTS.sm}px) { @media screen and (max-width: ${BREAKPOINTS.lg}px) {
width: calc(100% - ${LIST_PAGE_MARGIN_MOBILE * 2}px); width: calc(100% - ${LIST_PAGE_MARGIN_TABLET * 2}px);
bottom: 68px; bottom: 68px;
padding: 16px 12px; padding: 16px 12px;
} }
@media screen and (max-width: ${BREAKPOINTS.sm}px) {
width: calc(100% - ${LIST_PAGE_MARGIN_MOBILE * 2}px);
}
` `
const Overlay = styled.div` const Overlay = styled.div`
...@@ -120,6 +124,16 @@ const Overlay = styled.div` ...@@ -120,6 +124,16 @@ const Overlay = styled.div`
background: ${({ theme }) => `linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, ${theme.backgroundBackdrop} 100%)`}; background: ${({ theme }) => `linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, ${theme.backgroundBackdrop} 100%)`};
` `
const UsdValue = styled(ThemedText.SubHeader)`
line-height: 24px;
color: ${({ theme }) => theme.textSecondary};
display: none;
@media screen and (min-width: ${BREAKPOINTS.lg}px) {
display: flex;
}
`
const ProceedsAndButtonWrapper = styled(Row)` const ProceedsAndButtonWrapper = styled(Row)`
width: min-content; width: min-content;
gap: 40px; gap: 40px;
...@@ -150,7 +164,7 @@ const ListingButtonWrapper = styled.div` ...@@ -150,7 +164,7 @@ const ListingButtonWrapper = styled.div`
width: 170px; width: 170px;
@media screen and (max-width: ${BREAKPOINTS.sm}px) { @media screen and (max-width: ${BREAKPOINTS.sm}px) {
width: 95px; width: max-content;
} }
` `
...@@ -304,10 +318,8 @@ export const ListPage = () => { ...@@ -304,10 +318,8 @@ export const ListPage = () => {
<EthValueWrapper totalEthListingValue={!!totalEthListingValue}> <EthValueWrapper totalEthListingValue={!!totalEthListingValue}>
{totalEthListingValue > 0 ? formatEth(totalEthListingValue) : '-'} ETH {totalEthListingValue > 0 ? formatEth(totalEthListingValue) : '-'} ETH
</EthValueWrapper> </EthValueWrapper>
{!!totalEthListingValue && !!ethPriceInUSD && !isMobile && ( {!!totalEthListingValue && !!ethPriceInUSD && (
<ThemedText.SubHeader lineHeight="24px" color="textSecondary"> <UsdValue>{formatUsdPrice(totalEthListingValue * ethPriceInUSD)}</UsdValue>
{formatUsdPrice(totalEthListingValue * ethPriceInUSD)}
</ThemedText.SubHeader>
)} )}
</ProceedsWrapper> </ProceedsWrapper>
<ListingButtonWrapper> <ListingButtonWrapper>
......
...@@ -49,7 +49,7 @@ const FeeColumnWrapper = styled(Column)` ...@@ -49,7 +49,7 @@ const FeeColumnWrapper = styled(Column)`
align-items: flex-end; align-items: flex-end;
display: none; display: none;
@media screen and (min-width: ${BREAKPOINTS.lg}px) { @media screen and (min-width: ${BREAKPOINTS.md}px) {
display: flex; display: flex;
} }
` `
...@@ -63,7 +63,7 @@ const ReturnColumn = styled(Column)` ...@@ -63,7 +63,7 @@ const ReturnColumn = styled(Column)`
flex: 1.5; flex: 1.5;
display: none; display: none;
@media screen and (min-width: ${BREAKPOINTS.lg}px) { @media screen and (min-width: ${BREAKPOINTS.md}px) {
display: flex; display: flex;
} }
` `
......
...@@ -19,12 +19,8 @@ const NFTListRowWrapper = styled(Row)` ...@@ -19,12 +19,8 @@ const NFTListRowWrapper = styled(Row)`
const NFTInfoWrapper = styled(Row)` const NFTInfoWrapper = styled(Row)`
align-items: center; align-items: center;
min-width: 0px; min-width: 0px;
flex: 2; flex: 1.5;
margin-bottom: auto; margin-bottom: auto;
@media screen and (min-width: ${BREAKPOINTS.md}px) {
flex: 1.5;
}
` `
const ExpandMarketIconWrapper = styled.div` const ExpandMarketIconWrapper = styled.div`
...@@ -77,7 +73,11 @@ const CollectionName = styled(ThemedText.BodySmall)` ...@@ -77,7 +73,11 @@ const CollectionName = styled(ThemedText.BodySmall)`
const MarketPlaceRowWrapper = styled(Column)` const MarketPlaceRowWrapper = styled(Column)`
gap: 24px; gap: 24px;
flex: 1; flex: 1.5;
@media screen and (min-width: ${BREAKPOINTS.md}px) {
flex: 2;
}
@media screen and (min-width: ${BREAKPOINTS.md}px) { @media screen and (min-width: ${BREAKPOINTS.md}px) {
flex: 3; flex: 3;
......
...@@ -33,7 +33,11 @@ const NFTHeader = styled.div` ...@@ -33,7 +33,11 @@ const NFTHeader = styled.div`
` `
const PriceHeaders = styled(Row)` const PriceHeaders = styled(Row)`
flex: 1; flex: 1.5;
@media screen and (min-width: ${BREAKPOINTS.md}px) {
flex: 2;
}
@media screen and (min-width: ${BREAKPOINTS.md}px) { @media screen and (min-width: ${BREAKPOINTS.md}px) {
flex: 3; flex: 3;
...@@ -100,7 +104,7 @@ const DropdownContainer = styled.div` ...@@ -100,7 +104,7 @@ const DropdownContainer = styled.div`
const FeeUserReceivesSharedStyles = css` const FeeUserReceivesSharedStyles = css`
display: none; display: none;
justify-content: flex-end; justify-content: flex-end;
@media screen and (min-width: ${BREAKPOINTS.lg}px) { @media screen and (min-width: ${BREAKPOINTS.md}px) {
display: flex; display: flex;
} }
` `
......
...@@ -69,6 +69,7 @@ const ErrorMessage = styled(Row)` ...@@ -69,6 +69,7 @@ const ErrorMessage = styled(Row)`
gap: 4px; gap: 4px;
position: absolute; position: absolute;
top: 44px; top: 44px;
white-space: nowrap;
` `
const WarningIcon = styled(AlertTriangle)` const WarningIcon = styled(AlertTriangle)`
......
...@@ -14,14 +14,14 @@ import { useToggleWalletModal } from 'state/application/hooks' ...@@ -14,14 +14,14 @@ import { useToggleWalletModal } from 'state/application/hooks'
import styled from 'styled-components/macro' import styled from 'styled-components/macro'
import { BREAKPOINTS, ThemedText } from 'theme' import { BREAKPOINTS, ThemedText } from 'theme'
import { LIST_PAGE_MARGIN, LIST_PAGE_MARGIN_MOBILE } from './shared' import { LIST_PAGE_MARGIN, LIST_PAGE_MARGIN_MOBILE, LIST_PAGE_MARGIN_TABLET } from './shared'
const ProfilePageWrapper = styled.div` const ProfilePageWrapper = styled.div`
height: 100%; height: 100%;
width: 100%; width: 100%;
scrollbar-width: none; scrollbar-width: none;
@media screen and (min-width: ${BREAKPOINTS.md}px) { @media screen and (min-width: ${BREAKPOINTS.lg}px) {
height: auto; height: auto;
} }
` `
...@@ -34,6 +34,11 @@ const LoadedAccountPage = styled.div<{ cartExpanded: boolean; isOnV2ListPage: bo ...@@ -34,6 +34,11 @@ const LoadedAccountPage = styled.div<{ cartExpanded: boolean; isOnV2ListPage: bo
); );
margin: 0px ${({ isOnV2ListPage }) => (isOnV2ListPage ? LIST_PAGE_MARGIN : 0)}px; margin: 0px ${({ isOnV2ListPage }) => (isOnV2ListPage ? LIST_PAGE_MARGIN : 0)}px;
@media screen and (max-width: ${BREAKPOINTS.lg}px) {
width: calc(100% - ${({ isOnV2ListPage }) => (isOnV2ListPage ? LIST_PAGE_MARGIN_TABLET * 2 : 0)}px);
margin: 0px ${({ isOnV2ListPage }) => (isOnV2ListPage ? LIST_PAGE_MARGIN_TABLET : 0)}px;
}
@media screen and (max-width: ${BREAKPOINTS.sm}px) { @media screen and (max-width: ${BREAKPOINTS.sm}px) {
width: calc(100% - ${({ isOnV2ListPage }) => (isOnV2ListPage ? LIST_PAGE_MARGIN_MOBILE * 2 : 0)}px); width: calc(100% - ${({ isOnV2ListPage }) => (isOnV2ListPage ? LIST_PAGE_MARGIN_MOBILE * 2 : 0)}px);
margin: 0px ${({ isOnV2ListPage }) => (isOnV2ListPage ? LIST_PAGE_MARGIN_MOBILE : 0)}px; margin: 0px ${({ isOnV2ListPage }) => (isOnV2ListPage ? LIST_PAGE_MARGIN_MOBILE : 0)}px;
......
export const LIST_PAGE_MARGIN = 156 export const LIST_PAGE_MARGIN = 156
export const LIST_PAGE_MARGIN_TABLET = 60
export const LIST_PAGE_MARGIN_MOBILE = 16 export const LIST_PAGE_MARGIN_MOBILE = 16
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