Skip to content

Commit 69d26ad

Browse files
committed
Refactor StandardSection layout for improved styling and readability
- Adjusted the layout of the StandardSection component to enhance visual spacing and organization. - Updated the maximum height of the items display area for better content management. - Commented out the slice method for items display to allow for potential future adjustments.
1 parent 5db8266 commit 69d26ad

1 file changed

Lines changed: 22 additions & 23 deletions

File tree

client/src/app/[site]/components/shared/StandardSection/StandardSection.tsx

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
"use client";
22

3-
import { Button } from "@/components/ui/button";
43
import { FilterParameter } from "@rybbit/shared";
5-
import { AlertCircle, Info, RefreshCcw } from "lucide-react";
4+
import { Info } from "lucide-react";
65
import Link from "next/link";
76
import { ReactNode } from "react";
87
import { MetricResponse, usePaginatedMetric } from "../../../../../api/analytics/useGetMetric";
8+
import { ErrorState } from "../../../../../components/ErrorState";
99
import { CardLoader } from "../../../../../components/ui/card";
1010
import { Tooltip, TooltipContent, TooltipTrigger } from "../../../../../components/ui/tooltip";
1111
import { IS_CLOUD } from "../../../../../lib/const";
1212
import { Row } from "./Row";
1313
import { StandardSkeleton } from "./Skeleton";
1414
import { StandardSectionDialog } from "./StandardSectionDialog";
15-
import { ErrorState } from "../../../../../components/ErrorState";
1615

1716
const MAX_ITEMS_TO_DISPLAY = 10;
1817

@@ -60,26 +59,26 @@ export function StandardSection({
6059
<CardLoader />
6160
</div>
6261
)}
63-
<div className="flex flex-col gap-2 max-h-[344px] overflow-y-auto overflow-x-hidden">
64-
<div className="flex flex-row gap-2 justify-between pr-1 text-xs text-neutral-600 dark:text-neutral-400">
65-
<div className="flex flex-row gap-1 items-center">
66-
{title}
67-
{IS_CLOUD && ["Countries", "Regions", "Cities"].includes(title) && (
68-
<Tooltip>
69-
<TooltipTrigger>
70-
<Info className="w-3 h-3" />
71-
</TooltipTrigger>
72-
<TooltipContent>
73-
Geolocation by{" "}
74-
<Link href="https://ipapi.is/" target="_blank" className="text-emerald-400 hover:text-emerald-300">
75-
ipapi.is
76-
</Link>
77-
</TooltipContent>
78-
</Tooltip>
79-
)}
80-
</div>
81-
<div>{countLabel || "Sessions"}</div>
62+
<div className="flex flex-row gap-2 justify-between pr-1 text-xs text-neutral-600 dark:text-neutral-400 mb-2">
63+
<div className="flex flex-row gap-1 items-center">
64+
{title}
65+
{IS_CLOUD && ["Countries", "Regions", "Cities"].includes(title) && (
66+
<Tooltip>
67+
<TooltipTrigger>
68+
<Info className="w-3 h-3" />
69+
</TooltipTrigger>
70+
<TooltipContent>
71+
Geolocation by{" "}
72+
<Link href="https://ipapi.is/" target="_blank" className="text-emerald-400 hover:text-emerald-300">
73+
ipapi.is
74+
</Link>
75+
</TooltipContent>
76+
</Tooltip>
77+
)}
8278
</div>
79+
<div>{countLabel || "Sessions"}</div>
80+
</div>
81+
<div className="flex flex-col gap-2 max-h-[314px] overflow-y-auto overflow-x-hidden">
8382
{isLoading ? (
8483
<StandardSkeleton />
8584
) : error ? (
@@ -88,7 +87,7 @@ export function StandardSection({
8887
<>
8988
{itemsForDisplay?.length ? (
9089
itemsForDisplay
91-
.slice(0, MAX_ITEMS_TO_DISPLAY)
90+
// .slice(0, MAX_ITEMS_TO_DISPLAY)
9291
.map(e => (
9392
<Row
9493
key={getKey(e)}

0 commit comments

Comments
 (0)