Skip to content

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

Update BaseStandardSectionDialog and Pages component for improved styling and functionality

Bill Yang266dd87a0798
diff --git a/client/src/app/[site]/components/shared/StandardSection/BaseStandardSectionDialog.tsx b/client/src/app/[site]/components/shared/StandardSection/BaseStandardSectionDialog.tsx
index 2240600dc..a170bd19f 100644
--- a/client/src/app/[site]/components/shared/StandardSection/BaseStandardSectionDialog.tsx
+++ b/client/src/app/[site]/components/shared/StandardSection/BaseStandardSectionDialog.tsx
@@ -183,7 +183,7 @@ export function BaseStandardSectionDialog({
<DialogTrigger asChild>
<Button variant="outline">View All</Button>
</DialogTrigger>
- <DialogContent className="max-w-[800px] w-[calc(100vw-2rem)] p-2 sm:p-4">
+ <DialogContent className="max-w-[1000px] w-[calc(100vw-2rem)] p-2 sm:p-4">
<DialogHeader>
<DialogTitle>{title}</DialogTitle>
</DialogHeader>
@@ -261,11 +261,11 @@ export function BaseStandardSectionDialog({
>
{cellIndex === 0 && (
<div
- // className="absolute h-0.5 bottom-0 bg-accent-400 opacity-90"
- className="absolute inset-0 bg-accent-400 py-2 opacity-30 rounded-md h-6 mt-1"
- style={{
- width: `${row.original.percentage * ratio}%`,
- }}
+ // className="absolute h-0.5 bottom-0 bg-accent-400 opacity-90"
+ // className="absolute inset-0 bg-accent-400 py-2 opacity-30 rounded-md h-6 mt-1"
+ // style={{
+ // width: `${row.original.percentage * ratio}%`,
+ // }}
></div>
)}
<span className="relative z-0">
diff --git a/client/src/app/[site]/main/components/sections/Pages.tsx b/client/src/app/[site]/main/components/sections/Pages.tsx
index e0a26db6e..91c14a16e 100644
--- a/client/src/app/[site]/main/components/sections/Pages.tsx
+++ b/client/src/app/[site]/main/components/sections/Pages.tsx
@@ -11,7 +11,7 @@ import { Card, CardContent } from "../../../../../components/ui/card";
import { StandardSection } from "../../../components/shared/StandardSection/StandardSection";
import { StandardSectionRealtime } from "../../../components/shared/StandardSection/StandardSectionRealtime";
import { useGetSite } from "../../../../../api/admin/sites";
-
+import { truncateString } from "../../../../../lib/utils";
type Tab = "pages" | "entry_pages" | "exit_pages";
export function Pages({ isRealtime = false }: { isRealtime?: boolean }) {
@@ -39,7 +39,7 @@ export function Pages({ isRealtime = false }: { isRealtime?: boolean }) {
title="Pages"
getValue={(e) => e.value}
getKey={(e) => e.value}
- getLabel={(e) => e.value || "Other"}
+ getLabel={(e) => truncateString(e.value, 50) || "Other"}
getLink={(e) => `https://${siteMetadata?.domain}${e.value}`}
/>
</TabsContent>
diff --git a/client/src/components/TopBar.tsx b/client/src/components/TopBar.tsx
index ba2724f36..48ee24d50 100644
--- a/client/src/components/TopBar.tsx
+++ b/client/src/components/TopBar.tsx
@@ -71,7 +71,7 @@ export function TopBar() {
{session.data?.user.name}
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
- <Link href="/settings/account" legacyBehavior passHref>
+ <Link href="/settings/account" passHref>
<DropdownMenuItem>Settings</DropdownMenuItem>
</Link>
<DropdownMenuItem
@@ -87,7 +87,7 @@ export function TopBar() {
</DropdownMenuContent>
</DropdownMenu>
) : (
- <Link href="/signup" legacyBehavior passHref>
+ <Link href="/signup" passHref>
<Button variant="ghost" size="xs">
Sign up
</Button>
diff --git a/client/src/lib/utils.ts b/client/src/lib/utils.ts
index 7945c8118..b0b8564eb 100644
--- a/client/src/lib/utils.ts
+++ b/client/src/lib/utils.ts
@@ -46,3 +46,7 @@ export function formatDuration(seconds: number): string {
return duration.toFormat("h'h' m'm'");
}
}
+
+export function truncateString(str: string, n = 50) {
+ return str.length > n ? str.substring(0, n) + "..." : str;
+}