From 9b7033eb51e42fd40bec3570ff19f5eba2ce5133 Mon Sep 17 00:00:00 2001 From: Gyanendra Singh Date: Mon, 20 May 2024 07:20:21 +0000 Subject: [PATCH] faet: Add scroll to Top button --- client/src/pages/Companies.jsx | 3 +++ client/src/pages/FindJobs.jsx | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/client/src/pages/Companies.jsx b/client/src/pages/Companies.jsx index 9a939f1..d235d85 100644 --- a/client/src/pages/Companies.jsx +++ b/client/src/pages/Companies.jsx @@ -2,6 +2,7 @@ import React, { useEffect, useState } from "react"; import { useLocation, useNavigate } from "react-router-dom"; import { CompanyCard, CustomButton, Header, ListBox } from "../components"; import { companies } from "../utils/data"; +import { BiArrowToTop } from "react-icons/bi"; const Companies = () => { const [page, setPage] = useState(1); @@ -70,6 +71,8 @@ const Companies = () => { )} + {/* Top Scroll Btn */} + {window.scrollTo({ top: 0, left: 0, behavior: "smooth"});}}/> ); }; diff --git a/client/src/pages/FindJobs.jsx b/client/src/pages/FindJobs.jsx index b3fd128..1c15bb1 100644 --- a/client/src/pages/FindJobs.jsx +++ b/client/src/pages/FindJobs.jsx @@ -1,6 +1,6 @@ import { useState } from "react"; import { useLocation, useNavigate } from "react-router-dom"; -import { BiBriefcaseAlt2 } from "react-icons/bi"; +import { BiArrowToTop, BiBriefcaseAlt2 } from "react-icons/bi"; import { BsStars } from "react-icons/bs"; import { MdOutlineKeyboardArrowDown } from "react-icons/md"; @@ -138,6 +138,8 @@ const FindJobs = () => { )} + {/* Top Scroll Btn */} + {window.scrollTo({ top: 0, left: 0, behavior: "smooth"});}}/> ); };