Update blog to show recent articles and fix ad display
Modify the home page to display the 5 most recent articles instead of popular ones and adjust ad placement to prevent duplicates in the same row. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 517dfa7b-26ac-463d-a6e1-a58c6df97188 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 64fe0de6-7bcc-4618-998b-56c6f8e117b3 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/f209e72a-0939-48fa-84fc-57854de71967/517dfa7b-26ac-463d-a6e1-a58c6df97188/nFw7xof Replit-Helium-Checkpoint-Created: true
This commit is contained in:
parent
94a970eb4d
commit
698b26c66e
BIN
attached_assets/image_1772470581637.png
Normal file
BIN
attached_assets/image_1772470581637.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 97 KiB |
@ -308,10 +308,10 @@ function TopStoriesList({ articles }: { articles: Article[] }) {
|
||||
<div className="bg-card rounded-lg border border-card-border p-3 h-full flex flex-col" data-testid="sidebar-top-stories">
|
||||
<h3 className="font-bold text-card-foreground text-xs mb-2 flex items-center gap-2">
|
||||
<span className="w-1 h-3.5 bg-primary rounded-full" />
|
||||
Musiknachrichten
|
||||
Zadnje dodano
|
||||
</h3>
|
||||
<div className="space-y-0">
|
||||
{articles.slice(0, 10).map((article) => (
|
||||
{articles.slice(0, 5).map((article) => (
|
||||
<Link key={article.id} href={`/article/${article.slug}`}>
|
||||
<div className="group cursor-pointer py-2 border-b border-card-border last:border-0" data-testid={`card-top-${article.id}`}>
|
||||
<h4 className="text-xs font-medium text-card-foreground line-clamp-2 group-hover:text-primary transition-colors leading-snug">{article.title}</h4>
|
||||
@ -588,7 +588,7 @@ export default function Home() {
|
||||
)}
|
||||
</div>
|
||||
<div className="lg:col-span-1">
|
||||
{popular && popular.length > 0 && <TopStoriesList articles={popular} />}
|
||||
{articles && articles.length > 0 && <TopStoriesList articles={[...articles].sort((a, b) => new Date(b.publishedAt).getTime() - new Date(a.publishedAt).getTime()).slice(0, 5)} />}
|
||||
<SidebarAd />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user