Skip to content

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

Update styling and improve component structure across various files

Bill Yang34bc766bbdf1
diff --git a/client/src/app/[site]/components/Sidebar/Sidebar.tsx b/client/src/app/[site]/components/Sidebar/Sidebar.tsx
index 264682aca..9cb8177dd 100644
--- a/client/src/app/[site]/components/Sidebar/Sidebar.tsx
+++ b/client/src/app/[site]/components/Sidebar/Sidebar.tsx
@@ -37,7 +37,7 @@ export function Sidebar() {
};
return (
- <div className="w-56 bg-neutral-900 border-r border-neutral-850 h-full flex flex-col">
+ <div className="w-56 bg-neutral-900 border-r border-neutral-800 h-full flex flex-col">
{site && (
<div className="p-3 border-b border-neutral-800 flex flex-col gap-2">
<SiteSelector />
diff --git a/client/src/app/[site]/components/shared/StandardSection/BaseStandardSectionDialog.tsx b/client/src/app/[site]/components/shared/StandardSection/BaseStandardSectionDialog.tsx
index 540ccad91..34cbe95ad 100644
--- a/client/src/app/[site]/components/shared/StandardSection/BaseStandardSectionDialog.tsx
+++ b/client/src/app/[site]/components/shared/StandardSection/BaseStandardSectionDialog.tsx
@@ -51,7 +51,7 @@ export function BaseStandardSectionDialog({
? (labelFnToUse(item) as string)
: labelFnToUse(item);
- return label.toLowerCase().includes(searchTerm.toLowerCase());
+ return String(label).toLowerCase().includes(searchTerm.toLowerCase());
});
return (
diff --git a/client/src/app/[site]/main/components/MainSection/MainSection.tsx b/client/src/app/[site]/main/components/MainSection/MainSection.tsx
index 9d1e45242..2196563cd 100644
--- a/client/src/app/[site]/main/components/MainSection/MainSection.tsx
+++ b/client/src/app/[site]/main/components/MainSection/MainSection.tsx
@@ -29,29 +29,38 @@ export function MainSection() {
);
return (
- <Card>
- {(isFetching ||
- isPreviousFetching ||
- isOverviewFetching ||
- isOverviewFetchingPrevious) && <CardLoader />}
- <CardContent className="pt-4 w-full">
- <div className="flex justify-between items-center">
- <Overview />
- <BucketSelection />
- </div>
- <div className="h-[310px] relative">
- <div className="absolute top-0 left-0 w-full h-full">
- <PreviousChart data={previousData} max={maxOfDataAndPreviousData} />
+ <>
+ <Card>
+ {(isOverviewFetching || isOverviewFetchingPrevious) && <CardLoader />}
+ <CardContent className="pt-4 w-full">
+ <div className="flex justify-between items-center">
+ <Overview />
+ <BucketSelection />
</div>
- <div className="absolute top-0 left-0 w-full h-full">
- <Chart
- data={data}
- max={maxOfDataAndPreviousData}
- previousData={time.mode === "all-time" ? undefined : previousData}
- />
+ </CardContent>
+ </Card>
+ <Card>
+ {(isFetching || isPreviousFetching) && <CardLoader />}
+ <CardContent className="pt-4 w-full">
+ <div className="h-[310px] relative">
+ <div className="absolute top-0 left-0 w-full h-full">
+ <PreviousChart
+ data={previousData}
+ max={maxOfDataAndPreviousData}
+ />
+ </div>
+ <div className="absolute top-0 left-0 w-full h-full">
+ <Chart
+ data={data}
+ max={maxOfDataAndPreviousData}
+ previousData={
+ time.mode === "all-time" ? undefined : previousData
+ }
+ />
+ </div>
</div>
- </div>
- </CardContent>
- </Card>
+ </CardContent>
+ </Card>
+ </>
);
}
diff --git a/client/src/app/[site]/realtime/RealtimeGlobe/RealtimeGlobe.tsx b/client/src/app/[site]/realtime/RealtimeGlobe/RealtimeGlobe.tsx
index f9dfa3428..0cf95e1e2 100644
--- a/client/src/app/[site]/realtime/RealtimeGlobe/RealtimeGlobe.tsx
+++ b/client/src/app/[site]/realtime/RealtimeGlobe/RealtimeGlobe.tsx
@@ -13,7 +13,7 @@ import { useAtom } from "jotai";
import { minutesAtom } from "../realtimeStore";
const randomShader = memoize((e: string) => {
- return `rgba(100, 100, 100, ${Math.random() / 2 + 0.5})`;
+ return `rgba(120, 140, 110, ${Math.random() / 2 + 0.5})`;
});
export const World = ({ width }: { width: number }) => {
diff --git a/client/src/app/[site]/retention/page.tsx b/client/src/app/[site]/retention/page.tsx
index e9cb3a644..bb7352465 100644
--- a/client/src/app/[site]/retention/page.tsx
+++ b/client/src/app/[site]/retention/page.tsx
@@ -1,18 +1,20 @@
"use client";
+import { HelpCircle } from "lucide-react";
+import { DateTime } from "luxon"; // Import Luxon for date formatting
+import { Fragment, useMemo, useState } from "react";
import {
- useGetRetention,
RetentionMode,
+ useGetRetention,
} from "../../../api/analytics/useGetRetention";
-import { DateTime } from "luxon"; // Import Luxon for date formatting
-import { Fragment, useMemo, useState } from "react";
+import { ThreeDotLoader } from "../../../components/Loaders";
import {
Card,
CardContent,
CardHeader,
CardTitle,
} from "../../../components/ui/card";
-import { Tabs, TabsList, TabsTrigger } from "../../../components/ui/tabs";
+import { Label } from "../../../components/ui/label";
import {
Select,
SelectContent,
@@ -20,17 +22,14 @@ import {
SelectTrigger,
SelectValue,
} from "../../../components/ui/select";
-import { Label } from "../../../components/ui/label";
+import { Tabs, TabsList, TabsTrigger } from "../../../components/ui/tabs";
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from "../../../components/ui/tooltip";
-import { HelpCircle } from "lucide-react";
-import { Skeleton } from "../../../components/ui/skeleton";
import { RetentionChart } from "./RetentionChart";
-import { ThreeDotLoader } from "../../../components/Loaders";
// Available time range options (in days)
const RANGE_OPTIONS = [
@@ -43,10 +42,6 @@ const RANGE_OPTIONS = [
{ value: "365", label: "1 year" },
];
-// Default number of periods and cohorts for skeleton
-const DEFAULT_SKELETON_PERIODS = 6;
-const DEFAULT_SKELETON_COHORTS = 8;
-
// Dynamic color function that creates a smooth gradient based on retention percentage
const getRetentionColor = (
percentage: number | null
@@ -89,7 +84,7 @@ export default function RetentionPage() {
// State for the retention mode (day or week)
const [mode, setMode] = useState<RetentionMode>("week");
// State for the data time range (days)
- const [timeRange, setTimeRange] = useState<number>(90);
+ const [timeRange, setTimeRange] = useState<number>(30);
// Use the updated hook without the limit parameter
const { data, isLoading, isError } = useGetRetention(mode, timeRange);
diff --git a/client/src/app/globals.css b/client/src/app/globals.css
index ab1e92cba..62808a176 100644
--- a/client/src/app/globals.css
+++ b/client/src/app/globals.css
@@ -99,7 +99,7 @@ body {
--neutral-800: 0 0% 20%;
--neutral-850: 0 0% 16%;
--neutral-900: 0 0% 12%;
- --neutral-950: 0 0% 8%;
+ --neutral-950: 0 0% 9%;
--neutral-1000: 0 0% 5%;
/* Stone */
diff --git a/client/src/components/TopBar.tsx b/client/src/components/TopBar.tsx
index 774128a2e..328dfc6c3 100644
--- a/client/src/components/TopBar.tsx
+++ b/client/src/components/TopBar.tsx
@@ -19,7 +19,7 @@ export function TopBar() {
const queryClient = useQueryClient();
return (
- <div className="flex py-1 px-3 items-center w-full bg-neutral-900 justify-center">
+ <div className="flex py-1 px-3 items-center w-full bg-neutral-950 justify-center border-b border-neutral-750">
<div className="flex items-center justify-between flex-1">
<div className="flex items-center space-x-4">
<Link href="/" className="font-semibold text-base">