Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

Remove NoData component and clean up SiteLayout structure

Bill Yang8b4529d9e4c2
diff --git a/client/src/app/[site]/components/NoData.tsx b/client/src/app/[site]/components/NoData.tsx
deleted file mode 100644
index 5889ec120..000000000
--- a/client/src/app/[site]/components/NoData.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-import { CodeSnippet } from "../../../components/CodeSnippet";
-import { Card, CardContent, CardHeader } from "../../../components/ui/card";
-import { GetSitesResponse } from "../../../api/admin/sites";
-import { BACKEND_URL } from "../../../lib/const";
-import { StandardPage } from "../../../components/StandardPage";
-
-export function NoData({
- siteMetadata,
-}: {
- siteMetadata?: GetSitesResponse[number];
-}) {
- return (
- <StandardPage>
- <div className="flex justify-center items-center mt-5">
- <Card className="w-[500px] p-2">
- <CardHeader className="flex justify-center items-center">
- <div className="text-xl font-medium text-center w-full">
- Waiting for analytics from {siteMetadata?.domain}...
- </div>
- <div className="p-5">
- <span className="relative flex h-6 w-6">
- <span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-green-400 opacity-75"></span>
- <span className="relative inline-flex h-6 w-6 rounded-full bg-green-500"></span>
- </span>
- </div>
- </CardHeader>
- <CardContent className="flex flex-col gap-4">
- <div className="flex flex-col gap-1">
- <div className="text-sm text-muted-foreground">
- Place this snippet in the &lt;head&gt; of your website
- </div>
- <CodeSnippet
- language="HTML"
- code={`<script\n src="${BACKEND_URL}/script.js"\n site-id="${siteMetadata?.siteId}"\n defer\n/>`}
- />
- </div>
- </CardContent>
- </Card>
- </div>
- </StandardPage>
- );
-}
diff --git a/client/src/app/[site]/layout.tsx b/client/src/app/[site]/layout.tsx
index 811975f67..3eba3c0ca 100644
--- a/client/src/app/[site]/layout.tsx
+++ b/client/src/app/[site]/layout.tsx
@@ -5,7 +5,6 @@ import { useStore } from "../../lib/store";
import { useSyncStateWithUrl } from "../../lib/urlParams";
import { Header } from "./components/Header/Header";
import { useSiteHasData, useGetSite } from "../../api/admin/sites";
-import { NoData } from "./components/NoData";
import { TopBar } from "../../components/TopBar";
import { Sidebar } from "./components/Sidebar/Sidebar";
import { useWindowSize } from "@uidotdev/usehooks";
@@ -41,10 +40,6 @@ export default function SiteLayout({
return null;
}
- // if (!siteHasData && !isLoading && !isLoadingSiteMetadata) {
- // return <NoData siteMetadata={siteMetadata} />;
- // }
-
if (width && width < 768) {
return (
<div className="">
@@ -52,12 +47,7 @@ export default function SiteLayout({
<Header />
<div>{children}</div>
</div>
- // <div className="flex flex-col h-screen relative">
- // <div className="sticky top-0 z-10 bg-background">
- // <TopBar />
- // </div>
- // <div className="overflow-auto">{children}</div>
- // </div>
+
);
}
@@ -69,7 +59,6 @@ export default function SiteLayout({
<Sidebar />
</div>
<div className="flex-1 overflow-auto">
- <div>
{/* <div className="px-4 py-2 max-w-[1400px] mx-auto w-full mb-4"> */}
<Header />
<div>{children}</div>