selectors: rename iconStyleAtom -> iconWeightAtom
This commit is contained in:
@@ -4,19 +4,19 @@ import { motion, useAnimation } from "framer-motion";
|
|||||||
import { useWindowSize } from "react-use";
|
import { useWindowSize } from "react-use";
|
||||||
import { IconContext } from "phosphor-react";
|
import { IconContext } from "phosphor-react";
|
||||||
|
|
||||||
import { iconStyleAtom, iconSizeAtom, iconColorAtom } from "../../state/atoms";
|
import { iconWeightAtom, iconSizeAtom, iconColorAtom } from "../../state/atoms";
|
||||||
import {
|
import {
|
||||||
filteredQueryResultsSelector,
|
filteredQueryResultsSelector,
|
||||||
isDarkThemeSelector,
|
isDarkThemeSelector,
|
||||||
} from "../../state/selectors";
|
} from "../../state/selectors";
|
||||||
import GridItem from "./IconGridItem";
|
import IconGridItem from "./IconGridItem";
|
||||||
import Warn from "../Warn/Warn";
|
import Warn from "../Warn/Warn";
|
||||||
import "./IconGrid.css";
|
import "./IconGrid.css";
|
||||||
|
|
||||||
type IconGridProps = {};
|
type IconGridProps = {};
|
||||||
|
|
||||||
const IconGrid: React.FC<IconGridProps> = () => {
|
const IconGrid: React.FC<IconGridProps> = () => {
|
||||||
const weight = useRecoilValue(iconStyleAtom);
|
const weight = useRecoilValue(iconWeightAtom);
|
||||||
const size = useRecoilValue(iconSizeAtom);
|
const size = useRecoilValue(iconSizeAtom);
|
||||||
const color = useRecoilValue(iconColorAtom);
|
const color = useRecoilValue(iconColorAtom);
|
||||||
const isDark = useRecoilValue(isDarkThemeSelector);
|
const isDark = useRecoilValue(isDarkThemeSelector);
|
||||||
@@ -48,7 +48,7 @@ const IconGrid: React.FC<IconGridProps> = () => {
|
|||||||
variants={{}}
|
variants={{}}
|
||||||
>
|
>
|
||||||
{filteredQueryResults.map((iconEntry, index) => (
|
{filteredQueryResults.map((iconEntry, index) => (
|
||||||
<GridItem
|
<IconGridItem
|
||||||
key={index}
|
key={index}
|
||||||
index={index}
|
index={index}
|
||||||
spans={spans}
|
spans={spans}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { saveAs } from "file-saver";
|
|||||||
import { Icon, Copy, X, CheckCircle, ArchiveDiskDot } from "phosphor-react";
|
import { Icon, Copy, X, CheckCircle, ArchiveDiskDot } from "phosphor-react";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
iconStyleAtom,
|
iconWeightAtom,
|
||||||
iconSizeAtom,
|
iconSizeAtom,
|
||||||
iconColorAtom,
|
iconColorAtom,
|
||||||
iconPreviewOpenAtom,
|
iconPreviewOpenAtom,
|
||||||
@@ -37,7 +37,7 @@ interface InfoPanelProps {
|
|||||||
|
|
||||||
const InfoPanel: React.FC<InfoPanelProps> = (props) => {
|
const InfoPanel: React.FC<InfoPanelProps> = (props) => {
|
||||||
const { index, spans, isDark, name, Icon } = props;
|
const { index, spans, isDark, name, Icon } = props;
|
||||||
const weight = useRecoilValue(iconStyleAtom);
|
const weight = useRecoilValue(iconWeightAtom);
|
||||||
const size = useRecoilValue(iconSizeAtom);
|
const size = useRecoilValue(iconSizeAtom);
|
||||||
const color = useRecoilValue(iconColorAtom);
|
const color = useRecoilValue(iconColorAtom);
|
||||||
const setOpen = useSetRecoilState(iconPreviewOpenAtom);
|
const setOpen = useSetRecoilState(iconPreviewOpenAtom);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { useSetRecoilState } from "recoil";
|
|||||||
import Select from "react-dropdown-select";
|
import Select from "react-dropdown-select";
|
||||||
import { PencilLine } from "phosphor-react";
|
import { PencilLine } from "phosphor-react";
|
||||||
|
|
||||||
import { iconStyleAtom } from "../../state/atoms";
|
import { iconWeightAtom } from "../../state/atoms";
|
||||||
import { IconStyle } from "../../lib";
|
import { IconStyle } from "../../lib";
|
||||||
import "./StyleInput.css";
|
import "./StyleInput.css";
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ const options: WeightOption[] = [
|
|||||||
type StyleInputProps = {};
|
type StyleInputProps = {};
|
||||||
|
|
||||||
const StyleInput: React.FC<StyleInputProps> = () => {
|
const StyleInput: React.FC<StyleInputProps> = () => {
|
||||||
const setStyle = useSetRecoilState(iconStyleAtom);
|
const setStyle = useSetRecoilState(iconWeightAtom);
|
||||||
|
|
||||||
const handleStyleChange = (values: WeightOption[]) =>
|
const handleStyleChange = (values: WeightOption[]) =>
|
||||||
setStyle(values[0].value as IconStyle);
|
setStyle(values[0].value as IconStyle);
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ export const searchQueryAtom = atom<string>({
|
|||||||
default: "",
|
default: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
export const iconStyleAtom = atom<IconStyle>({
|
export const iconWeightAtom = atom<IconStyle>({
|
||||||
key: "styleQueryAtom",
|
key: "iconWeightAtom",
|
||||||
default: IconStyle.REGULAR,
|
default: IconStyle.REGULAR,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user