From 00ee5788a80869cd3ed6ad9bbbc757d7dcc8033c Mon Sep 17 00:00:00 2001
From: Maximus <ten.maksim97@gmail.com>
Date: Thu, 8 Sep 2022 13:30:30 +0300
Subject: [PATCH] fixed errors

---
 src/components/FeaturedArticlesCards.tsx | 36 +++++++++++-------------
 src/components/FeaturedAuthorsCards.tsx  | 24 ++++++++--------
 src/components/parts/Footer.tsx          |  4 +--
 src/components/typography/RouterLink.tsx | 11 ++++++--
 4 files changed, 39 insertions(+), 36 deletions(-)

diff --git a/src/components/FeaturedArticlesCards.tsx b/src/components/FeaturedArticlesCards.tsx
index 2052fa0..753fa1b 100644
--- a/src/components/FeaturedArticlesCards.tsx
+++ b/src/components/FeaturedArticlesCards.tsx
@@ -14,6 +14,23 @@ import AspectRatio from "./AspectRatio";
 import Card from "./Card";
 import Link from "./typography/Link";
 
+/* -------------------------------------------------------------------------- */
+/*                                    Icons                                   */
+/* -------------------------------------------------------------------------- */
+import { ReactComponent as SVGArrowRight } from "assets/svg/arrow-right.svg";
+import { ReactComponent as SVGCaretRight } from "assets/svg/caret-right.svg";
+import { ReactComponent as SVGArrowLeft } from "assets/svg/arrow-left.svg";
+
+/* -------------------------------------------------------------------------- */
+/*                                   Swiper                                   */
+/* -------------------------------------------------------------------------- */
+import { Swiper, SwiperSlide } from "swiper/react";
+import SwiperCore, { Navigation } from "swiper";
+import { Pagination } from "swiper";
+import "swiper/css/pagination";
+import "swiper/css/navigation";
+// import "./styles.css";
+import "swiper/css";
 /* -------------------------------------------------------------------------- */
 /*                                    Article mock data                                    */
 /* -------------------------------------------------------------------------- */
@@ -62,25 +79,6 @@ const articles = [
     Link: "http://pinterest.com",
   },
 ];
-
-/* -------------------------------------------------------------------------- */
-/*                                    Icons                                   */
-/* -------------------------------------------------------------------------- */
-import { ReactComponent as SVGArrowRight } from "assets/svg/arrow-right.svg";
-import { ReactComponent as SVGCaretRight } from "assets/svg/caret-right.svg";
-import { ReactComponent as SVGArrowLeft } from "assets/svg/arrow-left.svg";
-
-/* -------------------------------------------------------------------------- */
-/*                                   Swiper                                   */
-/* -------------------------------------------------------------------------- */
-import { Swiper, SwiperSlide } from "swiper/react";
-import SwiperCore, { Navigation } from "swiper";
-import { Pagination } from "swiper";
-import "swiper/css/pagination";
-import "swiper/css/navigation";
-import "./styles.css";
-import "swiper/css";
-
 /* -------------------------------------------------------------------------- */
 /*            How many Skeleton cards should be added to the design           */
 /* -------------------------------------------------------------------------- */
diff --git a/src/components/FeaturedAuthorsCards.tsx b/src/components/FeaturedAuthorsCards.tsx
index 9de34fa..e639ecf 100644
--- a/src/components/FeaturedAuthorsCards.tsx
+++ b/src/components/FeaturedAuthorsCards.tsx
@@ -14,9 +14,20 @@ import { Swiper, SwiperSlide } from "swiper/react";
 import SwiperCore, { Navigation } from "swiper";
 import "swiper/css/pagination";
 import "swiper/css/navigation";
-import "./styles.css";
+// import "./styles.css";
 import "swiper/css";
 
+/* -------------------------------------------------------------------------- */
+/*                                    Icons                                   */
+/* -------------------------------------------------------------------------- */
+import { ReactComponent as SVGCaretRight } from "assets/svg/caret-right.svg";
+import Link from "./typography/Link";
+
+/* -------------------------------------------------------------------------- */
+/*                                  Variables                                 */
+/* -------------------------------------------------------------------------- */
+SwiperCore.use([Navigation]);
+
 /* -------------------------------------------------------------------------- */
 /*                                    Authors data mock                                */
 /* -------------------------------------------------------------------------- */
@@ -46,17 +57,6 @@ const authors = [
   },
 ];
 
-/* -------------------------------------------------------------------------- */
-/*                                    Icons                                   */
-/* -------------------------------------------------------------------------- */
-import { ReactComponent as SVGCaretRight } from "assets/svg/caret-right.svg";
-import Link from "./typography/Link";
-
-/* -------------------------------------------------------------------------- */
-/*                                  Variables                                 */
-/* -------------------------------------------------------------------------- */
-SwiperCore.use([Navigation]);
-
 /* -------------------------------------------------------------------------- */
 /*                               Number of Cards                              */
 /* -------------------------------------------------------------------------- */
diff --git a/src/components/parts/Footer.tsx b/src/components/parts/Footer.tsx
index 9697984..06fe488 100644
--- a/src/components/parts/Footer.tsx
+++ b/src/components/parts/Footer.tsx
@@ -52,7 +52,7 @@ export function Footer() {
   const mainLinksPart = useMemo(
     () =>
       mainLinks.map((link) => (
-        <Link
+        <RouterLink
           key={link.url}
           className="py-1 md:py-2 text-gray-900 px-4"
           disabled={link.disabled}
@@ -61,7 +61,7 @@ export function Footer() {
           <Typography className="" fontWeightVariant="semibold" htmlTag="p">
             {link.label.toUpperCase()}
           </Typography>
-        </Link>
+        </RouterLink>
       )),
     mainLinks
   );
diff --git a/src/components/typography/RouterLink.tsx b/src/components/typography/RouterLink.tsx
index 016e2f8..0d30c79 100644
--- a/src/components/typography/RouterLink.tsx
+++ b/src/components/typography/RouterLink.tsx
@@ -2,15 +2,20 @@ import classNames from "classnames";
 import { NavLink, NavLinkProps } from "react-router-dom";
 
 type Props = {
-  enabled?: boolean;
+  disabled?: boolean;
   children?: React.ReactNode;
 } & NavLinkProps;
 
-export function RouterLink({ children, enabled = true, className, to }: Props) {
+export function RouterLink({
+  children,
+  disabled = false,
+  className,
+  to,
+}: Props) {
   return (
     <NavLink
       to={to}
-      className={classNames({ "pointer-events-none": !enabled }, className)}
+      className={classNames({ "pointer-events-none": disabled }, className)}
     >
       {children}
     </NavLink>