components+hooks: refactor window measurement
We relocated window measurment logic into a hook, useGridSpans(), which tells us the appropriate number of columns for the IconGrid. This is useful for rendering an InfoPanel in the right place! In future we should look into a custom implementation using ResizeObserver and polyfills, and that may be extensible for other use-cases.
This commit is contained in:
@@ -79,7 +79,6 @@ const IconGridItem: React.FC<IconGridItemProps> = (props) => {
|
||||
backgroundColor: isOpen ? "rgba(163, 159, 171, 0.1)" : undefined,
|
||||
}}
|
||||
custom={delayRef}
|
||||
// whileTap={whileTap}
|
||||
transition={transition}
|
||||
variants={itemVariants}
|
||||
onKeyPress={(e) => e.key === "Enter" && handleOpen()}
|
||||
|
||||
Reference in New Issue
Block a user