🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.
Add demo mode support and improve EventList component
Bill Yang2988e7b07965
diff --git a/client/src/app/[site]/events/components/EventList.tsx b/client/src/app/[site]/events/components/EventList.tsxindex 5841caa03..1f6ee8c5c 100644--- a/client/src/app/[site]/events/components/EventList.tsx+++ b/client/src/app/[site]/events/components/EventList.tsx@@ -5,8 +5,8 @@ import { ChevronDown, ChevronRight, Info } from "lucide-react";import { memo, useState } from "react";import { EventName } from "../../../../api/analytics/useGetEventNames";import { useGetEventProperties } from "../../../../api/analytics/useGetEventProperties";-import { EventProperties } from "./EventProperties";import { NothingFound } from "../../../../components/NothingFound";+import { EventProperties } from "./EventProperties";// Skeleton component for EventListconst EventListSkeleton = memo(@@ -105,7 +105,12 @@ export function EventList({}if (!events || events.length === 0) {- return (+ return size === "small" ? (+ <div className="text-neutral-300 w-full text-center mt-6 flex flex-row gap-2 items-center justify-center">+ <Info className="w-5 h-5" />+ No Data+ </div>+ ) : (<NothingFoundtitle={"No custom events found"}description={"Try a different date range or filter"}diff --git a/client/src/components/TopBar.tsx b/client/src/components/TopBar.tsxindex 21395b80b..08c850ff5 100644--- a/client/src/components/TopBar.tsx+++ b/client/src/components/TopBar.tsx@@ -13,6 +13,7 @@ import {DropdownMenuItem,DropdownMenuTrigger,} from "./ui/dropdown-menu";+import { IS_DEMO } from "../lib/const";export function TopBar() {const session = authClient.useSession();@@ -53,6 +54,12 @@ export function TopBar() {</DropdownMenuItem></DropdownMenuContent></DropdownMenu>+ ) : IS_DEMO ? (+ <Link href="https://app.rybbit.io/signup" passHref>+ <Button variant="ghost" size="xs">+ Sign up+ </Button>+ </Link>) : (<Link href="/signup" passHref><Button variant="ghost" size="xs">diff --git a/client/src/lib/const.ts b/client/src/lib/const.tsindex b0d2b4ae0..fa28ab75f 100644--- a/client/src/lib/const.ts+++ b/client/src/lib/const.ts@@ -3,3 +3,4 @@ export const BACKEND_URL =? "http://localhost:3001": `${process.env.NEXT_PUBLIC_BACKEND_URL}/api`;export const IS_CLOUD = process.env.NEXT_PUBLIC_CLOUD === "true";+export const IS_DEMO = process.env.NEXT_PUBLIC_DEMO === "true";diff --git a/docker-compose.dev.yml b/docker-compose.dev.ymlindex a7093b807..d86875f75 100644--- a/docker-compose.dev.yml+++ b/docker-compose.dev.yml@@ -98,6 +98,7 @@ services:NEXT_PUBLIC_CLOUD: ${CLOUD}environment:- NODE_ENV=production+ - NEXT_PUBLIC_DEMO=true- NEXT_PUBLIC_BACKEND_URL=${BASE_URL}- NEXT_PUBLIC_CLOUD=${CLOUD}depends_on: