Skip to content

Commit

Permalink
feat: update
Browse files Browse the repository at this point in the history
  • Loading branch information
ezralazuardy committed Dec 1, 2024
1 parent 79932cc commit 7b9b016
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default function Home() {
!fs ||
!fc ||
typeof window === "undefined" ||
document === "undefined"
typeof document === "undefined"
)
return;

Expand Down
11 changes: 8 additions & 3 deletions components/ui/contact/content.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
"use client";

import Image from "next/image";
import Link from "next/link";
import Map from "@/components/ui/map";
import BlurFade from "@/components/ui/blur-fade";
import logo from "@/public/images/logo.webp";
import dynamic from "next/dynamic";

export const DynamicMap = dynamic(() => import("@/components/ui/map"), {
ssr: false,
});

export default function Content() {
return (
Expand All @@ -26,7 +31,7 @@ export default function Content() {
</div>
<div className="flex flex-col w-full mt-6">
<BlurFade delay={0.8} inView>
<Map />
<DynamicMap />
</BlurFade>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion components/ui/gallery/tiles.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export default function Tiles() {
const loading = useRef(null);

useEffect(() => {
if (typeof window === "undefined" || document === "undefined") return;
if (typeof window === "undefined" || typeof document === "undefined")
return;

const showCanvasTimer = setTimeout(() => {
setShowCanvas(true);
Expand Down
3 changes: 2 additions & 1 deletion components/ui/map.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export default function Map() {
useEffect(() => {
const m = mapElement?.current;

if (!m) return;
if (!m || typeof window === "undefined" || typeof document === "undefined")
return;

const map = L.map(m, { attributionControl: false }).setView(
coordinate,
Expand Down

0 comments on commit 7b9b016

Please sign in to comment.