Skip to content

Commit

Permalink
refactor: introduce shared root layout
Browse files Browse the repository at this point in the history
  • Loading branch information
literat committed Nov 18, 2024
1 parent 5e9c41c commit 989440b
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 37 deletions.
5 changes: 5 additions & 0 deletions src/app/(home)/home/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import React from 'react';
import { Metadata } from 'next';

export const metadata: Metadata = {
title: 'Home',
};

export default function Home() {
return (
Expand Down
23 changes: 5 additions & 18 deletions src/app/(home)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,13 @@
import { Metadata } from 'next';
import React, { ReactNode } from 'react';
import { inter } from '@local/ui/fonts';
import '@local/styles/home-globals.scss';
import '@local/ui/home.globals.scss';
import { Header } from '@local/ui/Header';
import { Inner } from '@local/ui/Inner';

export const metadata: Metadata = {
title: {
template: '%s | Home | Litera.me',
default: 'Litera.me',
},
description: 'Home of the Litera Family',
metadataBase: new URL('https://litera.me'),
};

export default function HomeLayout({ children }: { children: ReactNode }) {
return (
<html lang="en">
<body className={`${inter.className} antialiased`}>
<Header />
<Inner>{children}</Inner>
</body>
</html>
<>
<Header />
<Inner>{children}</Inner>
</>
);
}
20 changes: 2 additions & 18 deletions src/app/(homepage)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
import { Metadata } from 'next';
import { ReactNode } from 'react';
import '@local/styles/globals.scss';
import { inter } from '@local/ui/fonts';
import React from 'react';

export const metadata: Metadata = {
title: {
template: '%s | Litera.me',
default: 'Litera.me',
},
description: 'Litera Family',
metadataBase: new URL('https://litera.me'),
};
import '@local/ui/homepage.globals.scss';

export default function HomepageLayout({ children }: { children: ReactNode }) {
return (
<html lang="en">
<body className={`${inter.className} antialiased`}>{children}</body>
</html>
);
return children;
}
7 changes: 6 additions & 1 deletion src/app/(homepage)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { FamilyMemberCard } from '@local/features/homepage/ui/FamilyMemberCard';
import styles from '@local/styles/Home.module.scss';
import styles from '@local/features/homepage/ui/Home.module.scss';
import { Metadata } from 'next';

export const metadata: Metadata = {
title: 'Homepage',
};

export default function HomepagePage() {
return (
Expand Down
21 changes: 21 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Metadata } from 'next';
import { ReactNode } from 'react';
import { inter } from '@local/ui/fonts';
import React from 'react';

export const metadata: Metadata = {
title: {
template: '%s | Litera.me',
default: 'Litera.me',
},
description: 'Litera Family',
metadataBase: new URL('https://litera.me'),
};

export default function RootLayout({ children }: { children: ReactNode }) {
return (
<html lang="en">
<body className={`${inter.className} antialiased`}>{children}</body>
</html>
);
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 989440b

Please sign in to comment.