From 7a136729f5563937fe0d6d37451ab7baae908888 Mon Sep 17 00:00:00 2001 From: Imhandegbelo Date: Wed, 7 Dec 2022 00:18:34 +0100 Subject: [PATCH] fixed the scroll to top issue --- frontend/public/manifest.json | 4 +- frontend/src/components/ScrollToTop.js | 9 ++ frontend/src/index.jsx | 2 + frontend/src/pages/AboutUs/index.jsx | 2 + .../src/pages/AccountBalanceReport/index.jsx | 8 +- frontend/src/pages/BlogPost/index.jsx | 2 + frontend/src/pages/Blogs/Index.jsx | 5 +- frontend/src/pages/Careers/index.jsx | 2 + frontend/src/pages/Contact/index.jsx | 2 + .../Dashboard/AccountReport/AccountReport.jsx | 2 + .../AccountReportDetail.jsx | 2 + .../Dashboard/DashboardMain/DashboardMain.jsx | 8 +- .../DashboardMain/UploadFile/Upload.jsx | 4 +- .../Dashboard/ImportData/Hero/ImportData.jsx | 2 + .../Dashboard/ImportData/Hero/Reconcile.jsx | 18 +++- frontend/src/pages/Documentation/index.jsx | 2 + frontend/src/pages/ErrorProcessing/index.jsx | 2 + frontend/src/pages/Faqs/index.jsx | 2 + frontend/src/pages/Gpt-3/index.jsx | 2 + frontend/src/pages/Help/index.jsx | 2 + frontend/src/pages/Privacy/index.jsx | 5 +- frontend/src/pages/Teams/index.jsx | 92 +++++++++++++------ .../src/pages/UpoadingSalesRecord/index.jsx | 2 + frontend/src/pages/UserUpload/index.jsx | 2 + 24 files changed, 142 insertions(+), 41 deletions(-) create mode 100644 frontend/src/components/ScrollToTop.js diff --git a/frontend/public/manifest.json b/frontend/public/manifest.json index 7c866422..a29ff72e 100644 --- a/frontend/public/manifest.json +++ b/frontend/public/manifest.json @@ -3,12 +3,12 @@ "name": "Create React App Sample", "icons": [ { - "src": "favicon.ico", + "src": "logo.png", "sizes": "64x64 32x32 24x24 16x16", "type": "image/x-icon" }, { - "src": "logo192.png", + "src": "logo.png", "type": "image/png", "sizes": "192x192" }, diff --git a/frontend/src/components/ScrollToTop.js b/frontend/src/components/ScrollToTop.js new file mode 100644 index 00000000..95a53a53 --- /dev/null +++ b/frontend/src/components/ScrollToTop.js @@ -0,0 +1,9 @@ +import { useEffect } from "react"; + +export default function ScrollToTop() { + useEffect(() => { + window.scrollTo(0, 0); + }, []); + + return null; +} diff --git a/frontend/src/index.jsx b/frontend/src/index.jsx index c11dd04b..fe9471be 100644 --- a/frontend/src/index.jsx +++ b/frontend/src/index.jsx @@ -34,6 +34,7 @@ import { UserProvider } from './Store/Context'; import AccountReport from './pages/Dashboard/AccountReport/AccountReport'; import DashboardMain from './pages/Dashboard/DashboardMain/DashboardMain'; import Privacy from './pages/Privacy'; +// import ScrollToTop from './components/ScrollToTop'; // import ImportData from './pages/Dashboard/ImportData/Hero/ImportData'; // import { // Upload, @@ -192,6 +193,7 @@ const root = ReactDOM.createRoot(document.getElementById('root')); root.render( + {/* */} diff --git a/frontend/src/pages/AboutUs/index.jsx b/frontend/src/pages/AboutUs/index.jsx index 0c2b444e..6e438867 100644 --- a/frontend/src/pages/AboutUs/index.jsx +++ b/frontend/src/pages/AboutUs/index.jsx @@ -7,9 +7,11 @@ import blueSquaremob from '../../assets/images/about-us/bluesquaremob.png'; import mission from '../../assets/images/about-us/mission.png'; import valueImg from '../../assets/images/about-us/values.png'; import NavigationBar from '../../components/NavigationBar'; +import ScrollToTop from '../../components/ScrollToTop'; const AboutUs = () => (
+
diff --git a/frontend/src/pages/AccountBalanceReport/index.jsx b/frontend/src/pages/AccountBalanceReport/index.jsx index 1ad4bcd6..c96f35e9 100644 --- a/frontend/src/pages/AccountBalanceReport/index.jsx +++ b/frontend/src/pages/AccountBalanceReport/index.jsx @@ -1,5 +1,11 @@ import React from 'react'; +import ScrollToTop from '../../components/ScrollToTop'; -const AccountBalanceReport = () =>
AccountBalanceReport
; +const AccountBalanceReport = () => ( +
+ + AccountBalanceReport +
+); export default AccountBalanceReport; diff --git a/frontend/src/pages/BlogPost/index.jsx b/frontend/src/pages/BlogPost/index.jsx index 45171357..25e5e240 100644 --- a/frontend/src/pages/BlogPost/index.jsx +++ b/frontend/src/pages/BlogPost/index.jsx @@ -4,10 +4,12 @@ import BlogPreview from '../../components/BlogPreview'; import { otherPost } from '../Blogs/fakedata/index'; import NavigationBar from '../../components/NavigationBar'; import Footer from '../../components/Footer'; +import ScrollToTop from '../../components/ScrollToTop'; function BlogPost() { return ( <> +
diff --git a/frontend/src/pages/Blogs/Index.jsx b/frontend/src/pages/Blogs/Index.jsx index c3d6c1ff..56ca5473 100644 --- a/frontend/src/pages/Blogs/Index.jsx +++ b/frontend/src/pages/Blogs/Index.jsx @@ -5,10 +5,12 @@ import { blogList } from './fakedata/index'; import NavigationBar from '../../components/NavigationBar'; import Footer from '../../components/Footer'; import SearchBar from '../../components/Blogs/searchBar'; +import ScrollToTop from '../../components/ScrollToTop'; function Blogs() { return ( <> +

@@ -18,9 +20,8 @@ function Blogs() { Get access to the latest industry news, interviews, technologies, and resources.

- - +

diff --git a/frontend/src/pages/Careers/index.jsx b/frontend/src/pages/Careers/index.jsx index 027e1bc3..d0396df0 100644 --- a/frontend/src/pages/Careers/index.jsx +++ b/frontend/src/pages/Careers/index.jsx @@ -13,6 +13,7 @@ import briefCase from '../../assets/images/careers-page/Suitcase 1.png'; import location from '../../assets/images/careers-page/location.png'; import NavigationBar from '../../components/NavigationBar'; import Footer from '../../components/Footer'; +import ScrollToTop from '../../components/ScrollToTop'; const Careers = () => { const teams = [ @@ -111,6 +112,7 @@ const Careers = () => { return ( <> +
diff --git a/frontend/src/pages/Contact/index.jsx b/frontend/src/pages/Contact/index.jsx index bae2882d..808391d0 100644 --- a/frontend/src/pages/Contact/index.jsx +++ b/frontend/src/pages/Contact/index.jsx @@ -3,9 +3,11 @@ import { Form } from '../../components/ContactForm/Form'; import ContactUsImage from '../../assets/images/contact-page-images/contact-page-image.png'; import NavigationBar from '../../components/NavigationBar/index'; import Footer from '../../components/Footer/index'; +import ScrollToTop from '../../components/ScrollToTop'; const ContactUs = () => ( <> +
diff --git a/frontend/src/pages/Dashboard/AccountReport/AccountReport.jsx b/frontend/src/pages/Dashboard/AccountReport/AccountReport.jsx index 413dce62..dbbc9bbc 100644 --- a/frontend/src/pages/Dashboard/AccountReport/AccountReport.jsx +++ b/frontend/src/pages/Dashboard/AccountReport/AccountReport.jsx @@ -2,6 +2,7 @@ import React from 'react'; import { useNavigate } from 'react-router-dom'; import { useAuth } from '../../../Store/Context'; import './accountReport.css'; +import ScrollToTop from '../../../components/ScrollToTop'; // import AccountReportDetail from './AccountReportDetail/AccountReportDetail'; // import SalesReport from './AccountReportDetail/SalesReport'; @@ -28,6 +29,7 @@ function AccountReport() { return (
+

Account Balance Report Ready!

{/* report table */} {/*
*/} diff --git a/frontend/src/pages/Dashboard/AccountReport/AccountReportDetail/AccountReportDetail.jsx b/frontend/src/pages/Dashboard/AccountReport/AccountReportDetail/AccountReportDetail.jsx index ed2a1feb..e2bd5eb1 100644 --- a/frontend/src/pages/Dashboard/AccountReport/AccountReportDetail/AccountReportDetail.jsx +++ b/frontend/src/pages/Dashboard/AccountReport/AccountReportDetail/AccountReportDetail.jsx @@ -1,8 +1,10 @@ import React from 'react'; +import ScrollToTop from '../../../../components/ScrollToTop'; function AccountReportDetail() { return (
+

Segun Shegs

diff --git a/frontend/src/pages/Dashboard/DashboardMain/DashboardMain.jsx b/frontend/src/pages/Dashboard/DashboardMain/DashboardMain.jsx index b56d43e7..0d092352 100644 --- a/frontend/src/pages/Dashboard/DashboardMain/DashboardMain.jsx +++ b/frontend/src/pages/Dashboard/DashboardMain/DashboardMain.jsx @@ -2,11 +2,17 @@ import React from 'react'; import { useAuth } from '../../../Store/Context'; import Upload from './UploadFile/Upload'; import UploadReady from './UploadReady/UploadReady'; +import ScrollToTop from '../../../components/ScrollToTop'; function DashboardMain() { const { localFile } = useAuth(); - return
{localFile.length < 1 ? : }
; + return ( +
+ + {localFile.length < 1 ? : } +
+ ); } export default DashboardMain; diff --git a/frontend/src/pages/Dashboard/DashboardMain/UploadFile/Upload.jsx b/frontend/src/pages/Dashboard/DashboardMain/UploadFile/Upload.jsx index aa62c735..03f8527a 100644 --- a/frontend/src/pages/Dashboard/DashboardMain/UploadFile/Upload.jsx +++ b/frontend/src/pages/Dashboard/DashboardMain/UploadFile/Upload.jsx @@ -1,7 +1,8 @@ -import { useRef } from 'react'; +import { useRef, useState } from 'react'; import document from '../../../../assets/images/DashboardImages/upload/document.png'; import './upload.css'; import { useAuth } from '../../../../Store/Context'; +import ScrollToTop from '../../../../components/ScrollToTop'; function Upload() { const { dragHandler, dropHandler, setLocalFile, setFileDropped } = useAuth(); @@ -12,6 +13,7 @@ function Upload() { return (
+

Upload Account Statement

diff --git a/frontend/src/pages/Dashboard/ImportData/Hero/ImportData.jsx b/frontend/src/pages/Dashboard/ImportData/Hero/ImportData.jsx index aac6e3f5..d10b6ad6 100644 --- a/frontend/src/pages/Dashboard/ImportData/Hero/ImportData.jsx +++ b/frontend/src/pages/Dashboard/ImportData/Hero/ImportData.jsx @@ -10,6 +10,7 @@ import Transactions from '../Transactions/Transactions'; import CurrentNav from '../../../../components/DashBoardCurrentNav/DashCurrentNav'; import { useAuth } from '../../../../Store/Context'; import ok from '../../../../assets/Ok.png'; +import ScrollToTop from '../../../../components/ScrollToTop'; function ImportData() { const [showDisplay, setShowDisplay] = useState(false); @@ -88,6 +89,7 @@ function ImportData() { return (
+
diff --git a/frontend/src/pages/Dashboard/ImportData/Hero/Reconcile.jsx b/frontend/src/pages/Dashboard/ImportData/Hero/Reconcile.jsx index e1f67069..9b82dff9 100644 --- a/frontend/src/pages/Dashboard/ImportData/Hero/Reconcile.jsx +++ b/frontend/src/pages/Dashboard/ImportData/Hero/Reconcile.jsx @@ -17,6 +17,7 @@ function Reconcile() { const [showSort, setShowSortDisplay] = useState(false); const [showDisplay2, setShowDisplay2] = useState(false); const [showSort2, setShowSortDisplay2] = useState(false); + const [message, errorMessage] = useState(false); const navigate = useNavigate(); const { localData, @@ -65,6 +66,13 @@ function Reconcile() { const handleSubmit = async () => { reconcileData(); + + errorMessage(true); + + setTimeout(() => { + errorMessage(false); + }, 5000); + // navigate('/dashboard/accountreport'); }; @@ -300,7 +308,7 @@ function Reconcile() {
{/* sync to data baseButton */} -
+
+
+ {message && ( + + One or more files missing: Please upload the file to reconcile + + )}
); diff --git a/frontend/src/pages/Documentation/index.jsx b/frontend/src/pages/Documentation/index.jsx index e13372f8..1ff71149 100644 --- a/frontend/src/pages/Documentation/index.jsx +++ b/frontend/src/pages/Documentation/index.jsx @@ -7,9 +7,11 @@ import stepthreeMobile from '../../assets/images/documentation/stepthreeMobile.p import stepTwo from '../../assets/images/documentation/steptwo.png'; import stepThree from '../../assets/images/documentation/stepthree.png'; import Footer from '../../components/Footer'; +import ScrollToTop from '../../components/ScrollToTop' const Documentation = () => (
+
diff --git a/frontend/src/pages/ErrorProcessing/index.jsx b/frontend/src/pages/ErrorProcessing/index.jsx index c92a72ad..f8bdbb3e 100644 --- a/frontend/src/pages/ErrorProcessing/index.jsx +++ b/frontend/src/pages/ErrorProcessing/index.jsx @@ -2,6 +2,7 @@ import React from 'react'; import { FaGreaterThan } from 'react-icons/fa'; import DashBoardSideBar from '../../components/DashBoardSideBar'; import DashBoardHeader from '../../components/DashBoardHeader'; +import ScrollToTop from '../../components/ScrollToTop'; const styles = { bgColor: '#1570EF', @@ -19,6 +20,7 @@ const processData = { const ErrorProcessing = () => ( <> +
diff --git a/frontend/src/pages/Faqs/index.jsx b/frontend/src/pages/Faqs/index.jsx index 00aac145..768065a7 100644 --- a/frontend/src/pages/Faqs/index.jsx +++ b/frontend/src/pages/Faqs/index.jsx @@ -3,6 +3,7 @@ import faqArray from '../../components/Faqs/faqArray'; import Accordion from '../../components/Faqs/index'; import Footer from '../../components/Footer'; import NavigationBar from '../../components/NavigationBar'; +import ScrollToTop from '../../components/ScrollToTop'; const Faq = () => { const [currentPosts, setCurrentPosts] = useState(faqArray.slice(0, 9)); @@ -11,6 +12,7 @@ const Faq = () => { return (
+
diff --git a/frontend/src/pages/Gpt-3/index.jsx b/frontend/src/pages/Gpt-3/index.jsx index a70a35c0..a1442c5a 100644 --- a/frontend/src/pages/Gpt-3/index.jsx +++ b/frontend/src/pages/Gpt-3/index.jsx @@ -4,10 +4,12 @@ import Footer from '../../components/Footer'; import NavigationBar from '../../components/NavigationBar'; import Banner from '../../assets/images/gpt3/banner.png'; import LapTop from '../../assets/images/gpt3/laptop.png'; +import ScrollToTop from '../../components/ScrollToTop'; function Gpt3() { return (
+ banner
diff --git a/frontend/src/pages/Help/index.jsx b/frontend/src/pages/Help/index.jsx index 1c8ab1b5..e270b420 100644 --- a/frontend/src/pages/Help/index.jsx +++ b/frontend/src/pages/Help/index.jsx @@ -2,10 +2,12 @@ import React from 'react'; import NavigationBar from '../../components/NavigationBar'; import Footer from '../../components/Footer'; import heroImage from '../../assets/images/HelpCenter/hero.png'; +import ScrollToTop from '../../components/ScrollToTop' function Help() { return (
+
{/* Hero Section */} diff --git a/frontend/src/pages/Privacy/index.jsx b/frontend/src/pages/Privacy/index.jsx index 834b463c..b83b7d38 100644 --- a/frontend/src/pages/Privacy/index.jsx +++ b/frontend/src/pages/Privacy/index.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import padlock from '../../assets/images/Privacy/padlock.svg'; import Key from '../../assets/images/Privacy/Key.svg'; import Camera from '../../assets/images/Privacy/camera.svg'; @@ -9,9 +8,11 @@ import photo2 from '../../assets/images/Privacy/photo2.png'; import photo3 from '../../assets/images/Privacy/photo3.png'; import Footer from '../../components/Footer'; import Navbar from '../../components/NavigationBar'; +import ScrollToTop from '../../components/ScrollToTop'; const Privacy = () => (
+
@@ -77,7 +78,7 @@ const Privacy = () => ( src={padlock} alt="padlock" /> -

+

Security

diff --git a/frontend/src/pages/Teams/index.jsx b/frontend/src/pages/Teams/index.jsx index 267d150f..c9688d53 100644 --- a/frontend/src/pages/Teams/index.jsx +++ b/frontend/src/pages/Teams/index.jsx @@ -13,10 +13,12 @@ import nine from '../../assets/images/teams/9.png'; import fb from '../../assets/images/teams/fb.png'; import ln from '../../assets/images/teams/ln.png'; import tw from '../../assets/images/teams/tw.png'; +import ScrollToTop from '../../components/ScrollToTop'; function Teams() { return (
+
@@ -50,27 +52,31 @@ function Teams() {
-

Oluwasegun Akinshola

+

+ Oluwasegun Akinshola +

cheif Drill-Master

- - + +
-

Dorothy Nkatha

+

+ Dorothy Nkatha +

Assist Drill-Master

- - + +
@@ -78,93 +84,119 @@ function Teams() {
-

Maureen Ehiosun

+

+ Maureen Ehiosun +

Design PM Lead

- - + +
-

Olatunji David

+

+ Olatunji David +

Frontend PM Lead

- - + +
-

AbdulMuizz Ikumapayi

+

+ AbdulMuizz Ikumapayi +

Backend Track Lead

- - + +
-

Amogbe Idowu Esther

+

+ Amogbe Idowu Esther +

Sales & Marketing PM Lead

- - + +
- -

Emmanuel Job

+ +

+ Emmanuel Job +

Design Track Lead

- - + +
- -

Queenette oluchi

+ +

+ Queenette oluchi +

Sales & Marketing Track Lead

- - + +
- -

hakeem Abdurahmon

+ +

+ hakeem Abdurahmon +

Frontend Track Lead

- - + +
diff --git a/frontend/src/pages/UpoadingSalesRecord/index.jsx b/frontend/src/pages/UpoadingSalesRecord/index.jsx index b8ba3084..3ca9321a 100644 --- a/frontend/src/pages/UpoadingSalesRecord/index.jsx +++ b/frontend/src/pages/UpoadingSalesRecord/index.jsx @@ -3,12 +3,14 @@ import React, { useState } from 'react'; import { FaSearch } from 'react-icons/fa'; import data from './mockdata.json'; +import ScrollToTop from '../../components/ScrollToTop'; const UpoadingSalesRecord = () => { const [contacts, setContacts] = useState(data); return (
+

diff --git a/frontend/src/pages/UserUpload/index.jsx b/frontend/src/pages/UserUpload/index.jsx index 2cc6abb4..11045843 100644 --- a/frontend/src/pages/UserUpload/index.jsx +++ b/frontend/src/pages/UserUpload/index.jsx @@ -7,6 +7,7 @@ import { FaGreaterThan } from 'react-icons/fa'; import { CgProfile } from 'react-icons/cg'; import DashBoardSideBar from '../../components/DashBoardSideBar'; import DashBoardHeader from '../../components/DashBoardHeader'; +import ScrollToTop from '../../components/ScrollToTop'; const styles = { bgColor: '#1570EF', @@ -26,6 +27,7 @@ const processData = { const Userupload = () => ( <> +