IconGrid: extract some inline styles

This commit is contained in:
rektdeckard
2020-08-15 20:02:55 -04:00
parent 5f2681048d
commit 37d80d4b9d
3 changed files with 16 additions and 14 deletions

View File

@@ -47,6 +47,7 @@
height: 0px; height: 0px;
margin: 0px; margin: 0px;
border-radius: 16px; border-radius: 16px;
background-color: rgba(163, 159, 171, 0.1);
overflow: hidden; overflow: hidden;
} }
@@ -76,6 +77,7 @@
} }
.snippet pre { .snippet pre {
text-overflow: ellipsis; text-overflow: ellipsis;
color: black;
} }
.snippet button { .snippet button {
background-color: transparent; background-color: transparent;
@@ -98,6 +100,10 @@
height: 48px; height: 48px;
} }
.button-row button svg {
margin-right: 8px;
}
.close { .close {
width: 10%; width: 10%;
text-align: end; text-align: end;

View File

@@ -6,9 +6,9 @@ import React, {
} from "react"; } from "react";
import { useRecoilState } from "recoil"; import { useRecoilState } from "recoil";
import { motion, AnimatePresence } from "framer-motion"; import { motion, AnimatePresence } from "framer-motion";
import { IconProps, Icon } from "phosphor-react";
import { iconPreviewOpenAtom } from "../../state/atoms"; import { iconPreviewOpenAtom } from "../../state/atoms";
import { IconProps, Icon } from "phosphor-react";
import InfoPanel from "./InfoPanel"; import InfoPanel from "./InfoPanel";
import ErrorBoundary from "../ErrorBoundary/ErrorBoundary"; import ErrorBoundary from "../ErrorBoundary/ErrorBoundary";

View File

@@ -2,6 +2,13 @@ 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 {
Icon,
ArrowUpRightCircle,
Copy,
Prohibit,
CheckCircle,
} from "phosphor-react";
import { import {
styleQueryAtom, styleQueryAtom,
@@ -10,13 +17,6 @@ import {
iconPreviewOpenAtom, iconPreviewOpenAtom,
} from "../../state/atoms"; } from "../../state/atoms";
import useTransientState from "../../hooks/useTransientState"; import useTransientState from "../../hooks/useTransientState";
import {
Icon,
ArrowUpRightCircle,
Copy,
Prohibit,
CheckCircle,
} from "phosphor-react";
const infoVariants = { const infoVariants = {
open: { open: {
@@ -95,7 +95,6 @@ const InfoPanel: React.FC<InfoPanelProps> = (props) => {
variants={infoVariants} variants={infoVariants}
style={{ style={{
order: index + (spans - (index % spans)), order: index + (spans - (index % spans)),
backgroundColor: "rgba(163, 159, 171, 0.1)",
color: isDark ? "white" : "black", color: isDark ? "white" : "black",
}} }}
> >
@@ -108,7 +107,7 @@ const InfoPanel: React.FC<InfoPanelProps> = (props) => {
<div className="icon-usage"> <div className="icon-usage">
<div className="snippet"> <div className="snippet">
HTML/CSS HTML/CSS
<pre style={{ color: "black" }}> <pre>
{snippets.html} {snippets.html}
<button <button
title="Copy snippet" title="Copy snippet"
@@ -124,7 +123,7 @@ const InfoPanel: React.FC<InfoPanelProps> = (props) => {
</div> </div>
<div className="snippet"> <div className="snippet">
React React
<pre style={{ color: "black" }}> <pre>
{snippets.react} {snippets.react}
<button <button
title="Copy snippet" title="Copy snippet"
@@ -145,7 +144,6 @@ const InfoPanel: React.FC<InfoPanelProps> = (props) => {
> >
<ArrowUpRightCircle <ArrowUpRightCircle
size={32} size={32}
style={{ marginRight: 8 }}
color="currentColor" color="currentColor"
weight="regular" weight="regular"
/>{" "} />{" "}
@@ -158,14 +156,12 @@ const InfoPanel: React.FC<InfoPanelProps> = (props) => {
{copied === "svg" ? ( {copied === "svg" ? (
<CheckCircle <CheckCircle
size={32} size={32}
style={{ marginRight: 8 }}
color="#1FA647" color="#1FA647"
weight="fill" weight="fill"
/> />
) : ( ) : (
<Copy <Copy
size={32} size={32}
style={{ marginRight: 8 }}
color="currentColor" color="currentColor"
weight="regular" weight="regular"
/> />