Commit ac0badfb authored by Charles Bachmeier's avatar Charles Bachmeier Committed by GitHub

feat: [ListV2] Add mobile styles (#5906)

* correct mobile modal width

* better mobile styling for listing page

* add height to modal
parent 149b18f0
...@@ -9,13 +9,13 @@ import { BackArrowIcon } from 'nft/components/icons' ...@@ -9,13 +9,13 @@ 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 } from 'nft/pages/profile/shared' import { LIST_PAGE_MARGIN, LIST_PAGE_MARGIN_MOBILE } from 'nft/pages/profile/shared'
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'
import { ListingMarkets } from 'nft/utils/listNfts' import { ListingMarkets } from 'nft/utils/listNfts'
import { useEffect, useMemo, useReducer, useState } from 'react' import { useEffect, useMemo, useReducer, useState } from 'react'
import styled, { css } from 'styled-components/macro' import styled, { css } from 'styled-components/macro'
import { ThemedText } from 'theme' import { BREAKPOINTS, ThemedText } from 'theme'
import { Z_INDEX } from 'theme/zIndex' import { Z_INDEX } from 'theme/zIndex'
import { ListModal } from './Modal/ListModal' import { ListModal } from './Modal/ListModal'
...@@ -98,6 +98,12 @@ const FloatingConfirmationBar = styled(Row)` ...@@ -98,6 +98,12 @@ const FloatingConfirmationBar = styled(Row)`
transform: translateX(-50%); transform: translateX(-50%);
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) {
width: calc(100% - ${LIST_PAGE_MARGIN_MOBILE * 2}px);
bottom: 68px;
padding: 16px 12px;
}
` `
const Overlay = styled.div` const Overlay = styled.div`
...@@ -111,6 +117,10 @@ const Overlay = styled.div` ...@@ -111,6 +117,10 @@ const Overlay = styled.div`
const ProceedsAndButtonWrapper = styled(Row)` const ProceedsAndButtonWrapper = styled(Row)`
width: min-content; width: min-content;
gap: 40px; gap: 40px;
@media screen and (max-width: ${BREAKPOINTS.sm}px) {
gap: 20px;
}
` `
const ProceedsWrapper = styled(Row)` const ProceedsWrapper = styled(Row)`
...@@ -118,8 +128,24 @@ const ProceedsWrapper = styled(Row)` ...@@ -118,8 +128,24 @@ const ProceedsWrapper = styled(Row)`
gap: 16px; gap: 16px;
` `
const EthValueWrapper = styled.span<{ totalEthListingValue: boolean }>`
font-weight: 500;
font-size: 20px;
line-height: 28px;
color: ${({ theme, totalEthListingValue }) => (totalEthListingValue ? theme.textPrimary : theme.textSecondary)};
@media screen and (max-width: ${BREAKPOINTS.sm}px) {
font-size: 16px;
line-height: 24px;
}
`
const ListingButtonWrapper = styled.div` const ListingButtonWrapper = styled.div`
width: 170px; width: 170px;
@media screen and (max-width: ${BREAKPOINTS.sm}px) {
width: 95px;
}
` `
export const ListPage = () => { export const ListPage = () => {
...@@ -165,6 +191,16 @@ export const ListPage = () => { ...@@ -165,6 +191,16 @@ export const ListPage = () => {
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, [selectedMarkets]) }, [selectedMarkets])
const BannerText = isMobile ? (
<ThemedText.SubHeader lineHeight="24px">
<Trans>Proceeds</Trans>
</ThemedText.SubHeader>
) : (
<ThemedText.HeadlineSmall lineHeight="28px">
<Trans>Proceeds if sold</Trans>
</ThemedText.HeadlineSmall>
)
return ( return (
<Column> <Column>
<MarketWrap isNftListV2={isNftListV2}> <MarketWrap isNftListV2={isNftListV2}>
...@@ -191,27 +227,22 @@ export const ListPage = () => { ...@@ -191,27 +227,22 @@ export const ListPage = () => {
{isNftListV2 && ( {isNftListV2 && (
<> <>
<FloatingConfirmationBar> <FloatingConfirmationBar>
<ThemedText.HeadlineSmall lineHeight="28px"> {BannerText}
<Trans>Proceeds if sold</Trans>
</ThemedText.HeadlineSmall>
<ProceedsAndButtonWrapper> <ProceedsAndButtonWrapper>
<ProceedsWrapper> <ProceedsWrapper>
<ThemedText.HeadlineSmall <EthValueWrapper totalEthListingValue={!!totalEthListingValue}>
lineHeight="28px"
color={totalEthListingValue ? 'textPrimary' : 'textTertiary'}
>
{totalEthListingValue > 0 ? formatEth(totalEthListingValue) : '-'} ETH {totalEthListingValue > 0 ? formatEth(totalEthListingValue) : '-'} ETH
</ThemedText.HeadlineSmall> </EthValueWrapper>
{!!totalEthListingValue && !!ethPriceInUSD && ( {!!totalEthListingValue && !!ethPriceInUSD && !isMobile && (
<ThemedText.HeadlineSmall lineHeight="28px" color="textSecondary"> <ThemedText.SubHeader lineHeight="24px" color="textSecondary">
{formatUsdPrice(totalEthListingValue * ethPriceInUSD)} {formatUsdPrice(totalEthListingValue * ethPriceInUSD)}
</ThemedText.HeadlineSmall> </ThemedText.SubHeader>
)} )}
</ProceedsWrapper> </ProceedsWrapper>
<ListingButtonWrapper> <ListingButtonWrapper>
<ListingButton <ListingButton
onClick={isNftListV2 ? toggleShowListModal : toggleBag} onClick={isNftListV2 ? toggleShowListModal : toggleBag}
buttonText={anyListingsMissingPrice ? t`Set prices to continue` : t`Start listing`} buttonText={anyListingsMissingPrice && !isMobile ? t`Set prices to continue` : t`Start listing`}
/> />
</ListingButtonWrapper> </ListingButtonWrapper>
</ProceedsAndButtonWrapper> </ProceedsAndButtonWrapper>
......
...@@ -8,7 +8,7 @@ import { useNFTList } from 'nft/hooks' ...@@ -8,7 +8,7 @@ import { useNFTList } from 'nft/hooks'
import { useReducer } from 'react' import { useReducer } from 'react'
import { X } from 'react-feather' import { X } from 'react-feather'
import styled from 'styled-components/macro' import styled from 'styled-components/macro'
import { ThemedText } from 'theme' import { BREAKPOINTS, ThemedText } from 'theme'
import { Z_INDEX } from 'theme/zIndex' import { Z_INDEX } from 'theme/zIndex'
import { ListModalSection, Section } from './ListModalSection' import { ListModalSection, Section } from './ListModalSection'
...@@ -28,6 +28,11 @@ const ListModalWrapper = styled.div` ...@@ -28,6 +28,11 @@ const ListModalWrapper = styled.div`
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 16px; gap: 16px;
@media screen and (max-width: ${BREAKPOINTS.sm}px) {
width: 100%;
height: 100%;
}
` `
const TitleRow = styled(Row)` const TitleRow = styled(Row)`
......
...@@ -14,7 +14,7 @@ import { useToggleWalletModal } from 'state/application/hooks' ...@@ -14,7 +14,7 @@ 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 } from './shared' import { LIST_PAGE_MARGIN, LIST_PAGE_MARGIN_MOBILE } from './shared'
const ProfilePageWrapper = styled.div` const ProfilePageWrapper = styled.div`
height: 100%; height: 100%;
...@@ -33,6 +33,11 @@ const LoadedAccountPage = styled.div<{ cartExpanded: boolean; isOnV2ListPage: bo ...@@ -33,6 +33,11 @@ const LoadedAccountPage = styled.div<{ cartExpanded: boolean; isOnV2ListPage: bo
isOnV2ListPage ? LIST_PAGE_MARGIN * 2 : cartExpanded ? XXXL_BAG_WIDTH : 0}px isOnV2ListPage ? LIST_PAGE_MARGIN * 2 : cartExpanded ? XXXL_BAG_WIDTH : 0}px
); );
margin: 0px ${({ isOnV2ListPage }) => (isOnV2ListPage ? LIST_PAGE_MARGIN : 0)}px; margin: 0px ${({ isOnV2ListPage }) => (isOnV2ListPage ? LIST_PAGE_MARGIN : 0)}px;
@media screen and (max-width: ${BREAKPOINTS.sm}px) {
width: calc(100% - ${({ isOnV2ListPage }) => (isOnV2ListPage ? LIST_PAGE_MARGIN_MOBILE * 2 : 0)}px);
margin: 0px ${({ isOnV2ListPage }) => (isOnV2ListPage ? LIST_PAGE_MARGIN_MOBILE : 0)}px;
}
` `
const Center = styled.div` const Center = styled.div`
......
export const LIST_PAGE_MARGIN = 156 export const LIST_PAGE_MARGIN = 156
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