Skip to content

Commit 584f843

Browse files
Enhance layout structure and styling for improved UI
- Updated global CSS to establish a flexbox layout for the body, ensuring a minimum height of 100vh and proper footer styling. - Refactored RootLayout to wrap children in a main element for better semantic structure. - Simplified IndexPage by removing unnecessary main tags, directly rendering sections for improved readability and performance.
1 parent 23d06cf commit 584f843

3 files changed

Lines changed: 23 additions & 13 deletions

File tree

src/app/(sections)/page.tsx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,16 @@ export default async function IndexPage() {
1515
return (
1616
<div className="IndexPage">
1717
<article>
18-
<main>
19-
<section aria-label="Синонимы">
20-
<h2>Новости</h2>
21-
<ul>
22-
{documents.map((document) => (
23-
<li key={document.id}>
24-
<Link href={`/news/${document.slug}`}>{document.title}</Link>
25-
</li>
26-
))}
27-
</ul>
28-
</section>
29-
</main>
18+
<section aria-label="Синонимы">
19+
<h2>Новости</h2>
20+
<ul>
21+
{documents.map((document) => (
22+
<li key={document.id}>
23+
<Link href={`/news/${document.slug}`}>{document.title}</Link>
24+
</li>
25+
))}
26+
</ul>
27+
</section>
3028
</article>
3129
</div>
3230
)

src/app/global.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@ body {
2525
color: var(--text-color);
2626
font-family: sans-serif;
2727
line-height: 1.5;
28+
display: flex;
29+
flex-direction: column;
30+
min-height: 100vh;
31+
}
32+
33+
main {
34+
flex: 1;
35+
}
36+
37+
footer {
38+
background: #ccc;
39+
padding: 1rem;
2840
}
2941

3042
a {

src/app/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default async function RootLayout({
1010
return (
1111
<html lang="ru">
1212
<body>
13-
{children}
13+
<main>{children}</main>
1414
<SpeedInsights />
1515
<Analytics />
1616
<Footer />

0 commit comments

Comments
 (0)