Align sidebar height with main content for a consistent page layout
Update `home.tsx` to make the sidebar stretch to the full height of the main content by applying `items-stretch` to the grid parent and `h-full` to the sidebar container, ensuring vertical alignment between the main content and sidebar columns. Adjust `TopStoriesList` to accept a `className` prop for flexible height management. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 517dfa7b-26ac-463d-a6e1-a58c6df97188 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 40bf732d-d120-4be6-89c1-a898bb90cba4 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
4ca5e0859f
commit
9af28cf166
BIN
attached_assets/image_1772474840087.png
Normal file
BIN
attached_assets/image_1772474840087.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 439 KiB |
@ -303,9 +303,9 @@ function NativeAdCard() {
|
||||
);
|
||||
}
|
||||
|
||||
function TopStoriesList({ articles }: { articles: Article[] }) {
|
||||
function TopStoriesList({ articles, className }: { articles: Article[]; className?: string }) {
|
||||
return (
|
||||
<div className="bg-card rounded-lg border border-card-border p-4" data-testid="sidebar-top-stories">
|
||||
<div className={`bg-card rounded-lg border border-card-border p-4 ${className || ""}`} data-testid="sidebar-top-stories">
|
||||
<h3 className="font-bold text-card-foreground text-sm mb-3 flex items-center gap-2">
|
||||
<span className="w-1 h-4 bg-primary rounded-full" />
|
||||
Zuletzt hinzugefügt
|
||||
@ -557,7 +557,7 @@ export default function Home() {
|
||||
<Header />
|
||||
<main className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4 space-y-4">
|
||||
|
||||
<div className="grid grid-cols-1 lg:grid-cols-4 gap-4">
|
||||
<div className="grid grid-cols-1 lg:grid-cols-4 gap-4 items-stretch">
|
||||
<div className="lg:col-span-3 space-y-4">
|
||||
<FeaturedCarousel articles={articles} popular={popular} galleryImages={galleryImages} focalPoints={focalPoints} />
|
||||
{widePickedArticles.length > 0 && (
|
||||
@ -568,12 +568,11 @@ export default function Home() {
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="lg:col-span-1 flex flex-col gap-4">
|
||||
<div className="lg:col-span-1 flex flex-col gap-4 h-full">
|
||||
<SidebarWeatherWidget />
|
||||
<div className="flex-1">
|
||||
{articles && articles.length > 0 && <TopStoriesList articles={[...articles].sort((a, b) => new Date(b.publishedAt).getTime() - new Date(a.publishedAt).getTime()).slice(0, 4)} />}
|
||||
<div className="flex-1 flex flex-col">
|
||||
{articles && articles.length > 0 && <TopStoriesList articles={[...articles].sort((a, b) => new Date(b.publishedAt).getTime() - new Date(a.publishedAt).getTime()).slice(0, 4)} className="flex-1" />}
|
||||
</div>
|
||||
<SidebarAd />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user