Commit 96dc7e09 authored by Jordan Frankfurt's avatar Jordan Frankfurt Committed by GitHub

fix(bag): simplify header (#5185)

* fix(bag): simplify header

* pr feedback: adjust margins

* add margin-auto instead of flex-basis for space-filling to get a more accurate click area

* pr feedback from lynn

* rename numberdot to counterdot
parent c8f1c986
...@@ -13,8 +13,6 @@ export const bagContainer = style([ ...@@ -13,8 +13,6 @@ export const bagContainer = style([
borderColor: 'backgroundOutline', borderColor: 'backgroundOutline',
borderWidth: '1px', borderWidth: '1px',
color: 'textPrimary', color: 'textPrimary',
paddingTop: '20',
paddingBottom: '24',
}), }),
{ {
'@media': { '@media': {
......
...@@ -27,6 +27,7 @@ const Footer = styled.div` ...@@ -27,6 +27,7 @@ const Footer = styled.div`
color: ${({ theme }) => theme.textPrimary}; color: ${({ theme }) => theme.textPrimary};
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-bottom: 8px;
padding: 12px 16px; padding: 12px 16px;
border-bottom-left-radius: 12px; border-bottom-left-radius: 12px;
border-bottom-right-radius: 12px; border-bottom-right-radius: 12px;
......
import { Trans } from '@lingui/macro'
import { OpacityHoverState } from 'components/Common' import { OpacityHoverState } from 'components/Common'
import { Column, Row } from 'nft/components/Flex'
import { BagCloseIcon } from 'nft/components/icons' import { BagCloseIcon } from 'nft/components/icons'
import { roundAndPluralize } from 'nft/utils/roundAndPluralize'
import styled from 'styled-components/macro' import styled from 'styled-components/macro'
import { ButtonText, ThemedText } from 'theme' import { ButtonText, ThemedText } from 'theme'
import * as styles from './BagHeader.css'
const ClearButton = styled(ButtonText)` const ClearButton = styled(ButtonText)`
color: ${({ theme }) => theme.textSecondary}; color: ${({ theme }) => theme.textSecondary};
cursor: pointer; cursor: pointer;
font-weight: 600; font-weight: 600;
font-size: 14px; font-size: 14px;
line-height: 16px; line-height: 16px;
transition: 150ms ease color;
:hover {
color: ${({ theme }) => theme.accentActive};
}
`
const ControlRow = styled.div`
align-items: center;
display: flex;
flex-direction: row;
justify-content: space-between;
` `
const IconWrapper = styled.button` const IconWrapper = styled.button`
align-items: center;
background-color: transparent; background-color: transparent;
border-radius: 8px; border-radius: 8px;
border: none; border: none;
color: ${({ theme }) => theme.textPrimary}; color: ${({ theme }) => theme.textPrimary};
cursor: pointer; cursor: pointer;
display: flex; display: flex;
flex-direction: row;
justify-content: flex-end;
margin-left: auto;
padding: 2px; padding: 2px;
opacity: 1; opacity: 1;
${OpacityHoverState} ${OpacityHoverState}
` `
const CounterDot = styled.div`
align-items: center;
background-color: ${({ theme }) => theme.accentAction};
border-radius: 100px;
color: ${({ theme }) => theme.accentTextLightPrimary};
display: flex;
font-size: 10px;
justify-content: center;
padding: 4px 6px;
`
const Wrapper = styled.div`
align-items: center;
display: flex;
flex-direction: row;
gap: 8px;
justify-content: flex-start;
margin: 16px 20px;
text-align: center;
`
interface BagHeaderProps { interface BagHeaderProps {
numberOfAssets: number numberOfAssets: number
closeBag: () => void closeBag: () => void
...@@ -46,19 +56,17 @@ interface BagHeaderProps { ...@@ -46,19 +56,17 @@ interface BagHeaderProps {
export const BagHeader = ({ numberOfAssets, closeBag, resetFlow, isProfilePage }: BagHeaderProps) => { export const BagHeader = ({ numberOfAssets, closeBag, resetFlow, isProfilePage }: BagHeaderProps) => {
return ( return (
<Column gap="4" paddingX="32" marginBottom="20"> <Wrapper>
<Row className={styles.header}> <ThemedText.HeadlineSmall>{isProfilePage ? <Trans>Sell</Trans> : <Trans>Bag</Trans>}</ThemedText.HeadlineSmall>
<ThemedText.HeadlineSmall>{isProfilePage ? 'Sell NFTs' : 'My bag'}</ThemedText.HeadlineSmall>
<IconWrapper onClick={closeBag}>
<BagCloseIcon />
</IconWrapper>
</Row>
{numberOfAssets > 0 && ( {numberOfAssets > 0 && (
<ControlRow> <>
<ThemedText.BodyPrimary>{roundAndPluralize(numberOfAssets, 'NFT')}</ThemedText.BodyPrimary> <CounterDot>{numberOfAssets}</CounterDot>
<ClearButton onClick={resetFlow}>Clear all</ClearButton> <ClearButton onClick={resetFlow}>Clear all</ClearButton>
</ControlRow> </>
)} )}
</Column> <IconWrapper onClick={closeBag}>
<BagCloseIcon />
</IconWrapper>
</Wrapper>
) )
} }
...@@ -6,8 +6,8 @@ import { themeVars } from 'nft/css/sprinkles.css' ...@@ -6,8 +6,8 @@ import { themeVars } from 'nft/css/sprinkles.css'
import styled from 'styled-components/macro' import styled from 'styled-components/macro'
const StyledColumn = styled(Column)<{ isProfilePage?: boolean }>` const StyledColumn = styled(Column)<{ isProfilePage?: boolean }>`
gap: ${({ isProfilePage }) => !isProfilePage && '12'}; gap: ${({ isProfilePage }) => !isProfilePage && '12'}px;
margin-top: 36; margin-top: 68px;
display: ${({ isProfilePage }) => isProfilePage && 'flex'}; display: ${({ isProfilePage }) => isProfilePage && 'flex'};
justify-content: ${({ isProfilePage }) => isProfilePage && 'center'}; justify-content: ${({ isProfilePage }) => isProfilePage && 'center'};
height: ${({ isProfilePage }) => isProfilePage && 'inherit'}; height: ${({ isProfilePage }) => isProfilePage && 'inherit'};
......
...@@ -74,6 +74,8 @@ export const ButtonText = styled.button` ...@@ -74,6 +74,8 @@ export const ButtonText = styled.button`
background: none; background: none;
cursor: pointer; cursor: pointer;
transition-duration: ${({ theme }) => theme.transition.duration.fast}; transition-duration: ${({ theme }) => theme.transition.duration.fast};
transition-timing-function: ease-in-out;
transition-property: opacity, color, background-color;
:hover { :hover {
opacity: ${({ theme }) => theme.opacity.hover}; opacity: ${({ theme }) => theme.opacity.hover};
......
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