From 8961cf362554e333b7b2079937cd8ddd82a6b6b5 Mon Sep 17 00:00:00 2001 From: Bartosz Gotowski Date: Fri, 10 Feb 2023 15:04:42 +0100 Subject: [PATCH] feat: add scroll to top button --- src/components/Layout.tsx | 25 +++++++++++++------ src/components/ScrollToTop.tsx | 45 ++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 7 deletions(-) create mode 100644 src/components/ScrollToTop.tsx diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index 1f08cf48..54d6fde1 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -4,6 +4,8 @@ import React from "react"; import { Lato } from "@next/font/google"; import { Footer } from "./Footer"; import { Navbar } from "./Navbar"; +import { motion } from "framer-motion"; +import { ScrollToTop } from "./ScrollToTop"; const lato = Lato({ subsets: ["latin"], @@ -14,12 +16,21 @@ const lato = Lato({ export const Layout = ({ children }: { children: ReactNode }) => { return ( - -
- - {children} -
-