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.

removed fallback video

Steven Tey71511698f6c7
diff --git a/components/home/globe.tsx b/components/home/globe.tsx
index ab8615b490..58bcde4c9f 100644
--- a/components/home/globe.tsx
+++ b/components/home/globe.tsx
@@ -28,7 +28,11 @@ export default function Globe({ domain }: { domain?: string }) {
}, [isVisible]);
const [webglSupported, setWebglSupported] = useState(false);
- const [showFallback, setShowFallback] = useState(false);
+
+ const { data: markers } = useSWR<MarkerProps[]>(
+ `/api/edge/coordinates${domain ? `?domain=${domain}` : ""}`,
+ fetcher,
+ );
useEffect(() => {
try {
@@ -42,34 +46,22 @@ export default function Globe({ domain }: { domain?: string }) {
console.log(
"WebGL not supported, hiding globe animation and showing fallback video...",
);
- setShowFallback(true);
return;
}
}, []);
- const { data: markers } = useSWR<MarkerProps[]>(
- `/api/edge/coordinates${domain ? `?domain=${domain}` : ""}`,
- fetcher,
- );
-
return (
- <div ref={divRef} className="h-full min-h-[500px] sm:min-h-[1000px]">
+ <div
+ ref={divRef}
+ className={`${
+ webglSupported && showGlobe
+ ? "min-h-[500px] sm:min-h-[1000px]"
+ : "min-h-[50px]"
+ } h-full`}
+ >
{webglSupported && showGlobe && (
<GlobeAnimation domain={domain} markers={markers} />
)}
- {showFallback && (
- <div className="flex h-full w-full items-center justify-center">
- <video
- autoPlay
- src="https://res.cloudinary.com/dubdotsh/video/upload/v1664203052/globe-animation-fallback.mp4"
- loop
- muted
- playsInline
- width={968}
- height={946}
- />
- </div>
- )}
</div>
);
}