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 initial height animation

Tim Wilsonb319511f17fb
diff --git a/apps/web/ui/layout/sidebar/refer-button.tsx b/apps/web/ui/layout/sidebar/refer-button.tsx
index 57a8f34a8d..455930ac51 100644
--- a/apps/web/ui/layout/sidebar/refer-button.tsx
+++ b/apps/web/ui/layout/sidebar/refer-button.tsx
@@ -2,7 +2,6 @@
import useWorkspace from "@/lib/swr/use-workspace";
import { DubWidget } from "@dub/embed-react";
-import { useMediaQuery } from "@dub/ui";
import { Gift } from "@dub/ui/src/icons";
import { cn } from "@dub/utils";
import { AnimatePresence, motion } from "framer-motion";
@@ -11,7 +10,6 @@ import { toast } from "sonner";
export function ReferButton() {
const { id: workspaceId, flags, referralLinkId } = useWorkspace();
- const { isMobile } = useMediaQuery();
const [publicToken, setPublicToken] = useState<string | null>(null);
diff --git a/packages/embeds/core/src/core.ts b/packages/embeds/core/src/core.ts
index f96b60a922..19803fd848 100644
--- a/packages/embeds/core/src/core.ts
+++ b/packages/embeds/core/src/core.ts
@@ -106,7 +106,7 @@ class DubWidget {
Object.assign(container.style, {
...CONTAINER_STYLES,
...containerStyles,
- display: "none",
+ visibility: "hidden",
});
container.addEventListener("click", (e) => {
@@ -168,7 +168,7 @@ class DubWidget {
const container = document.getElementById(
`${this.prefix}${DUB_CONTAINER_ID}`,
);
- return container?.style.display !== "none";
+ return container?.style.visibility !== "hidden";
}
/**
@@ -185,7 +185,7 @@ class DubWidget {
}
if (container) {
- container.style.display = "flex";
+ container.style.visibility = "visible";
container.animate(
[
{
@@ -250,7 +250,7 @@ class DubWidget {
fill: "forwards",
},
).onfinish = () => {
- container.style.display = "none";
+ container.style.visibility = "hidden";
};
}
}