From 77da5694bb90ddf0b8b0be875139da6deed938f0 Mon Sep 17 00:00:00 2001 From: Tom Heaton Date: Thu, 6 Jun 2024 00:38:13 +0100 Subject: [PATCH] use default exports --- src/App.jsx | 4 +--- src/components/Footer/index.jsx | 6 ++---- src/components/HeroSection/index.jsx | 6 ++---- src/components/Instructors/index.jsx | 6 ++---- src/components/Media/index.jsx | 6 ++---- src/components/More/index.jsx | 6 ++---- src/components/NavBar/index.jsx | 6 ++---- src/components/Notebooks/index.jsx | 4 +--- src/components/ScrollToTop.jsx | 2 +- src/components/Sidebar/index.jsx | 6 ++---- src/pages/index.jsx | 6 ++---- src/pages/signin.jsx | 6 ++---- 12 files changed, 21 insertions(+), 43 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 802208e..49f3a53 100755 --- a/src/App.jsx +++ b/src/App.jsx @@ -2,7 +2,7 @@ import { BrowserRouter as Router, Route, Routes } from "react-router-dom"; import Home from "./pages"; import "./styles/App.css"; -function App() { +export default function App() { return ( @@ -11,5 +11,3 @@ function App() { ); } - -export default App; diff --git a/src/components/Footer/index.jsx b/src/components/Footer/index.jsx index e203240..71ffcf4 100755 --- a/src/components/Footer/index.jsx +++ b/src/components/Footer/index.jsx @@ -13,7 +13,7 @@ import { WebsiteRights, } from "./FooterElements"; -const Footer = () => { +export default function Footer() { const toggleHome = () => { scroll.scrollToTop(); }; @@ -70,6 +70,4 @@ const Footer = () => { ); -}; - -export default Footer; +} diff --git a/src/components/HeroSection/index.jsx b/src/components/HeroSection/index.jsx index 5d8a7f9..5e3ac7d 100755 --- a/src/components/HeroSection/index.jsx +++ b/src/components/HeroSection/index.jsx @@ -21,7 +21,7 @@ import { UDLLink, } from "./HeroElements"; -const HeroSection = () => { +export default function HeroSection() { const citation = ` @book{prince2023understanding, author = "Simon J.D. Prince", @@ -162,6 +162,4 @@ const HeroSection = () => { ); -}; - -export default HeroSection; +} diff --git a/src/components/Instructors/index.jsx b/src/components/Instructors/index.jsx index fd11682..94b2388 100644 --- a/src/components/Instructors/index.jsx +++ b/src/components/Instructors/index.jsx @@ -16,7 +16,7 @@ import { TopLine, } from "./InstructorsElements"; -const InstructorsSection = () => { +export default function InstructorsSection() { return ( <> @@ -497,6 +497,4 @@ const InstructorsSection = () => { ); -}; - -export default InstructorsSection; +} diff --git a/src/components/Media/index.jsx b/src/components/Media/index.jsx index 8e5eb08..8bc1852 100644 --- a/src/components/Media/index.jsx +++ b/src/components/Media/index.jsx @@ -17,7 +17,7 @@ import { VideoFrame, } from "./MediaElements"; -const MediaSection = () => { +export default function MediaSection() { return ( <> @@ -123,6 +123,4 @@ const MediaSection = () => { ); -}; - -export default MediaSection; +} diff --git a/src/components/More/index.jsx b/src/components/More/index.jsx index a38a2ea..ea18cf9 100644 --- a/src/components/More/index.jsx +++ b/src/components/More/index.jsx @@ -18,7 +18,7 @@ import { TopLine, } from "./MoreElements"; -const MoreSection = () => { +export default function MoreSection() { return ( <> @@ -1054,6 +1054,4 @@ const MoreSection = () => { ); -}; - -export default MoreSection; +} diff --git a/src/components/NavBar/index.jsx b/src/components/NavBar/index.jsx index b12a9a4..4c2e1e3 100755 --- a/src/components/NavBar/index.jsx +++ b/src/components/NavBar/index.jsx @@ -12,7 +12,7 @@ import { NavMenu, } from "./NavbarElements"; -const Navbar = ({ toggle }) => { +export default function NavBar({ toggle }) { const [scrollNav, setScrollNav] = useState(false); const changeNav = () => { @@ -101,6 +101,4 @@ const Navbar = ({ toggle }) => { ); -}; - -export default Navbar; +} diff --git a/src/components/Notebooks/index.jsx b/src/components/Notebooks/index.jsx index f01e787..bec4737 100644 --- a/src/components/Notebooks/index.jsx +++ b/src/components/Notebooks/index.jsx @@ -1,7 +1,7 @@ import img from '../../images/coding.svg' import { Column1, Column2, Heading, Img, ImgWrap, NBLink, NotebookContainer, NotebookRow, NotebookWrapper, Subtitle, TextWrapper, TopLine } from './NotebookElements' -const NotebookSection = () => { +export default function NotebookSection() { return ( <> @@ -193,5 +193,3 @@ const NotebookSection = () => { ) } - -export default NotebookSection diff --git a/src/components/ScrollToTop.jsx b/src/components/ScrollToTop.jsx index 6becba0..a6d7498 100755 --- a/src/components/ScrollToTop.jsx +++ b/src/components/ScrollToTop.jsx @@ -5,7 +5,7 @@ export default function ScrollToTop() { const { pathname } = useLocation(); useEffect(() => { - window.scrollTo(0, 0); + window.scrollTo(0, 0, {}); }, [pathname]); return null; diff --git a/src/components/Sidebar/index.jsx b/src/components/Sidebar/index.jsx index 7c5d1de..e3e10fe 100755 --- a/src/components/Sidebar/index.jsx +++ b/src/components/Sidebar/index.jsx @@ -7,7 +7,7 @@ import { SidebarWrapper, } from "./SidebarElements"; -const Sidebar = ({ isOpen, toggle }) => { +export default function Sidebar({ isOpen, toggle }) { return ( <> @@ -33,6 +33,4 @@ const Sidebar = ({ isOpen, toggle }) => { ); -}; - -export default Sidebar; +} diff --git a/src/pages/index.jsx b/src/pages/index.jsx index 705f2cd..71ae0d1 100755 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -8,7 +8,7 @@ import Navbar from "../components/NavBar"; import NotebookSection from "../components/Notebooks"; import Sidebar from "../components/Sidebar"; -const Home = () => { +export default function Home() { const [isOpen, setIsOpen] = useState(false); const toggle = () => { @@ -27,6 +27,4 @@ const Home = () => {