Commit 575660d3 authored by Connor McEwen's avatar Connor McEwen Committed by GitHub

fix: respect padding in cells with proper hover (#4451)

parent 1e692491
...@@ -42,7 +42,7 @@ const Cell = styled.div` ...@@ -42,7 +42,7 @@ const Cell = styled.div`
align-items: center; align-items: center;
justify-content: center; justify-content: center;
` `
const StyledTokenRow = styled.div` const StyledTokenRow = styled.div<{ first?: boolean; last?: boolean }>`
width: 100%; width: 100%;
height: 60px; height: 60px;
display: grid; display: grid;
...@@ -52,10 +52,14 @@ const StyledTokenRow = styled.div` ...@@ -52,10 +52,14 @@ const StyledTokenRow = styled.div`
max-width: ${MAX_WIDTH_MEDIA_BREAKPOINT}; max-width: ${MAX_WIDTH_MEDIA_BREAKPOINT};
min-width: 390px; min-width: 390px;
padding: 0px 12px; padding-top: ${({ first }) => (first ? '4px' : '0px')};
padding-bottom: ${({ last }) => (last ? '4px' : '0px')};
padding-left: 12px;
padding-right: 12px;
&:hover { &:hover {
background-color: ${({ theme }) => theme.accentActionSoft}; background-color: ${({ theme }) => theme.accentActionSoft};
${({ last }) => last && 'border-radius: 0px 0px 8px 8px;'}
} }
@media only screen and (max-width: ${MAX_WIDTH_MEDIA_BREAKPOINT}) { @media only screen and (max-width: ${MAX_WIDTH_MEDIA_BREAKPOINT}) {
...@@ -349,6 +353,8 @@ export function TokenRow({ ...@@ -349,6 +353,8 @@ export function TokenRow({
marketCap, marketCap,
volume, volume,
sparkLine, sparkLine,
first,
last,
}: { }: {
address: ReactNode address: ReactNode
header: boolean header: boolean
...@@ -360,6 +366,8 @@ export function TokenRow({ ...@@ -360,6 +366,8 @@ export function TokenRow({
marketCap: ReactNode marketCap: ReactNode
volume: ReactNode volume: ReactNode
sparkLine: ReactNode sparkLine: ReactNode
first?: boolean
last?: boolean
}) { }) {
const rowCells = ( const rowCells = (
<> <>
...@@ -374,7 +382,11 @@ export function TokenRow({ ...@@ -374,7 +382,11 @@ export function TokenRow({
</> </>
) )
if (header) return <StyledHeaderRow>{rowCells}</StyledHeaderRow> if (header) return <StyledHeaderRow>{rowCells}</StyledHeaderRow>
return <StyledTokenRow>{rowCells}</StyledTokenRow> return (
<StyledTokenRow first={first} last={last}>
{rowCells}
</StyledTokenRow>
)
} }
/* Header Row: top header row component for table */ /* Header Row: top header row component for table */
...@@ -532,6 +544,8 @@ export default function LoadedRow({ ...@@ -532,6 +544,8 @@ export default function LoadedRow({
<ParentSize>{({ width, height }) => <SparklineChart width={width} height={height} />}</ParentSize> <ParentSize>{({ width, height }) => <SparklineChart width={width} height={height} />}</ParentSize>
</SparkLine> </SparkLine>
} }
first={tokenListIndex === 0}
last={tokenListIndex === tokenListLength - 1}
/> />
</StyledLink> </StyledLink>
) )
......
...@@ -44,7 +44,6 @@ const NoTokenDisplay = styled.div` ...@@ -44,7 +44,6 @@ const NoTokenDisplay = styled.div`
gap: 8px; gap: 8px;
` `
const TokenRowsContainer = styled.div` const TokenRowsContainer = styled.div`
padding: 4px 0px;
width: 100%; width: 100%;
` `
......
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