Skip to content

Commit

Permalink
Nick:
Browse files Browse the repository at this point in the history
  • Loading branch information
nickscamara committed May 28, 2024
1 parent 38d70cc commit bb098c3
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 88 deletions.
5 changes: 0 additions & 5 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
import MainComponent from "@/components/main";
import { useGithubStars } from "./hooks/useGithubStars";
import GithubButton from "@/components/github-button";
import { useEffect, useState } from "react";

/**
* The issue in the original code is that the `allThemes["firecrawl"]` object does not match the expected `Theme` type.
* To fix this, we need to ensure that the `allThemes["firecrawl"]` object conforms to the `Theme` type.
*/

export default async function Home() {
const githubStars = await useGithubStars();
Expand Down
34 changes: 0 additions & 34 deletions src/components/main.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// pages/index.tsx
"use client";

import Menu from "../components/menu";
Expand All @@ -10,11 +9,6 @@ import DataInput from "@/components/data-input";
import { Button } from "@/components/ui/button";
import { Github } from "lucide-react";

/**
* The issue in the original code is that the `allThemes["firecrawl"]` object does not match the expected `Theme` type.
* To fix this, we need to ensure that the `allThemes["firecrawl"]` object conforms to the `Theme` type.
*/

export default function MainComponent() {
const initialData = [
{ Date: "Apr 15, 2024", Stars: 0 },
Expand Down Expand Up @@ -70,14 +64,11 @@ export default function MainComponent() {

const [background, setBackground] = useState(true);
const [darkMode, setDarkMode] = useState(false);
const [copyAsImage, setCopyAsImage] = useState(false);
const [pastedCsvData, setPastedCsvData] = useState("");
const [repoUrl, setRepoUrl] = useState("");
const [open, setOpen] = useState(false);
const [openCsv, setOpenCsv] = useState(false);
const chartRef = useRef<HTMLDivElement>(null);
const [githubLink, setGithubLink] = useState<string>("");
const [csvData, setCsvData] = useState<string>("");
const [graphTitle, setGraphTitle] = useState<string>("Firegraph🔥");
const [maxValue, setMaxValue] = useState(0);
const [finalChartData, setFinalChartData] = useState(chartData);
Expand Down Expand Up @@ -135,17 +126,6 @@ export default function MainComponent() {
}}
>
<main className="relative flex h-[95vh] flex-col items-center justify-start bg-transparent bg-opacity-80">
{/* <Button
onClick={() => {
window.open('https://github.com/mendableai/firecrawl', '_blank');
}}
variant="outline"
size="icon"
className="px-3 w-22 gap-2"
>
<Github className="h-4 w-4" />{' '}
{githubStars ? `${(githubStars / 1000).toFixed(1)}k` : 'GitHub'}
</Button> */}
<DataInput
setChartData={setChartData}
setXName={setXName}
Expand Down Expand Up @@ -190,20 +170,6 @@ export default function MainComponent() {
setBackground={setBackground}
darkMode={darkMode}
setDarkMode={setDarkMode}
handleExportCopyAsImage={() => handleExport(true)}
setChartData={setChartData}
setXName={setXName}
setYName={setYName}
setGraphTitle={setGraphTitle}
graphTitle={graphTitle}
pastedCsvData={pastedCsvData}
setPastedCsvData={setPastedCsvData}
repoUrl={repoUrl}
setRepoUrl={setRepoUrl}
open={open}
setOpen={setOpen}
openCsv={openCsv}
setOpenCsv={setOpenCsv}
/>
{typeof window !== "undefined" && (
<div
Expand Down
49 changes: 0 additions & 49 deletions src/components/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,15 @@ import { Theme, allThemes } from "@/lib/theme";
import { Button } from "./ui/button";
import { Switch } from "./ui/switch";
import {
ArrowUp,
ArrowUp01,
ChevronUp,
ClipboardPasteIcon,
Code,
Copy,
Download,
Github,
Image,
MoveUpIcon,
Plus,
} from "lucide-react";
import {
Dialog,
DialogTrigger,
DialogContent,
DialogHeader,
DialogTitle,
DialogDescription,
} from "./ui/dialog";
import { SelectIcon } from "@radix-ui/react-select";
import { toast } from "sonner";
import { Textarea } from "./ui/textarea";
import { Input } from "./ui/input";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "./ui/dropdown-menu";
import { useState } from "react";
Expand All @@ -49,53 +28,25 @@ export default function Menu({
setPadding,
width,
setWidth,
setChartData,
setXName,
setYName,
theme,
setTheme,
background,
setBackground,
darkMode,
setDarkMode,
handleExportCopyAsImage,
handleExport,
graphTitle,
setGraphTitle,
pastedCsvData,
setPastedCsvData,
repoUrl,
setRepoUrl,
open,
setOpen,
openCsv,
setOpenCsv,
}: {
padding: number;
setPadding: (padding: number) => void;
width: string;
setWidth: (width: string) => void;
setChartData: (data: any) => void;
setXName: (xName: string) => void;
setYName: (yName: string) => void;
theme: Theme;
setTheme: (theme: Theme) => void;
background: boolean;
setBackground: (background: boolean) => void;
darkMode: boolean;
setDarkMode: (darkMode: boolean) => void;
handleExportCopyAsImage: () => void;
handleExport: () => void;
graphTitle: string;
setGraphTitle: (graphTitle: string) => void;
pastedCsvData: string;
setPastedCsvData: (pastedCsvData: string) => void;
repoUrl: string;
setRepoUrl: (repoUrl: string) => void;
open: boolean;
setOpen: (open: boolean) => void;
openCsv: boolean;
setOpenCsv: (openCsv: boolean) => void;
}) {
const [isClient, setIsClient] = useState(false);

Expand Down

0 comments on commit bb098c3

Please sign in to comment.