updated imports, mock authors and articles request, renamed files
This commit is contained in:
parent
d108e88c65
commit
956109f34a
@ -6,8 +6,7 @@ import React from "react";
|
|||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
import Typography from "./typography/Typography";
|
import Typography from "./typography/Typography";
|
||||||
import Heading from "./typography/Heading";
|
import Heading from "./typography/Heading";
|
||||||
import Link from "./Link";
|
import Link from "./typography/Link";
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
/* Props */
|
/* Props */
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
@ -102,7 +101,7 @@ Card.CardAction = function CardCardAction({
|
|||||||
}: CardActionProps) {
|
}: CardActionProps) {
|
||||||
return (
|
return (
|
||||||
<Link
|
<Link
|
||||||
href={href}
|
to={href}
|
||||||
className={classNames([className, "flex items-center gap-2"])}
|
className={classNames([className, "flex items-center gap-2"])}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
@ -12,12 +12,56 @@ import Typography from "./typography/Typography";
|
|||||||
import SkeletonCard from "./SkeletonCard";
|
import SkeletonCard from "./SkeletonCard";
|
||||||
import AspectRatio from "./AspectRatio";
|
import AspectRatio from "./AspectRatio";
|
||||||
import Card from "./Card";
|
import Card from "./Card";
|
||||||
import Link from "./Link";
|
import Link from "./typography/Link";
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
/* Data */
|
/* Article mock data */
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
import Articales from "./Articales.json";
|
|
||||||
|
const articles = [
|
||||||
|
{
|
||||||
|
CoverImg:
|
||||||
|
"https://i.kinja-img.com/gawker-media/image/upload/t_original/ijsi5fzb1nbkbhxa2gc1.png",
|
||||||
|
Body: "1 ipsum dolor sit amet consectetur adipisicing elit.Consequuntur maxime, adipisicing elit.sit amet consectetur adipisicing elit.Consequuntur ma",
|
||||||
|
Link: "http://pinterest.com",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
CoverImg:
|
||||||
|
"https://i.kinja-img.com/gawker-media/image/upload/t_original/ijsi5fzb1nbkbhxa2gc1.png",
|
||||||
|
Body: "2 ipsum dolor sit amet consectetur adipisicing elit.Consequuntur maxime, adipisicing elit.",
|
||||||
|
Link: "http://pinterest.com",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
CoverImg:
|
||||||
|
"https://i.kinja-img.com/gawker-media/image/upload/t_original/ijsi5fzb1nbkbhxa2gc1.png",
|
||||||
|
Body: "2 ipsum dolor sit amet consectetur adipisicing elit.Consequuntur maxime, adipisicing elit.",
|
||||||
|
Link: "http://pinterest.com",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
CoverImg:
|
||||||
|
"https://i.kinja-img.com/gawker-media/image/upload/t_original/ijsi5fzb1nbkbhxa2gc1.png",
|
||||||
|
Body: "2 ipsum dolor sit amet consectetur adipisicing elit.Consequuntur maxime, adipisicing elit.",
|
||||||
|
Link: "http://pinterest.com",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
CoverImg:
|
||||||
|
"https://i.kinja-img.com/gawker-media/image/upload/t_original/ijsi5fzb1nbkbhxa2gc1.png",
|
||||||
|
Body: "2 ipsum dolor sit amet consectetur adipisicing elit.Consequuntur maxime, adipisicing elit.",
|
||||||
|
Link: "http://pinterest.com",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
CoverImg:
|
||||||
|
"https://i.kinja-img.com/gawker-media/image/upload/t_original/ijsi5fzb1nbkbhxa2gc1.png",
|
||||||
|
Body: "2 ipsum dolor sit amet consectetur adipisicing elit.Consequuntur maxime, adipisicing elit.",
|
||||||
|
Link: "http://pinterest.com",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
CoverImg:
|
||||||
|
"https://i.kinja-img.com/gawker-media/image/upload/t_original/ijsi5fzb1nbkbhxa2gc1.png",
|
||||||
|
Body: "2 ipsum dolor sit amet consectetur adipisicing elit.Consequuntur maxime, adipisicing elit.",
|
||||||
|
Link: "http://pinterest.com",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
/* Icons */
|
/* Icons */
|
||||||
@ -42,22 +86,22 @@ import "swiper/css";
|
|||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
let twoCards: boolean = false;
|
let twoCards: boolean = false;
|
||||||
let threeCards: boolean = false;
|
let threeCards: boolean = false;
|
||||||
console.log(`Number of cards ${Articales.length}`);
|
console.log(`Number of cards ${articles.length}`);
|
||||||
if (Articales.length == 2) {
|
if (articles.length == 2) {
|
||||||
twoCards = true;
|
twoCards = true;
|
||||||
} else if (Articales.length == 3) {
|
} else if (articles.length == 3) {
|
||||||
threeCards = true;
|
threeCards = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
SwiperCore.use([Navigation]);
|
SwiperCore.use([Navigation]);
|
||||||
|
|
||||||
const FeaturedArticales = () => {
|
const FeaturedArticlesCards = () => {
|
||||||
const navigationPrevRef = useRef(null);
|
const navigationPrevRef = useRef(null);
|
||||||
const navigationNextRef = useRef(null);
|
const navigationNextRef = useRef(null);
|
||||||
const paginationRef = useRef(null);
|
const paginationRef = useRef(null);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="slider-wrapper Articales">
|
<div className="slider-wrapper articles">
|
||||||
<div className="flex justify-end gap-2 my-2">
|
<div className="flex justify-end gap-2 my-2">
|
||||||
<div
|
<div
|
||||||
className="prev inline-flex justify-center items-center
|
className="prev inline-flex justify-center items-center
|
||||||
@ -80,7 +124,7 @@ const FeaturedArticales = () => {
|
|||||||
<Swiper
|
<Swiper
|
||||||
slidesPerView={1.25}
|
slidesPerView={1.25}
|
||||||
slidesPerGroup={1}
|
slidesPerGroup={1}
|
||||||
loop={Articales.length > 4 ? true : false}
|
loop={articles.length > 4 ? true : false}
|
||||||
pagination={{ el: ".pagination", clickable: true }}
|
pagination={{ el: ".pagination", clickable: true }}
|
||||||
navigation={{
|
navigation={{
|
||||||
prevEl: ".prev",
|
prevEl: ".prev",
|
||||||
@ -108,7 +152,7 @@ const FeaturedArticales = () => {
|
|||||||
loopFillGroupWithBlank={true}
|
loopFillGroupWithBlank={true}
|
||||||
modules={[Pagination, Navigation]}
|
modules={[Pagination, Navigation]}
|
||||||
>
|
>
|
||||||
{Articales.map((Articale) => (
|
{articles.map((Articale) => (
|
||||||
<SwiperSlide>
|
<SwiperSlide>
|
||||||
<Card className="flex-1">
|
<Card className="flex-1">
|
||||||
<Card.CardContent>
|
<Card.CardContent>
|
||||||
@ -124,7 +168,7 @@ const FeaturedArticales = () => {
|
|||||||
</Card.CardContent>
|
</Card.CardContent>
|
||||||
|
|
||||||
<Card.CardAction href={Articale.Link}>
|
<Card.CardAction href={Articale.Link}>
|
||||||
<Link>
|
<Link to="*">
|
||||||
<Typography className="text-blue-500 font-bold">
|
<Typography className="text-blue-500 font-bold">
|
||||||
Read More
|
Read More
|
||||||
</Typography>
|
</Typography>
|
||||||
@ -185,4 +229,4 @@ const FeaturedArticales = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default FeaturedArticales;
|
export default FeaturedArticlesCards;
|
@ -18,9 +18,33 @@ import "./styles.css";
|
|||||||
import "swiper/css";
|
import "swiper/css";
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
/* Authors */
|
/* Authors data mock */
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
import Authors from "./Authors.json";
|
const authors = [
|
||||||
|
{
|
||||||
|
Title: "JSON Three",
|
||||||
|
Body: "Lorem ipsum dolor sit amet consectetur adipisicing elit.Consequuntur maxime, adipisicing elit.am elit.Consequuntur maxime, adipisicing elit.",
|
||||||
|
Link: "http://pinterest.com",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Title: "JSON Two",
|
||||||
|
Body: "Lorem ipsum dolor sit amet consectetur adipisicing elit.Consequuntur maxime, adipisicing elit.am elit.Consequuntur maxime, libero est unde sapiente repellendus quam",
|
||||||
|
Link: "http://pinterest.com",
|
||||||
|
img: "https://i.kinja-img.com/gawker-media/image/upload/t_original/ijsi5fzb1nbkbhxa2gc1.png",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Title: "JSON Two",
|
||||||
|
Body: "Lorem ipsum dolor sit amet consectetur adipisicing elit.Consequuntur maxime, adipisicing elit.am elit.Consequuntur maxime, libero est unde sapiente repellendus quam",
|
||||||
|
Link: "http://pinterest.com",
|
||||||
|
img: "https://i.kinja-img.com/gawker-media/image/upload/t_original/ijsi5fzb1nbkbhxa2gc1.png",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Title: "JSON Two",
|
||||||
|
Body: "Lorem ipsum dolor sit amet consectetur adipisicing elit.Consequuntur maxime, adipisicing elit.am elit.Consequuntur maxime, libero est unde sapiente repellendus quam",
|
||||||
|
Link: "http://pinterest.com",
|
||||||
|
img: "https://i.kinja-img.com/gawker-media/image/upload/t_original/ijsi5fzb1nbkbhxa2gc1.png",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
/* Icons */
|
/* Icons */
|
||||||
@ -38,17 +62,17 @@ SwiperCore.use([Navigation]);
|
|||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
let twoCards: boolean = false;
|
let twoCards: boolean = false;
|
||||||
let threeCards: boolean = false;
|
let threeCards: boolean = false;
|
||||||
console.log(`Number of cards ${Authors.length}`);
|
console.log(`Number of cards ${authors.length}`);
|
||||||
if (Authors.length == 2) {
|
if (authors.length == 2) {
|
||||||
twoCards = true;
|
twoCards = true;
|
||||||
} else if (Authors.length == 3) {
|
} else if (authors.length == 3) {
|
||||||
threeCards = true;
|
threeCards = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Featured authors component to display ...
|
* Featured authors component to display ...
|
||||||
*/
|
*/
|
||||||
export default function FeaturedAuthors(): JSX.Element {
|
export default function FeaturedAuthorsCards(): JSX.Element {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{/* The Title of Featured Authors section */}
|
{/* The Title of Featured Authors section */}
|
||||||
@ -60,7 +84,7 @@ export default function FeaturedAuthors(): JSX.Element {
|
|||||||
slidesPerView={1.25}
|
slidesPerView={1.25}
|
||||||
slidesPerGroup={1}
|
slidesPerGroup={1}
|
||||||
spaceBetween={25}
|
spaceBetween={25}
|
||||||
loop={Authors.length > 4 ? true : false}
|
loop={authors.length > 4 ? true : false}
|
||||||
loopFillGroupWithBlank={false}
|
loopFillGroupWithBlank={false}
|
||||||
breakpoints={{
|
breakpoints={{
|
||||||
768: {
|
768: {
|
||||||
@ -81,7 +105,7 @@ export default function FeaturedAuthors(): JSX.Element {
|
|||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{Authors.map((card) => (
|
{authors.map((card) => (
|
||||||
<SwiperSlide>
|
<SwiperSlide>
|
||||||
<Card className="flex-1">
|
<Card className="flex-1">
|
||||||
<Card.CardContent>
|
<Card.CardContent>
|
||||||
@ -109,7 +133,9 @@ export default function FeaturedAuthors(): JSX.Element {
|
|||||||
</Card.CardContent>
|
</Card.CardContent>
|
||||||
|
|
||||||
<Card.CardAction href={card.Link}>
|
<Card.CardAction href={card.Link}>
|
||||||
<Link className="text-blue-500 font-bold ">See More</Link>
|
<Link className="text-blue-500 font-bold" to="*">
|
||||||
|
See More
|
||||||
|
</Link>
|
||||||
<SVGCaretRight className="fill-blue-500 w-4 h-4" />
|
<SVGCaretRight className="fill-blue-500 w-4 h-4" />
|
||||||
</Card.CardAction>
|
</Card.CardAction>
|
||||||
</Card>
|
</Card>
|
@ -12,16 +12,26 @@ import Link from "components/typography/Link";
|
|||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
|
|
||||||
const mainLinks = [
|
const mainLinks = [
|
||||||
{ label: "account settings", url: "/account/settings", enabled: true },
|
{ label: "account settings", url: "/account/settings", disabled: false },
|
||||||
{ label: "about freeland", url: "/about", enabled: true },
|
{ label: "about freeland", url: "/about", disabled: false },
|
||||||
{ label: "help", url: "/help", enabled: true },
|
{ label: "help", url: "/help", disabled: false },
|
||||||
{ label: "contact us", url: "/contact-us", enabled: true },
|
{ label: "contact us", url: "/contact-us", disabled: false },
|
||||||
];
|
];
|
||||||
|
|
||||||
const secondaryLinks = [
|
const secondaryLinks = [
|
||||||
{ index: 1, label: "Terms of Use", url: "/terms-of-use", enabled: true },
|
{ index: 1, label: "Terms of Use", url: "/terms-of-use", disabled: false },
|
||||||
{ index: 2, label: "Privacy Policy", url: "/privacy-policy", enabled: true },
|
{
|
||||||
{ index: 3, label: "Cookies Policy", url: "/cookies-policy", enabled: true },
|
index: 2,
|
||||||
|
label: "Privacy Policy",
|
||||||
|
url: "/privacy-policy",
|
||||||
|
disabled: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
index: 3,
|
||||||
|
label: "Cookies Policy",
|
||||||
|
url: "/cookies-policy",
|
||||||
|
disabled: false,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
@ -42,16 +52,16 @@ export function Footer() {
|
|||||||
const mainLinksPart = useMemo(
|
const mainLinksPart = useMemo(
|
||||||
() =>
|
() =>
|
||||||
mainLinks.map((link) => (
|
mainLinks.map((link) => (
|
||||||
<RouterLink
|
<Link
|
||||||
key={link.url}
|
key={link.url}
|
||||||
className="py-1 md:py-2 text-gray-900 px-4"
|
className="py-1 md:py-2 text-gray-900 px-4"
|
||||||
enabled={link.enabled}
|
disabled={link.disabled}
|
||||||
to={link.url}
|
to={link.url}
|
||||||
>
|
>
|
||||||
<Typography className="" fontWeightVariant="semibold" htmlTag="p">
|
<Typography className="" fontWeightVariant="semibold" htmlTag="p">
|
||||||
{link.label.toUpperCase()}
|
{link.label.toUpperCase()}
|
||||||
</Typography>
|
</Typography>
|
||||||
</RouterLink>
|
</Link>
|
||||||
)),
|
)),
|
||||||
mainLinks
|
mainLinks
|
||||||
);
|
);
|
||||||
@ -61,9 +71,9 @@ export function Footer() {
|
|||||||
secondaryLinks.map((link) => (
|
secondaryLinks.map((link) => (
|
||||||
<div className="flex flex-row items-center">
|
<div className="flex flex-row items-center">
|
||||||
{link.index != 1 && circleDivider}
|
{link.index != 1 && circleDivider}
|
||||||
<RouterLink key={link.url} enabled={link.enabled} to={link.url}>
|
<Link key={link.url} disabled={link.disabled} to={link.url}>
|
||||||
{link.label}
|
{link.label}
|
||||||
</RouterLink>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
)),
|
)),
|
||||||
secondaryLinks
|
secondaryLinks
|
||||||
@ -76,20 +86,20 @@ export function Footer() {
|
|||||||
<div className="lg:px-12 px-2 sm:px-8 md:px-4 pb-2 md:pt-4 pt-2 lg:pt-5 bg-gray-200">
|
<div className="lg:px-12 px-2 sm:px-8 md:px-4 pb-2 md:pt-4 pt-2 lg:pt-5 bg-gray-200">
|
||||||
<section className="w-full grid grid-cols-2 md:grid-rows-2 sm:grid-flow-row-dense sm:grid-rows-2 justify-items-between md:justify-between mb-2 md: items-center md:flex-row md:flex">
|
<section className="w-full grid grid-cols-2 md:grid-rows-2 sm:grid-flow-row-dense sm:grid-rows-2 justify-items-between md:justify-between mb-2 md: items-center md:flex-row md:flex">
|
||||||
<div className="sm:col-span-1">
|
<div className="sm:col-span-1">
|
||||||
<RouterLink to="/">
|
<Link to="*">
|
||||||
<Typography className="text-2xl" fontWeightVariant="semibold">
|
<Typography className="text-2xl" fontWeightVariant="semibold">
|
||||||
Freeland
|
Freeland
|
||||||
</Typography>
|
</Typography>
|
||||||
</RouterLink>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<div className="order-last md:order-none justify-center justify-items-center items-center flex flex-col col-span-4 sm:flex sm:flex-row text-sm">
|
<div className="order-last md:order-none justify-center justify-items-center items-center flex flex-col col-span-4 sm:flex sm:flex-row text-sm">
|
||||||
{mainLinksPart}
|
{mainLinksPart}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-row sm:col-span-1 justify-end">
|
<div className="flex flex-row sm:col-span-1 justify-end">
|
||||||
<Link href="https://www.facebook.com">
|
<Link to="https://www.facebook.com">
|
||||||
<SVGFacebook className="w-5 h-5 fill-gray-900 stroke-gray-900 mr-2" />
|
<SVGFacebook className="w-5 h-5 fill-gray-900 stroke-gray-900 mr-2" />
|
||||||
</Link>
|
</Link>
|
||||||
<Link href="https://www.instagram/com">
|
<Link to="https://www.instagram/com">
|
||||||
{" "}
|
{" "}
|
||||||
<SVGInstagram className="w-5 h-5 fill-gray-900 stroke-gray-900 ml-2 " />
|
<SVGInstagram className="w-5 h-5 fill-gray-900 stroke-gray-900 ml-2 " />
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
import { NavLink, NavLinkProps, To } from "react-router-dom";
|
import { NavLink, NavLinkProps } from "react-router-dom";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
enabled?: boolean;
|
enabled?: boolean;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user