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:
rektdeckard
2020-09-24 19:24:00 -04:00
parent 628667c719
commit 22f066c6a9
4 changed files with 17 additions and 8 deletions

View File

@@ -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()}