InfoPanel: add breakpoints that simplify panel on mobile
This commit is contained in:
@@ -37,12 +37,13 @@
|
|||||||
.grid-item p {
|
.grid-item p {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
line-height: 16px;
|
line-height: 16px;
|
||||||
color: #86838B;
|
color: #86838b;
|
||||||
margin-top: 12px;
|
margin-top: 12px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.info-box {
|
.info-box {
|
||||||
|
position: relative;
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 0px;
|
height: 0px;
|
||||||
@@ -52,6 +53,16 @@
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 1023px) {
|
||||||
|
.icon-preview {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-usage {
|
||||||
|
padding-left: 10% !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.icon-preview {
|
.icon-preview {
|
||||||
height: 396px;
|
height: 396px;
|
||||||
width: 30%;
|
width: 30%;
|
||||||
@@ -70,7 +81,7 @@
|
|||||||
|
|
||||||
.icon-usage {
|
.icon-usage {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
padding: 56px 0px 56px;
|
padding: 56px 10% 56px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.snippet {
|
.snippet {
|
||||||
@@ -86,6 +97,7 @@
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
height: 24px;
|
height: 24px;
|
||||||
float: right;
|
float: right;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button-row {
|
.button-row {
|
||||||
@@ -99,19 +111,18 @@
|
|||||||
margin: 0 48px 0 0;
|
margin: 0 48px 0 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
height: 48px;
|
height: 48px;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button-row button svg {
|
.button-row button svg {
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.close {
|
|
||||||
width: 10%;
|
|
||||||
text-align: end;
|
|
||||||
}
|
|
||||||
|
|
||||||
.close-icon {
|
.close-icon {
|
||||||
margin: 24px;
|
position: absolute;
|
||||||
|
top: 24px;
|
||||||
|
right: 24px;
|
||||||
|
text-align: end;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,13 +2,7 @@ import React, { useRef } from "react";
|
|||||||
import { useRecoilValue, useSetRecoilState } from "recoil";
|
import { useRecoilValue, useSetRecoilState } from "recoil";
|
||||||
import { motion } from "framer-motion";
|
import { motion } from "framer-motion";
|
||||||
import { saveAs } from "file-saver";
|
import { saveAs } from "file-saver";
|
||||||
import {
|
import { Icon, Copy, X, CheckCircle, ArchiveDiskDot } from "phosphor-react";
|
||||||
Icon,
|
|
||||||
Copy,
|
|
||||||
X,
|
|
||||||
CheckCircle,
|
|
||||||
ArchiveDiskDot,
|
|
||||||
} from "phosphor-react";
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
styleQueryAtom,
|
styleQueryAtom,
|
||||||
@@ -54,9 +48,9 @@ const InfoPanel: React.FC<InfoPanelProps> = (props) => {
|
|||||||
html: `<i class="ph-${name}${
|
html: `<i class="ph-${name}${
|
||||||
weight === "regular" ? "" : `-${weight}`
|
weight === "regular" ? "" : `-${weight}`
|
||||||
}"></i>`,
|
}"></i>`,
|
||||||
react: `<${Icon.displayName} size={${size}} ${color !== "#000000" ? `color="${color}" ` : ""}${
|
react: `<${Icon.displayName} size={${size}} ${
|
||||||
weight === "regular" ? "" : `weight="${weight}" `
|
color !== "#000000" ? `color="${color}" ` : ""
|
||||||
}/>`,
|
}${weight === "regular" ? "" : `weight="${weight}" `}/>`,
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCopySnippet = (
|
const handleCopySnippet = (
|
||||||
@@ -142,11 +136,7 @@ const InfoPanel: React.FC<InfoPanelProps> = (props) => {
|
|||||||
style={{ color: isDark ? "white" : "black" }}
|
style={{ color: isDark ? "white" : "black" }}
|
||||||
onClick={handleDownloadSVG}
|
onClick={handleDownloadSVG}
|
||||||
>
|
>
|
||||||
<ArchiveDiskDot
|
<ArchiveDiskDot size={32} color="currentColor" weight="fill" />{" "}
|
||||||
size={32}
|
|
||||||
color="currentColor"
|
|
||||||
weight="fill"
|
|
||||||
/>{" "}
|
|
||||||
Download SVG
|
Download SVG
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
@@ -154,23 +144,14 @@ const InfoPanel: React.FC<InfoPanelProps> = (props) => {
|
|||||||
onClick={handleCopySVG}
|
onClick={handleCopySVG}
|
||||||
>
|
>
|
||||||
{copied === "svg" ? (
|
{copied === "svg" ? (
|
||||||
<CheckCircle
|
<CheckCircle size={32} color="#1FA647" weight="fill" />
|
||||||
size={32}
|
|
||||||
color="#1FA647"
|
|
||||||
weight="fill"
|
|
||||||
/>
|
|
||||||
) : (
|
) : (
|
||||||
<Copy
|
<Copy size={32} color="currentColor" weight="fill" />
|
||||||
size={32}
|
|
||||||
color="currentColor"
|
|
||||||
weight="fill"
|
|
||||||
/>
|
|
||||||
)}
|
)}
|
||||||
{copied === "svg" ? "Copied!" : "Copy SVG"}
|
{copied === "svg" ? "Copied!" : "Copy SVG"}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="close">
|
|
||||||
<X
|
<X
|
||||||
className="close-icon"
|
className="close-icon"
|
||||||
color="currentColor"
|
color="currentColor"
|
||||||
@@ -178,7 +159,6 @@ const InfoPanel: React.FC<InfoPanelProps> = (props) => {
|
|||||||
weight="fill"
|
weight="fill"
|
||||||
onClick={() => setOpen(false)}
|
onClick={() => setOpen(false)}
|
||||||
/>
|
/>
|
||||||
</div>
|
|
||||||
</motion.section>
|
</motion.section>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user