Skip to content

Commit

Permalink
faet: Add scroll to Top button
Browse files Browse the repository at this point in the history
  • Loading branch information
gyanendra-baghel committed May 20, 2024
1 parent 753abd4 commit 9b7033e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions client/src/pages/Companies.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -70,6 +71,8 @@ const Companies = () => {
</div>
)}
</div>
{/* Top Scroll Btn */}
<BiArrowToTop className="fixed bottom-4 right-4 border rounded-full p-1" size={50} onClick={()=>{window.scrollTo({ top: 0, left: 0, behavior: "smooth"});}}/>
</div>
);
};
Expand Down
4 changes: 3 additions & 1 deletion client/src/pages/FindJobs.jsx
Original file line number Diff line number Diff line change
@@ -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";

Expand Down Expand Up @@ -138,6 +138,8 @@ const FindJobs = () => {
)}
</div>
</div>
{/* Top Scroll Btn */}
<BiArrowToTop className="fixed bottom-4 right-4 border rounded-full p-1" size={50} onClick={()=>{window.scrollTo({ top: 0, left: 0, behavior: "smooth"});}}/>
</div>
);
};
Expand Down

0 comments on commit 9b7033e

Please sign in to comment.