🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.
Enhance StandardSection and related components with geolocation tooltips
Bill Yang8a4423eb30d5
diff --git a/client/src/app/[site]/components/shared/StandardSection/StandardSection.tsx b/client/src/app/[site]/components/shared/StandardSection/StandardSection.tsxindex 4383b2b91..3421a314d 100644--- a/client/src/app/[site]/components/shared/StandardSection/StandardSection.tsx+++ b/client/src/app/[site]/components/shared/StandardSection/StandardSection.tsx@@ -10,6 +10,9 @@ import { CardLoader } from "../../../../../components/ui/card";import { Row } from "./Row";import { Skeleton } from "./Skeleton";import { StandardSectionDialog } from "./StandardSectionDialog";+import { Tooltip, TooltipContent, TooltipTrigger } from "../../../../../components/ui/tooltip";+import Link from "next/link";+import { IS_CLOUD } from "../../../../../lib/const";const MAX_ITEMS_TO_DISPLAY = 10;@@ -81,7 +84,26 @@ export function StandardSection({) : (<div className="flex flex-col gap-2 overflow-x-hidden"><div className="flex flex-row gap-2 justify-between pr-1 text-xs text-neutral-400">- <div>{title}</div>+ <div className="flex flex-row gap-1 items-center">+ {title}+ {IS_CLOUD && ["Countries", "Regions", "Cities"].includes(title) && (+ <Tooltip>+ <TooltipTrigger>+ <Info className="w-3 h-3" />+ </TooltipTrigger>+ <TooltipContent>+ Geolocation by{" "}+ <Link+ href="https://ipapi.is/"+ target="_blank"+ className="text-emerald-400 hover:text-emerald-300"+ >+ ipapi.is+ </Link>+ </TooltipContent>+ </Tooltip>+ )}+ </div><div>{countLabel || "Sessions"}</div></div>{itemsForDisplay?.length ? (diff --git a/client/src/app/[site]/main/components/sections/Countries.tsx b/client/src/app/[site]/main/components/sections/Countries.tsxindex 57b8a5513..398e91281 100644--- a/client/src/app/[site]/main/components/sections/Countries.tsx+++ b/client/src/app/[site]/main/components/sections/Countries.tsx@@ -2,13 +2,13 @@import { ChevronRight, Expand, Globe } from "lucide-react";import { useState } from "react";import { Tabs, TabsContent, TabsList, TabsTrigger } from "../../../../../components/ui/basic-tabs";+import { Button } from "../../../../../components/ui/button";import { Card, CardContent } from "../../../../../components/ui/card";+import { useSubdivisions } from "../../../../../lib/geo";import { getCountryName, getLanguageName } from "../../../../../lib/utils";+import { MapComponent } from "../../../components/shared/Map/MapComponent";import { StandardSection } from "../../../components/shared/StandardSection/StandardSection";import { CountryFlag } from "../../../components/shared/icons/CountryFlag";-import { useSubdivisions } from "../../../../../lib/geo";-import { Button } from "../../../../../components/ui/button";-import { MapComponent } from "../../../components/shared/Map/MapComponent";type Tab = "countries" | "regions" | "languages" | "cities" | "map";diff --git a/client/src/app/components/Footer.tsx b/client/src/app/components/Footer.tsxindex 9912b8125..b38ef2268 100644--- a/client/src/app/components/Footer.tsx+++ b/client/src/app/components/Footer.tsx@@ -1,4 +1,5 @@import Link from "next/link";+import { IS_CLOUD } from "../../lib/const";export function Footer() {const APP_VERSION = process.env.NEXT_PUBLIC_APP_VERSION;@@ -18,6 +19,11 @@ export function Footer() {<Link href="https://github.com/rybbit-io/rybbit" className="hover:text-neutral-300">Github</Link>+ {IS_CLOUD && (+ <Link href="https://ipapi.is/" className="hover:text-neutral-300" target="_blank">+ Geolocation by ipapi.is+ </Link>+ )}</div>);}diff --git a/docs/src/app/privacy/page.tsx b/docs/src/app/privacy/page.tsxindex a1f4b8450..9aeef772a 100644--- a/docs/src/app/privacy/page.tsx+++ b/docs/src/app/privacy/page.tsx@@ -47,8 +47,12 @@ export default function PrivacyPolicy() {<h2 className="text-2xl font-semibold mt-8 mb-4">How We Process IPs</h2><p>When processing visitor data, IP addresses are only used temporarily to determine geographic location (country- and region). The actual IP addresses are never stored in our database, preserving visitor anonymity while- still providing geographic insights to website owners.+ and region) using{" "}+ <a href="https://ipapi.is/" className="text-emerald-400 hover:text-emerald-300" target="_blank">+ ipapi.is+ </a>+ . The actual IP addresses are never stored in our database, preserving visitor anonymity while still providing+ geographic insights to website owners.</p><h2 className="text-2xl font-semibold mt-8 mb-4">User and Session IDs</h2>diff --git a/docs/src/components/Footer.tsx b/docs/src/components/Footer.tsxindex 94b301647..e37b4528f 100644--- a/docs/src/components/Footer.tsx+++ b/docs/src/components/Footer.tsx@@ -161,6 +161,11 @@ export function Footer() {API Reference</Link></li>+ <li>+ <Link href="https://ipapi.is/" className="text-neutral-400 hover:text-white transition-colors">+ Geolocation by ipapi.is+ </Link>+ </li></ul></div>