Skip to content

Commit

Permalink
Fix window error
Browse files Browse the repository at this point in the history
  • Loading branch information
ericciarla committed May 27, 2024
1 parent 0e28688 commit 8aa624e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Inter } from "next/font/google";
import "./globals.css";
import { Toaster } from "sonner";
import { Analytics } from "@vercel/analytics/react";
import { useEffect, useState } from "react";
const inter = Inter({ subsets: ["latin"] });

export const metadata: Metadata = {
Expand All @@ -15,6 +16,11 @@ export default function RootLayout({
}: Readonly<{
children: React.ReactNode;
}>) {
const [isClient, setIsClient] = useState(false);

useEffect(() => {
setIsClient(true);
}, []);
return (
<html lang="en">
<body className={inter.className}>{children}</body>
Expand Down
6 changes: 6 additions & 0 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@
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 [isClient, setIsClient] = useState(false);

useEffect(() => {
setIsClient(true);
}, []);
const githubStars = await useGithubStars();
return (
<div className="relative">
Expand Down
6 changes: 6 additions & 0 deletions src/components/data-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
import { Button } from "./ui/button";
import { Input } from "./ui/input";
import { Textarea } from "./ui/textarea";
import { useEffect, useState } from "react";

type DataInputProps = {
setChartData: any;
Expand Down Expand Up @@ -40,6 +41,11 @@ export default function DataInput({
pastedCsvData,
setPastedCsvData,
}: DataInputProps) {
const [isClient, setIsClient] = useState(false);

useEffect(() => {
setIsClient(true);
}, []);
return (
<div
className={`${
Expand Down
7 changes: 6 additions & 1 deletion src/components/menu.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import React, { useEffect } from "react";
import {
Select,
SelectContent,
Expand Down Expand Up @@ -97,6 +97,11 @@ export default function Menu({
openCsv: boolean;
setOpenCsv: (openCsv: boolean) => void;
}) {
const [isClient, setIsClient] = useState(false);

useEffect(() => {
setIsClient(true);
}, []);
const generateEmbedCode = () => {
const embedCode = `
<iframe
Expand Down

0 comments on commit 8aa624e

Please sign in to comment.