Commit c12b0a6d authored by Jordan Frankfurt's avatar Jordan Frankfurt Committed by GitHub

fix: adjust gap down to 16px on large screens (#5276)

* fix: adjust gap down to 16px on large screens

* pr feedback
parent effc3d1c
...@@ -17,13 +17,13 @@ import { body, bodySmall, buttonTextMedium, subhead } from 'nft/css/common.css' ...@@ -17,13 +17,13 @@ import { body, bodySmall, buttonTextMedium, subhead } from 'nft/css/common.css'
import { themeVars } from 'nft/css/sprinkles.css' import { themeVars } from 'nft/css/sprinkles.css'
import { useIsMobile } from 'nft/hooks' import { useIsMobile } from 'nft/hooks'
import { GenieAsset, Rarity, TokenType, WalletAsset } from 'nft/types' import { GenieAsset, Rarity, TokenType, WalletAsset } from 'nft/types'
import { isAudio, isVideo } from 'nft/utils' import { fallbackProvider, isAudio, isVideo, putCommas } from 'nft/utils'
import { fallbackProvider, putCommas } from 'nft/utils'
import { floorFormatter } from 'nft/utils/numbers' import { floorFormatter } from 'nft/utils/numbers'
import { import {
createContext, createContext,
MouseEvent, MouseEvent,
ReactNode, ReactNode,
useCallback,
useContext, useContext,
useLayoutEffect, useLayoutEffect,
useMemo, useMemo,
...@@ -216,6 +216,8 @@ const Container = ({ ...@@ -216,6 +216,8 @@ const Container = ({
} }
} }
const toggleHover = useCallback(() => toggleHovered(), [])
return ( return (
<CardContext.Provider value={providerValue}> <CardContext.Provider value={providerValue}>
<Box <Box
...@@ -224,8 +226,8 @@ const Container = ({ ...@@ -224,8 +226,8 @@ const Container = ({
borderRadius={BORDER_RADIUS} borderRadius={BORDER_RADIUS}
className={selected ? styles.selectedCard : styles.card} className={selected ? styles.selectedCard : styles.card}
draggable={false} draggable={false}
onMouseEnter={() => toggleHovered()} onMouseEnter={toggleHover}
onMouseLeave={() => toggleHovered()} onMouseLeave={toggleHover}
transition="250" transition="250"
onClick={isDisabled ? () => null : onClick ?? handleAssetInBag} onClick={isDisabled ? () => null : onClick ?? handleAssetInBag}
> >
......
...@@ -5,7 +5,7 @@ import { breakpoints, sprinkles } from '../../css/sprinkles.css' ...@@ -5,7 +5,7 @@ import { breakpoints, sprinkles } from '../../css/sprinkles.css'
export const assetList = style([ export const assetList = style([
sprinkles({ sprinkles({
display: 'grid', display: 'grid',
gap: { sm: '8', md: '8', lg: '12', xl: '16', xxl: '20', xxxl: '20' }, gap: { sm: '8', md: '8', lg: '12', xl: '16' },
}), }),
{ {
//This treatment of the grid still uses minmax, but enforces an amount of grid items per breakpoint. This means that when the bag and filter panels appear, we no longer get layout thrash and have a consistent animation as the width changes. It uses calc() and subtracts the grid gap to ensure the min size will always fit without wrapping. //This treatment of the grid still uses minmax, but enforces an amount of grid items per breakpoint. This means that when the bag and filter panels appear, we no longer get layout thrash and have a consistent animation as the width changes. It uses calc() and subtracts the grid gap to ensure the min size will always fit without wrapping.
...@@ -21,10 +21,10 @@ export const assetList = style([ ...@@ -21,10 +21,10 @@ export const assetList = style([
gridTemplateColumns: 'repeat(auto-fill, minmax(calc(100%/4 - 16px), 1fr) )', gridTemplateColumns: 'repeat(auto-fill, minmax(calc(100%/4 - 16px), 1fr) )',
}, },
[`screen and (min-width: ${breakpoints.xxl}px)`]: { [`screen and (min-width: ${breakpoints.xxl}px)`]: {
gridTemplateColumns: 'repeat(auto-fill, minmax(calc(100%/5 - 20px), 1fr) )', gridTemplateColumns: 'repeat(auto-fill, minmax(calc(100%/5 - 16px), 1fr) )',
}, },
[`screen and (min-width: ${breakpoints.xxxl}px)`]: { [`screen and (min-width: ${breakpoints.xxxl}px)`]: {
gridTemplateColumns: 'repeat(auto-fill, minmax(calc(100%/7 - 20px), 1fr) )', gridTemplateColumns: 'repeat(auto-fill, minmax(calc(100%/7 - 16px), 1fr) )',
}, },
}, },
}, },
......
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