Skip to content

Commit

Permalink
Merge pull request #342 from VaishnaviMankala19/back-to-top
Browse files Browse the repository at this point in the history
Scroll To up Button added
  • Loading branch information
Avdhesh-Varshney authored Jun 18, 2024
2 parents a1b7c2e + 9be5db8 commit 0d928de
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
11 changes: 10 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"react-dom": "^18.2.0",
"react-icons": "^5.0.1",
"react-router-dom": "^6.21.3",
"react-scroll-to-top": "^3.0.0",
"react-top-loading-bar": "^2.3.1"
},
"devDependencies": {
Expand All @@ -28,4 +29,4 @@
"eslint-plugin-react-refresh": "^0.4.5",
"vite": "^5.0.8"
}
}
}
10 changes: 10 additions & 0 deletions src/components/BackToTop.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import ScrollToTop from "react-scroll-to-top";

function BackToTop() {
return (
<div>
<ScrollToTop smooth />
</div>
);
}
export default BackToTop;
2 changes: 2 additions & 0 deletions src/components/Pages/MainPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useEffect, useState } from "react";
import ProjectCards from "../Cards/ProjectCards";
import "./mainpage.css";
import Dashboard from "./Dashboard";
import BackToTop from '../BackToTop';

const MainPage = (props) => {
const { category, routes, setProgress } = props;
Expand Down Expand Up @@ -94,6 +95,7 @@ const MainPage = (props) => {
</select>
</div>
<ProjectCards projectsData={filteredData} tech={getTech(category)} />
<BackToTop/>
</div>
);
};
Expand Down

0 comments on commit 0d928de

Please sign in to comment.