mirror of
https://github.com/jnsahaj/tweakcn.git
synced 2026-10-29 19:23:00 +08:00
fix: lint errors
This commit is contained in:
@@ -3,7 +3,6 @@ import { cn } from "@/lib/utils";
|
||||
import Editor from "@/components/editor/editor";
|
||||
import { Metadata } from "next";
|
||||
import { Header } from "../../../components/editor/header";
|
||||
import { ActionBar } from "@/components/editor/action-bar";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "tweakcn — Theme Generator for shadcn/ui",
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import ThemePresetSelect from "./theme-preset-select";
|
||||
import { useEditorStore } from "@/store/editor-store";
|
||||
import { getPresetThemeStyles, presets } from "@/utils/theme-presets";
|
||||
import { Button } from "../ui/button";
|
||||
import { FileCode, RefreshCw, Code, Moon, Sun } from "lucide-react";
|
||||
import CssImportDialog from "./css-import-dialog";
|
||||
@@ -15,15 +13,10 @@ import * as SwitchPrimitives from "@radix-ui/react-switch";
|
||||
import { useTheme } from "../theme-provider";
|
||||
|
||||
export function ActionBar() {
|
||||
const { themeState, applyThemePreset, resetToCurrentPreset, setThemeState } =
|
||||
useEditorStore();
|
||||
const { themeState, resetToCurrentPreset, setThemeState } = useEditorStore();
|
||||
const [cssImportOpen, setCssImportOpen] = useState(false);
|
||||
const [codePanelOpen, setCodePanelOpen] = useState(false);
|
||||
|
||||
const handlePresetChange = (preset: string) => {
|
||||
applyThemePreset(preset);
|
||||
};
|
||||
|
||||
const handleCssImport = (css: string) => {
|
||||
// This just shows a success toast for now
|
||||
const { lightColors, darkColors } = parseCssInput(css);
|
||||
|
||||
@@ -17,10 +17,7 @@ export function CodePanelDialog({
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
<DialogContent className="max-w-4xl h-[80vh] overflow-hidden">
|
||||
<div className="h-full overflow-auto">
|
||||
<CodePanel
|
||||
themeEditorState={themeEditorState}
|
||||
onCodePanelToggle={() => onOpenChange(false)}
|
||||
/>
|
||||
<CodePanel themeEditorState={themeEditorState} />
|
||||
</div>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useState } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Copy, Check, PanelRight } from "lucide-react";
|
||||
import { Copy, Check } from "lucide-react";
|
||||
import { ThemeEditorState } from "@/types/editor";
|
||||
import { ScrollArea, ScrollBar } from "../ui/scroll-area";
|
||||
import { ColorFormat } from "../../types";
|
||||
@@ -14,12 +14,8 @@ import {
|
||||
import { usePostHog } from "posthog-js/react";
|
||||
import { useEditorStore } from "@/store/editor-store";
|
||||
import { usePreferencesStore } from "@/store/preferences-store";
|
||||
import {
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
TooltipTrigger,
|
||||
} from "@/components/ui/tooltip";
|
||||
import { generateThemeCode } from "@/utils/theme-style-generator";
|
||||
|
||||
interface CodePanelProps {
|
||||
themeEditorState: ThemeEditorState;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import React, { useState } from "react";
|
||||
import React from "react";
|
||||
import {
|
||||
ResizablePanelGroup,
|
||||
ResizablePanel,
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
"use client";
|
||||
|
||||
import Link from "next/link";
|
||||
import { Moon, Sun, Heart } from "lucide-react";
|
||||
import { Heart } from "lucide-react";
|
||||
import GitHubIcon from "@/assets/github.svg";
|
||||
import TwitterIcon from "@/assets/twitter.svg";
|
||||
import DiscordIcon from "@/assets/discord.svg";
|
||||
import { useTheme } from "@/components/theme-provider";
|
||||
import Logo from "@/assets/logo.svg";
|
||||
import { useGithubStars } from "@/hooks/use-github-stars";
|
||||
import { SocialLink } from "@/components/social-link";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import React, { useState } from "react";
|
||||
import React from "react";
|
||||
import { ThemeEditorControlsProps, ThemeStyleProps } from "@/types/theme";
|
||||
import ControlSection from "./control-section";
|
||||
import ColorPicker from "./color-picker";
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
import { useEditorStore } from "../../store/editor-store";
|
||||
import { Label } from "../ui/label";
|
||||
import { SliderWithInput } from "./slider-with-input";
|
||||
import { Tabs, TabsList, TabsTrigger, TabsContent } from "../ui/tabs";
|
||||
import { Tabs, TabsList, TabsContent } from "../ui/tabs";
|
||||
import ThemeFontSelect from "./theme-font-select";
|
||||
import {
|
||||
DEFAULT_FONT_MONO,
|
||||
@@ -27,11 +27,7 @@ import {
|
||||
} from "../../config/theme";
|
||||
import { Separator } from "../ui/separator";
|
||||
import { AlertCircle } from "lucide-react";
|
||||
import CssImportDialog from "./css-import-dialog";
|
||||
import { toast } from "../ui/use-toast";
|
||||
import { parseCssInput } from "../../utils/parse-css-input";
|
||||
import ShadowControl from "./shadow-control";
|
||||
import ThemeControlActions from "./theme-control-actions";
|
||||
import TabsTriggerPill from "./theme-preview/tabs-trigger-pill";
|
||||
|
||||
const ThemeControlPanel = ({
|
||||
@@ -39,15 +35,7 @@ const ThemeControlPanel = ({
|
||||
currentMode,
|
||||
onChange,
|
||||
}: ThemeEditorControlsProps) => {
|
||||
const {
|
||||
applyThemePreset,
|
||||
themeState,
|
||||
resetToCurrentPreset,
|
||||
resetToDefault,
|
||||
hasDefaultThemeChanged,
|
||||
hasCurrentPresetChanged,
|
||||
} = useEditorStore();
|
||||
const [cssImportOpen, setCssImportOpen] = useState(false);
|
||||
const { applyThemePreset, themeState } = useEditorStore();
|
||||
|
||||
const currentStyles = React.useMemo(
|
||||
() => ({
|
||||
|
||||
@@ -47,7 +47,7 @@ const ThemePreviewPanel = ({
|
||||
<div
|
||||
className={cn(
|
||||
"min-h-0 flex flex-col flex-1",
|
||||
isFullscreen && "fixed inset-0 z-50 bg-background p-4"
|
||||
isFullscreen && "fixed inset-0 z-50 bg-background"
|
||||
)}
|
||||
>
|
||||
<Tabs defaultValue="cards" className="flex flex-col overflow-hidden">
|
||||
|
||||
Reference in New Issue
Block a user