fixed errors

This commit is contained in:
Maximus 2022-09-08 13:30:30 +03:00
parent 956109f34a
commit 00ee5788a8
4 changed files with 39 additions and 36 deletions

View File

@ -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 */
/* -------------------------------------------------------------------------- */

View File

@ -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 */
/* -------------------------------------------------------------------------- */

View File

@ -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
);

View File

@ -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>