Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Fix `ToggleGroup` z-index

Tim Wilson40969b16d512
diff --git a/apps/web/ui/analytics/main.tsx b/apps/web/ui/analytics/main.tsx
index 33d4ac4d7d..46ea78f397 100644
--- a/apps/web/ui/analytics/main.tsx
+++ b/apps/web/ui/analytics/main.tsx
@@ -86,29 +86,6 @@ export default function Main() {
/>
</div>
)}
- {id === "sales" && (
- <ToggleGroup
- className="absolute right-3 top-3 hidden w-fit shrink-0 items-center gap-1 border-neutral-100 bg-neutral-100 sm:flex"
- optionClassName="size-8 p-0 flex items-center justify-center"
- indicatorClassName="border border-neutral-200 bg-white"
- options={[
- {
- label: <div className="text-base">$</div>,
- value: "saleAmount",
- },
- {
- label: <div className="text-[11px]">123</div>,
- value: "sales",
- },
- ]}
- selected={saleUnit}
- selectAction={(option: AnalyticsSaleUnit) => {
- queryParams({
- set: { saleUnit: option },
- });
- }}
- />
- )}
<Link
className={cn(
"border-box relative block h-full min-w-[110px] flex-none px-4 py-3 sm:min-w-[240px] sm:px-8 sm:py-6",
@@ -179,6 +156,29 @@ export default function Main() {
)}
</div>
</Link>
+ {id === "sales" && (
+ <ToggleGroup
+ className="absolute right-3 top-3 hidden w-fit shrink-0 items-center gap-1 border-neutral-100 bg-neutral-100 sm:flex"
+ optionClassName="size-8 p-0 flex items-center justify-center"
+ indicatorClassName="border border-neutral-200 bg-white"
+ options={[
+ {
+ label: <div className="text-base">$</div>,
+ value: "saleAmount",
+ },
+ {
+ label: <div className="text-[11px]">123</div>,
+ value: "sales",
+ },
+ ]}
+ selected={saleUnit}
+ selectAction={(option: AnalyticsSaleUnit) => {
+ queryParams({
+ set: { saleUnit: option },
+ });
+ }}
+ />
+ )}
</div>
);
})}
diff --git a/packages/ui/src/toggle-group.tsx b/packages/ui/src/toggle-group.tsx
index cb08a3a2c5..1bb6c0b155 100644
--- a/packages/ui/src/toggle-group.tsx
+++ b/packages/ui/src/toggle-group.tsx
@@ -34,7 +34,7 @@ export function ToggleGroup({
<motion.div
layout
className={cn(
- "border-border-subtle bg-bg-default relative inline-flex items-center gap-1 rounded-xl border p-1",
+ "border-border-subtle bg-bg-default relative z-0 inline-flex items-center gap-1 rounded-xl border p-1",
className,
)}
style={style}