Skip to content

Commit bcf1456

Browse files
author
Manuel Schächinger
committed
feat: pageprops update
1 parent c836d88 commit bcf1456

38 files changed

Lines changed: 65 additions & 83 deletions

app/[locale]/(legal)/imprint/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type { Metadata } from 'next';
22
import { getTranslations } from 'next-intl/server';
33

4-
import { PageProps } from '@app/interfaces';
54
import Address from '@components/atoms/Address';
65
import Breadcrumbs from '@components/atoms/Breadcumbs';
76
import Link from '@components/atoms/Link';
@@ -10,7 +9,7 @@ import PageContainer from '@components/organisms/PageContainer';
109
import PageSection from '@components/organisms/PageSection';
1110
import { generatePageMeta } from '@lib/seo';
1211

13-
export const generateMetadata = async ({ params }: PageProps): Promise<Metadata> => {
12+
export const generateMetadata = async ({ params }: PageProps<"/[locale]/imprint">): Promise<Metadata> => {
1413
const { locale } = await params;
1514
const t = await getTranslations('pages.imprint');
1615

app/[locale]/(legal)/privacy/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type { Metadata } from 'next';
22
import { getTranslations } from 'next-intl/server';
33

4-
import type { PageProps } from '@app/interfaces';
54
import Address from '@components/atoms/Address';
65
import BulletList from '@components/atoms/BulletList';
76
import Breadcrumbs from '@components/atoms/Breadcumbs';
@@ -11,7 +10,7 @@ import PageContainer from '@components/organisms/PageContainer';
1110
import PageSection from '@components/organisms/PageSection';
1211
import { generatePageMeta } from '@lib/seo';
1312

14-
export const generateMetadata = async ({ params }: PageProps): Promise<Metadata> => {
13+
export const generateMetadata = async ({ params }: PageProps<"/[locale]/privacy">): Promise<Metadata> => {
1514
const { locale } = await params;
1615
const t = await getTranslations('pages.privacy');
1716

app/[locale]/about/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import Image from 'next/image';
33
import { getTranslations } from 'next-intl/server';
44

55
import wallpaper from '@/public/images/opengraph-schaechinger.jpg';
6-
import type { PageProps } from '@app/interfaces';
76
import { getTimeDuration } from '@/app/utils';
87
import BulletList from '@components/atoms/BulletList';
98
import Breadcrumbs from '@components/atoms/Breadcumbs';
@@ -14,7 +13,7 @@ import PageContainer from '@components/organisms/PageContainer';
1413
import PageSection from '@components/organisms/PageSection';
1514
import { generatePageMeta } from '@lib/seo';
1615

17-
export const generateMetadata = async ({ params }: PageProps): Promise<Metadata> => {
16+
export const generateMetadata = async ({ params }: PageProps<"/[locale]/about">): Promise<Metadata> => {
1817
const { locale } = await params;
1918
const t = await getTranslations('pages.about');
2019

app/[locale]/certifications/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import type { Metadata } from 'next';
22
import { getTranslations } from 'next-intl/server';
33

4-
import { PageProps } from '@app/interfaces';
54
import Breadcrumbs from '@components/atoms/Breadcumbs';
65
import CertificationList from '@components/organisms/CertificationList';
76
import PageContainer from '@components/organisms/PageContainer';
87
import PageSection from '@components/organisms/PageSection';
98
import { generatePageMeta } from '@lib/seo';
109

11-
export const generateMetadata = async ({ params }: PageProps): Promise<Metadata> => {
10+
export const generateMetadata = async ({ params }: PageProps<"/[locale]/certifications">): Promise<Metadata> => {
1211
const { locale } = await params;
1312
const t = await getTranslations('pages.certifications');
1413

app/[locale]/contact/page.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { getTranslations } from 'next-intl/server';
33
import { ReCaptchaProvider } from 'next-recaptcha-v3';
44

55
import { RECAPTCHA_SITE_KEY } from '@app/config';
6-
import type { PageProps } from '@app/interfaces';
76
import AvailabilityIndicator from '@components/atoms/AvailabilityIndicator';
87
import Breadcrumbs from '@components/atoms/Breadcumbs';
98
import LinkButton from '@components/atoms/LinkButton';
@@ -12,7 +11,7 @@ import PageContainer from '@components/organisms/PageContainer';
1211
import PageSection from '@components/organisms/PageSection';
1312
import { generatePageMeta } from '@lib/seo';
1413

15-
export const generateMetadata = async ({ params }: PageProps): Promise<Metadata> => {
14+
export const generateMetadata = async ({ params }: PageProps<"/[locale]/contact">): Promise<Metadata> => {
1615
const { locale } = await params;
1716
const t = await getTranslations('pages.contact');
1817

@@ -25,7 +24,7 @@ export const generateMetadata = async ({ params }: PageProps): Promise<Metadata>
2524

2625
export const dynamic = 'force-dynamic';
2726

28-
const ContactPage = async ({ params }: PageProps) => {
27+
const ContactPage = async ({ params }: PageProps<"/[locale]/contact">) => {
2928
const { locale } = await params;
3029
const t = await getTranslations('pages.contact');
3130

app/[locale]/layout.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { getTranslations } from 'next-intl/server';
44

55
import { supportedLangs, WEB_HOST } from '@app/config';
66
import { clearSans } from '@app/font';
7-
import type { LayoutProps } from '@app/interfaces';
87
import Footer from '@components/organisms/Footer';
98
import Header from '@components/organisms/Header';
109
import LanguageSuggestion from '@components/organisms/LanguageSuggestion';
@@ -14,7 +13,7 @@ export const generateStaticParams = () => (
1413
supportedLangs.map((locale) => ({ locale }))
1514
);
1615

17-
export const generateMetadata = async ({ params }: LayoutProps): Promise<Metadata> => {
16+
export const generateMetadata = async ({ params }: LayoutProps<"/[locale]">): Promise<Metadata> => {
1817
const { locale } = await params;
1918
const t = await getTranslations('general');
2019

@@ -42,7 +41,7 @@ export const generateMetadata = async ({ params }: LayoutProps): Promise<Metadat
4241
};
4342
};
4443

45-
const RootLayout = async ({ children, params }: LayoutProps) => {
44+
const RootLayout = async ({ children, params }: LayoutProps<"/[locale]">) => {
4645
const { locale } = await params;
4746

4847
return (

app/[locale]/now/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import type { Metadata } from 'next';
22
import { getTranslations } from 'next-intl/server';
33

4-
import type { PageProps } from '@app/interfaces';
54
import Breadcrumbs from '@components/atoms/Breadcumbs';
65
import PageContainer from '@components/organisms/PageContainer';
76
import PageSection from '@components/organisms/PageSection';
87
import NowList from '@components/organisms/NowList';
98
import { generatePageMeta } from '@lib/seo';
109

11-
export const generateMetadata = async ({ params }: PageProps): Promise<Metadata> => {
10+
export const generateMetadata = async ({ params }: PageProps<"/[locale]/now">): Promise<Metadata> => {
1211
const { locale } = await params;
1312
const t = await getTranslations('pages.now');
1413

app/[locale]/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type { Metadata } from 'next';
22
import { getTranslations } from 'next-intl/server';
33

4-
import type { PageProps } from '@app/interfaces';
54
import { getTimeDuration } from '@app/utils';
65
import AvailabilityIndicator from '@components/atoms/AvailabilityIndicator';
76
import HighlightLabel from '@components/atoms/HighlightLabel';
@@ -15,7 +14,7 @@ import PageSection from '@components/organisms/PageSection';
1514
import ProjectList from '@components/organisms/ProjectList';
1615
import { generatePageMeta, generateProfileJson } from '@lib/seo';
1716

18-
export const generateMetadata = async ({ params }: PageProps): Promise<Metadata> => {
17+
export const generateMetadata = async ({ params }: PageProps<"/[locale]">): Promise<Metadata> => {
1918
const { locale } = await params;
2019
return generatePageMeta('/', locale);
2120
};

app/[locale]/projects/[slug]/page.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { notFound } from 'next/navigation';
22
import { getTranslations } from 'next-intl/server';
33

4-
import type { PageProps } from '@app/interfaces';
54
import LinkButton from '@components/atoms/LinkButton';
65
import DetailBlock from '@components/molecules/DetailBlock';
76
import ProjectImages from '@components/molecules/ProjectImages';
@@ -10,25 +9,20 @@ import ProjectMasterData from '@components/molecules/ProjectMasterData';
109
import PageContainer from '@components/organisms/PageContainer';
1110
import { loadProjectBySlug } from '@lib/contentful';
1211
import { generateProjectMetadata } from '@lib/projects';
13-
import { type LocaleCode } from '@lib/router';
12+
import type { LocaleCode } from '@lib/router';
1413

15-
interface Props extends PageProps {
16-
params: Promise<{
17-
locale: LocaleCode;
18-
slug: string;
19-
}>;
20-
}
14+
type Props = PageProps<"/[locale]/projects/[slug]">;
2115

2216
export const generateMetadata = async ({ params }: Props) => {
2317
const { locale, slug } = await params;
2418

25-
return generateProjectMetadata(slug, locale)
19+
return generateProjectMetadata(slug, locale as LocaleCode)
2620
};
2721

2822
const ProjectPage = async ({ params }: Props) => {
2923
const { locale, slug } = await params;
3024
const [project, t] = await Promise.all([
31-
loadProjectBySlug(slug, locale),
25+
loadProjectBySlug(slug, locale as LocaleCode),
3226
getTranslations('pages.projects.details'),
3327
]);
3428

app/[locale]/projects/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import type { Metadata } from 'next';
22
import { getTranslations } from 'next-intl/server';
33

4-
import type { PageProps } from '@app/interfaces';
54
import Breadcrumbs from '@components/atoms/Breadcumbs';
65
import PageContainer from '@components/organisms/PageContainer';
76
import PageSection from '@components/organisms/PageSection';
87
import ProjectList from '@components/organisms/ProjectList';
98
import { generatePageMeta } from '@lib/seo';
109

11-
export const generateMetadata = async ({ params }: PageProps): Promise<Metadata> => {
10+
export const generateMetadata = async ({ params }: PageProps<"/[locale]/projects">): Promise<Metadata> => {
1211
const { locale } = await params;
1312
const t = await getTranslations('pages.projects');
1413

0 commit comments

Comments
 (0)