mirror of
https://github.com/johndoe6345789/postgres.git
synced 2026-04-24 22:04:58 +00:00
Refactor navigation to use config-driven components
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import { getTranslations, setRequestLocale } from 'next-intl/server';
|
||||
import Link from 'next/link';
|
||||
import { DemoBanner } from '@/components/DemoBanner';
|
||||
import { LocaleSwitcher } from '@/components/LocaleSwitcher';
|
||||
import { NavLink } from '@/components/NavLink';
|
||||
import { marketingNavigation } from '@/config/navigation';
|
||||
import { styles } from '@/config/styles';
|
||||
import { BaseTemplate } from '@/templates/BaseTemplate';
|
||||
|
||||
export default async function Layout(props: {
|
||||
@@ -21,67 +23,24 @@ export default async function Layout(props: {
|
||||
<BaseTemplate
|
||||
leftNav={(
|
||||
<>
|
||||
<li>
|
||||
<Link
|
||||
href="/"
|
||||
className="border-none text-gray-700 hover:text-gray-900"
|
||||
>
|
||||
{t('home_link')}
|
||||
</Link>
|
||||
</li>
|
||||
<li>
|
||||
<Link
|
||||
href="/about/"
|
||||
className="border-none text-gray-700 hover:text-gray-900"
|
||||
>
|
||||
{t('about_link')}
|
||||
</Link>
|
||||
</li>
|
||||
<li>
|
||||
<Link
|
||||
href="/counter/"
|
||||
className="border-none text-gray-700 hover:text-gray-900"
|
||||
>
|
||||
{t('counter_link')}
|
||||
</Link>
|
||||
</li>
|
||||
<li>
|
||||
<Link
|
||||
href="/portfolio/"
|
||||
className="border-none text-gray-700 hover:text-gray-900"
|
||||
>
|
||||
{t('portfolio_link')}
|
||||
</Link>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
className="border-none text-gray-700 hover:text-gray-900"
|
||||
href="https://github.com/ixartz/Next-js-Boilerplate"
|
||||
>
|
||||
GitHub
|
||||
</a>
|
||||
</li>
|
||||
{marketingNavigation.left.map(link => (
|
||||
<li key={link.id}>
|
||||
<NavLink href={link.href} external={link.external}>
|
||||
{link.label || t(link.translationKey)}
|
||||
</NavLink>
|
||||
</li>
|
||||
))}
|
||||
</>
|
||||
)}
|
||||
rightNav={(
|
||||
<>
|
||||
<li>
|
||||
<Link
|
||||
href="/sign-in/"
|
||||
className="border-none text-gray-700 hover:text-gray-900"
|
||||
>
|
||||
{t('sign_in_link')}
|
||||
</Link>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<Link
|
||||
href="/sign-up/"
|
||||
className="border-none text-gray-700 hover:text-gray-900"
|
||||
>
|
||||
{t('sign_up_link')}
|
||||
</Link>
|
||||
</li>
|
||||
{marketingNavigation.right.map(link => (
|
||||
<li key={link.id}>
|
||||
<NavLink href={link.href}>
|
||||
{t(link.translationKey)}
|
||||
</NavLink>
|
||||
</li>
|
||||
))}
|
||||
|
||||
<li>
|
||||
<LocaleSwitcher />
|
||||
@@ -89,7 +48,7 @@ export default async function Layout(props: {
|
||||
</>
|
||||
)}
|
||||
>
|
||||
<div className="py-5 text-xl [&_p]:my-6">{props.children}</div>
|
||||
<div className={styles.containers.contentPadding}>{props.children}</div>
|
||||
</BaseTemplate>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user