diff --git a/postcss.config.mjs b/postcss.config.mjs index 9335eb0..5d1ce64 100644 --- a/postcss.config.mjs +++ b/postcss.config.mjs @@ -1,7 +1,3 @@ -import { createRequire } from "module" - -const require = createRequire(import.meta.url) - const config = { plugins: { "@tailwindcss/postcss": {}, diff --git a/src/app/(dashboard-layout)/layout.tsx b/src/app/(dashboard-layout)/layout.tsx index 6efb479..d6a8fa0 100644 --- a/src/app/(dashboard-layout)/layout.tsx +++ b/src/app/(dashboard-layout)/layout.tsx @@ -38,7 +38,10 @@ export default function DashboardLayout({ children }: { children: ReactNode }) {
- +
{/* */} diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 5fc2668..aff47d7 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -9,6 +9,7 @@ import { Toaster } from "sonner" // project import branding from "@/branding.json" +import { BackToTop } from "@/components/back-to-top" import { ThemePresetStyles } from "@/components/customizer/ThemePresetStyles" import { ThemeProvider } from "@/components/theme-provider" import Metrics from "@/metrics" @@ -96,6 +97,7 @@ export default function RootLayout({ + ) diff --git a/src/components/animation/HoverBg.tsx b/src/components/animation/HoverBg.tsx index fc09264..13d6ec0 100644 --- a/src/components/animation/HoverBg.tsx +++ b/src/components/animation/HoverBg.tsx @@ -110,15 +110,15 @@ export default function HoverBg({ className = "" }: HoverBgProps) { > {/* The SVG grid pattern repeated across the screen and revealed by the mask */} diff --git a/src/components/back-to-top.tsx b/src/components/back-to-top.tsx new file mode 100644 index 0000000..1194471 --- /dev/null +++ b/src/components/back-to-top.tsx @@ -0,0 +1,75 @@ +"use client" + +import { useCallback, useEffect, useRef, useState } from "react" + +// shadcn +import { Button } from "@/components/ui/button" + +// project imports +import { cn } from "@/lib/utils" + +// assets +import { ArrowUp } from "lucide-react" + +const SCROLL_THRESHOLD = 300 + +// ------------------------------ | BACK TO TOP | ------------------------------ // + +export function BackToTop() { + const [isVisible, setIsVisible] = useState(false) + const tickingRef = useRef(false) + + useEffect(() => { + function handleScroll(event: Event) { + if (tickingRef.current) return + tickingRef.current = true + + requestAnimationFrame(() => { + const target = event.target + const scrollTop = + target instanceof HTMLElement && target.id === "main-scroll-area" + ? target.scrollTop + : window.scrollY + + setIsVisible((prev) => { + const next = scrollTop > SCROLL_THRESHOLD + return prev === next ? prev : next + }) + + tickingRef.current = false + }) + } + + window.addEventListener("scroll", handleScroll, { + capture: true, + passive: true, + }) + + return () => { + window.removeEventListener("scroll", handleScroll, { capture: true }) + } + }, []) + + const scrollToTop = useCallback(() => { + document + .getElementById("main-scroll-area") + ?.scrollTo({ top: 0, behavior: "smooth" }) ?? + window.scrollTo({ top: 0, behavior: "smooth" }) + }, []) + + return ( + Scroll to top + + ) +} diff --git a/src/components/category-description.tsx b/src/components/category-description.tsx index cd70768..52f0df2 100644 --- a/src/components/category-description.tsx +++ b/src/components/category-description.tsx @@ -57,19 +57,21 @@ export default function CategoryDescription({ ))}
-
-

{data.variantsHeading ?? ""}

- -
+ {data.variants && data.variants.length > 0 && ( +
+

{data.variantsHeading ?? ""}

+ +
+ )}

{data.whyUseHeading}

@@ -103,12 +105,14 @@ export default function CategoryDescription({ /> ))}
- -

{data.integrationNote ?? ""}

+ {data.integrationList && data.integrationList.length > 0 && ( + + )} + {data.integrationNote &&

{data.integrationNote}

}
{data.faqs && data.faqs.length > 0 && (
diff --git a/src/components/uiable/blocks/landing/hero/hero.tsx b/src/components/uiable/blocks/landing/hero/hero.tsx index e496952..c45d6b9 100644 --- a/src/components/uiable/blocks/landing/hero/hero.tsx +++ b/src/components/uiable/blocks/landing/hero/hero.tsx @@ -50,7 +50,7 @@ export default function Hero() { }} /> - +
- - - - - - - - - - - ) }