Refactor: Full-width support for Clasificados
This commit is contained in:
parent
4f1bc2b3ba
commit
f71879da9c
@ -2,6 +2,7 @@ import { APPWRITE_ALMEIRA_CONFIG } from '@/lib/appwrite';
|
||||
import { createAdminClient } from '@/lib/appwrite.server';
|
||||
import { Query } from 'node-appwrite';
|
||||
import { NewsCard } from '@/components/NewsCard';
|
||||
import { GlobalSidebar, hasSidebarContent } from '@/components/AdWrappers';
|
||||
import { Sparkles } from 'lucide-react';
|
||||
|
||||
async function fetchClasificadosData() {
|
||||
@ -56,6 +57,7 @@ async function fetchClasificadosData() {
|
||||
|
||||
export default async function ClasificadosPage() {
|
||||
const { posts, cardSettings } = await fetchClasificadosData();
|
||||
const hasSidebar = await hasSidebarContent();
|
||||
|
||||
return (
|
||||
<main className="animate-fade-in relative min-h-screen">
|
||||
@ -84,7 +86,9 @@ export default async function ClasificadosPage() {
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="noticias" className="container mx-auto px-4 py-20 relative z-10">
|
||||
<section id="noticias" className="container mx-auto px-4 py-20 relative z-10 w-full">
|
||||
<div className="flex flex-col lg:flex-row gap-8 w-full items-start">
|
||||
<div className="flex-1 w-full relative">
|
||||
<div className="flex flex-col md:flex-row justify-between items-end mb-12 gap-6">
|
||||
<div>
|
||||
<div className="flex items-center gap-3 mb-2">
|
||||
@ -104,7 +108,7 @@ export default async function ClasificadosPage() {
|
||||
<p className="text-slate-400 relative z-10">El mercado se encuentra a la espera de nuevas ofertas globales.</p>
|
||||
</div>
|
||||
) : (
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
<div className={`grid grid-cols-1 md:grid-cols-2 ${hasSidebar ? 'lg:grid-cols-2 xl:grid-cols-3' : 'lg:grid-cols-3 xl:grid-cols-4'} gap-6`}>
|
||||
{posts.map((post) => {
|
||||
const PROJECT_ID = process.env.NEXT_PUBLIC_APPWRITE_PROJECT_ID || '69b84df5003bd8957c5c';
|
||||
const ENDPOINT = process.env.NEXT_PUBLIC_APPWRITE_ENDPOINT || 'https://appwrite.almeira.com.co/v1';
|
||||
@ -133,6 +137,14 @@ export default async function ClasificadosPage() {
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{hasSidebar && (
|
||||
<aside className="w-full lg:w-[320px] xl:w-[360px] shrink-0 mt-8 lg:mt-0 sticky top-24">
|
||||
<GlobalSidebar />
|
||||
</aside>
|
||||
)}
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user