From 192eb5b8eb59e4b543106f0b777a53efd61d4c83 Mon Sep 17 00:00:00 2001 From: rektdeckard Date: Mon, 17 Aug 2020 02:53:18 -0400 Subject: [PATCH] InfoPanel: add breakpoints that simplify panel on mobile --- src/components/IconGrid/IconGrid.css | 27 ++++++++++----- src/components/IconGrid/InfoPanel.tsx | 48 ++++++++------------------- 2 files changed, 33 insertions(+), 42 deletions(-) diff --git a/src/components/IconGrid/IconGrid.css b/src/components/IconGrid/IconGrid.css index 77c642f..7db013e 100644 --- a/src/components/IconGrid/IconGrid.css +++ b/src/components/IconGrid/IconGrid.css @@ -37,12 +37,13 @@ .grid-item p { font-size: 12px; line-height: 16px; - color: #86838B; + color: #86838b; margin-top: 12px; text-align: center; } .info-box { + position: relative; display: flex; width: 100%; height: 0px; @@ -52,6 +53,16 @@ overflow: hidden; } +@media screen and (max-width: 1023px) { + .icon-preview { + display: none !important; + } + + .icon-usage { + padding-left: 10% !important; + } +} + .icon-preview { height: 396px; width: 30%; @@ -70,7 +81,7 @@ .icon-usage { flex: 1; - padding: 56px 0px 56px; + padding: 56px 10% 56px 0; } .snippet { @@ -86,6 +97,7 @@ padding: 0; height: 24px; float: right; + cursor: pointer; } .button-row { @@ -99,19 +111,18 @@ margin: 0 48px 0 0; padding: 0; height: 48px; + cursor: pointer; } .button-row button svg { margin-right: 8px; } -.close { - width: 10%; - text-align: end; -} - .close-icon { - margin: 24px; + position: absolute; + top: 24px; + right: 24px; + text-align: end; cursor: pointer; } diff --git a/src/components/IconGrid/InfoPanel.tsx b/src/components/IconGrid/InfoPanel.tsx index 32f2417..0fc41dc 100644 --- a/src/components/IconGrid/InfoPanel.tsx +++ b/src/components/IconGrid/InfoPanel.tsx @@ -2,13 +2,7 @@ import React, { useRef } from "react"; import { useRecoilValue, useSetRecoilState } from "recoil"; import { motion } from "framer-motion"; import { saveAs } from "file-saver"; -import { - Icon, - Copy, - X, - CheckCircle, - ArchiveDiskDot, -} from "phosphor-react"; +import { Icon, Copy, X, CheckCircle, ArchiveDiskDot } from "phosphor-react"; import { styleQueryAtom, @@ -54,9 +48,9 @@ const InfoPanel: React.FC = (props) => { html: ``, - react: `<${Icon.displayName} size={${size}} ${color !== "#000000" ? `color="${color}" ` : ""}${ - weight === "regular" ? "" : `weight="${weight}" ` - }/>`, + react: `<${Icon.displayName} size={${size}} ${ + color !== "#000000" ? `color="${color}" ` : "" + }${weight === "regular" ? "" : `weight="${weight}" `}/>`, }; const handleCopySnippet = ( @@ -142,11 +136,7 @@ const InfoPanel: React.FC = (props) => { style={{ color: isDark ? "white" : "black" }} onClick={handleDownloadSVG} > - {" "} + {" "} Download SVG -
- setOpen(false)} - /> -
+ setOpen(false)} + /> ); };