diff --git a/src/app/dashboard/layout.tsx b/src/app/dashboard/layout.tsx
index 541e7459e..315c9e7f0 100644
--- a/src/app/dashboard/layout.tsx
+++ b/src/app/dashboard/layout.tsx
@@ -5,6 +5,7 @@ import { useEffect, useState } from "react";
import { useRouter } from "next/navigation";
import { toast } from "sonner";
import type { ReactNode } from "react";
+import { ScrollToTop } from "@/components/ScrollToTop";
async function hasActiveSession(fetcher: typeof window.fetch) {
try {
@@ -122,6 +123,7 @@ export default function DashboardLayout({ children }: { children: ReactNode }) {
<>
{showTokenBanner && }
{children}
+
>
);
-}
+}
\ No newline at end of file
diff --git a/src/components/ScrollToTop.tsx b/src/components/ScrollToTop.tsx
new file mode 100644
index 000000000..8d30fe41b
--- /dev/null
+++ b/src/components/ScrollToTop.tsx
@@ -0,0 +1,42 @@
+"use client";
+
+import { useState, useEffect } from "react";
+import { ArrowUp } from "lucide-react";
+import { cn } from "@/lib/utils";
+
+export function ScrollToTop() {
+ const [isVisible, setIsVisible] = useState(false);
+
+ useEffect(() => {
+ const toggleVisibility = () => {
+ setIsVisible(window.scrollY > 400);
+ };
+
+ window.addEventListener("scroll", toggleVisibility);
+ return () => window.removeEventListener("scroll", toggleVisibility);
+ }, []);
+
+ const scrollToTop = () => {
+ window.scrollTo({
+ top: 0,
+ behavior: "smooth",
+ });
+ };
+
+ return (
+
+ );
+}
\ No newline at end of file