Skip to content

Commit

Permalink
chore: lint 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludovico7 committed Nov 25, 2024
1 parent 63a2ac8 commit c22551b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 100 deletions.
Original file line number Diff line number Diff line change
@@ -1,23 +1,4 @@
/* eslint-disable @pandacss/no-dynamic-styling */
import { TextColorType } from "@noctaCrdt/Interfaces";
import { colors } from "@src/styles/tokens/color";
import { css, cva } from "@styled-system/css";
import { token } from "@styled-system/tokens";

type ColorVariants = {
[K in TextColorType]: { color: string };
};

const colorVariants: ColorVariants = {
black: { color: "#2B4158" },
red: { color: "#F24150" },
green: { color: "#1BBF44" },
blue: { color: "#4285F4" },
yellow: { color: "#FEA642" },
purple: { color: "#A142FE" },
brown: { color: "#8B4513" },
white: { color: "#C1D7F4" },
};
import { css } from "@styled-system/css";

export const optionModal = css({
zIndex: 1000,
Expand Down Expand Up @@ -55,61 +36,3 @@ export const divider = css({
height: "20px",
margin: "0 8px",
});

export const colorOptionButton = css({
width: "28px",
height: "28px",
margin: "0 2px",
cursor: "pointer",
_hover: {
transform: "scale(1.1)",
},
});

// 색상 ν‘œμ‹œ μ›ν˜• μŠ€νƒ€μΌ 베이슀
const colorIndicatorBase = {
width: "28px",
height: "28px",
borderRadius: "3px",
transition: "all 0.2s",
};

// ν…μŠ€νŠΈ 색상 indicator
export const textColorIndicator = cva({
...colorIndicatorBase,
variants: {
color: colorVariants,
},
});

export const backgroundColorIndicator = cva({
...colorIndicatorBase,
variants: {
color: {
black: {
backgroundColor: `color-mix(in srgb, ${token("colors.gray.900")}, white 20%)`,
},
red: {
backgroundColor: `color-mix(in srgb, ${token("colors.red")}, white 20%)`,
},
yellow: {
backgroundColor: `color-mix(in srgb, ${token("colors.yellow")}, white 20%)`,
},
green: {
backgroundColor: `color-mix(in srgb, ${token("colors.green")}, white 20%)`,
},
purple: {
backgroundColor: `color-mix(in srgb, ${token("colors.purple")}, white 20%)`,
},
brown: {
backgroundColor: `color-mix(in srgb, ${token("colors.brown")}, white 20%)`,
},
blue: {
backgroundColor: `color-mix(in srgb, ${token("colors.blue")}, white 20%)`,
},
white: {
backgroundColor: token("colors.white"),
},
},
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,7 @@ import { useEffect, useRef, useState } from "react";
import { createPortal } from "react-dom";
import { BackgroundColorOptionModal } from "../ColorOptionModal/BackgroundColorOptionModal";
import { TextColorOptionModal } from "../ColorOptionModal/TextColorOptionModal";
import {
modalContainer,
optionButton,
optionModal,
divider,
textColorIndicator,
backgroundColorIndicator,
colorOptionButton,
} from "./TextOptionModal.style";

// μ‚¬μš© κ°€λŠ₯ν•œ 색상 λ°°μ—΄
const COLORS: TextColorType[] = [
"black",
"red",
"green",
"blue",
"yellow",
"purple",
"brown",
"white",
];
import { modalContainer, optionButton, optionModal, divider } from "./TextOptionModal.style";

interface SelectionModalProps {
selectedNodes: Array<Char> | null;
Expand Down Expand Up @@ -268,7 +248,7 @@ export const TextOptionModal = ({
<div
style={{ position: "relative" }}
onMouseEnter={() => handleMouseEnter("text")}
onClick={(e) => handleClickButton("text")}
onClick={() => handleClickButton("text")}
>
<button className={optionButton}>
<span>A</span>
Expand Down

0 comments on commit c22551b

Please sign in to comment.