Refactor language switcher and enhance site routing
Renamed 'LanguageDropdownSwitcher' to 'LanguageSelector' for better representation of the component's functionality. Removed unnecessary dependencies and optimized function declarations. Updated site routing to include new pages like 'contact', 'terms-of-service', and 'privacy-policy'. Also made adjustments for multi-language support, providing better user experience.
This commit is contained in:
@@ -1,12 +1,23 @@
|
||||
import { SitePageHeader } from '~/(marketing)/_components/site-page-header';
|
||||
import { createI18nServerInstance } from '~/lib/i18n/i18n.server';
|
||||
import { withI18n } from '~/lib/i18n/with-i18n';
|
||||
|
||||
function CookiePolicyPage() {
|
||||
export async function generateMetadata() {
|
||||
const { t } = await createI18nServerInstance();
|
||||
|
||||
return {
|
||||
title: t('marketing.cookiePolicy'),
|
||||
};
|
||||
}
|
||||
|
||||
async function CookiePolicyPage() {
|
||||
const { t } = await createI18nServerInstance();
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className={'container mx-auto'}>
|
||||
<SitePageHeader
|
||||
title={`Cookie Policy`}
|
||||
title={t(`marketing.cookiePolicy`)}
|
||||
subtitle={`This is the cookie policy page. It's a great place to put information about the cookies your site uses.`}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -1,11 +1,22 @@
|
||||
import { SitePageHeader } from '~/(marketing)/_components/site-page-header';
|
||||
import { createI18nServerInstance } from '~/lib/i18n/i18n.server';
|
||||
import { withI18n } from '~/lib/i18n/with-i18n';
|
||||
|
||||
function PrivacyPolicyPage() {
|
||||
export async function generateMetadata() {
|
||||
const { t } = await createI18nServerInstance();
|
||||
|
||||
return {
|
||||
title: t('marketing.privacyPolicy'),
|
||||
};
|
||||
}
|
||||
|
||||
async function PrivacyPolicyPage() {
|
||||
const { t } = await createI18nServerInstance();
|
||||
|
||||
return (
|
||||
<div className={'mt-8'}>
|
||||
<div className={'container mx-auto'}>
|
||||
<SitePageHeader title={`Privacy Policy`} subtitle={``} />
|
||||
<SitePageHeader title={t('marketing.privacyPolicy')} subtitle={``} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -1,11 +1,22 @@
|
||||
import { SitePageHeader } from '~/(marketing)/_components/site-page-header';
|
||||
import { createI18nServerInstance } from '~/lib/i18n/i18n.server';
|
||||
import { withI18n } from '~/lib/i18n/with-i18n';
|
||||
|
||||
function TermsOfServicePage() {
|
||||
export async function generateMetadata() {
|
||||
const { t } = await createI18nServerInstance();
|
||||
|
||||
return {
|
||||
title: t('marketing.termsOfService'),
|
||||
};
|
||||
}
|
||||
|
||||
async function TermsOfServicePage() {
|
||||
const { t } = await createI18nServerInstance();
|
||||
|
||||
return (
|
||||
<div className={'mt-8'}>
|
||||
<div className={'container mx-auto'}>
|
||||
<SitePageHeader title={`Terms of Service`} subtitle={``} />
|
||||
<SitePageHeader title={t(`marketing:termsOfService`)} subtitle={``} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -90,7 +90,7 @@ export function SiteFooter() {
|
||||
<FooterSectionList>
|
||||
<FooterLink>
|
||||
<Link href={'/terms-of-service'}>
|
||||
<Trans i18nKey={'marketing:tos'} />
|
||||
<Trans i18nKey={'marketing:termsOfService'} />
|
||||
</Link>
|
||||
</FooterLink>
|
||||
<FooterLink>
|
||||
|
||||
25
apps/web/app/(marketing)/contact/page.tsx
Normal file
25
apps/web/app/(marketing)/contact/page.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import { SitePageHeader } from '~/(marketing)/_components/site-page-header';
|
||||
import { createI18nServerInstance } from '~/lib/i18n/i18n.server';
|
||||
import { withI18n } from '~/lib/i18n/with-i18n';
|
||||
|
||||
export async function generateMetadata() {
|
||||
const { t } = await createI18nServerInstance();
|
||||
|
||||
return {
|
||||
title: t('marketing.contact'),
|
||||
};
|
||||
}
|
||||
|
||||
async function ContactPage() {
|
||||
const { t } = await createI18nServerInstance();
|
||||
|
||||
return (
|
||||
<div className={'mt-8'}>
|
||||
<div className={'container mx-auto'}>
|
||||
<SitePageHeader title={t(`marketing:contact`)} subtitle={``} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default withI18n(ContactPage);
|
||||
Reference in New Issue
Block a user