Final
This commit is contained in:
@@ -3,8 +3,11 @@ import { Link } from 'react-router-dom';
|
||||
import { motion } from 'framer-motion';
|
||||
import { useStore } from '../src/context/StoreContext';
|
||||
|
||||
const Editorial: React.FC = () => {
|
||||
const { articles, isLoading } = useStore();
|
||||
const Editorial: React.FC = () => {
|
||||
const { articles, isLoading } = useStore();
|
||||
const getArticleHref = (slug: string) => (
|
||||
slug.startsWith('/editorial/') ? slug : `/editorial/${slug}`
|
||||
);
|
||||
|
||||
if (isLoading) return <div className="min-h-screen flex items-center justify-center pt-24 font-light text-stone-400">Loading Journal...</div>;
|
||||
if (!articles || articles.length === 0) {
|
||||
@@ -25,7 +28,7 @@ const Editorial: React.FC = () => {
|
||||
{/* Featured Post */}
|
||||
<section className="px-6 mb-32">
|
||||
<div className="max-w-[1400px] mx-auto">
|
||||
<Link to={`/editorial/${featuredArticle.slug}`} className="group block">
|
||||
<Link to={getArticleHref(featuredArticle.slug)} className="group block">
|
||||
<div className="grid grid-cols-1 lg:grid-cols-12 gap-12 items-center">
|
||||
<div className="lg:col-span-8 overflow-hidden rounded-sm aspect-[16/9]">
|
||||
<motion.img
|
||||
@@ -66,7 +69,7 @@ const Editorial: React.FC = () => {
|
||||
<div className="max-w-[1400px] mx-auto">
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-16">
|
||||
{otherArticles.map((entry, idx) => (
|
||||
<Link key={entry.id} to={`/editorial/${entry.slug}`} className="group block">
|
||||
<Link key={entry.id} to={getArticleHref(entry.slug)} className="group block">
|
||||
<motion.div
|
||||
initial={{ y: 20, opacity: 0 }}
|
||||
whileInView={{ y: 0, opacity: 1 }}
|
||||
|
||||
Reference in New Issue
Block a user