Skip to content

Commit 772b008

Browse files
Unify headers and clean up removed shop components
1 parent ecc820f commit 772b008

30 files changed

Lines changed: 404 additions & 422 deletions

frontend/app/[locale]/layout.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@ import Footer from '@/components/shared/Footer';
99
import { ThemeProvider } from '@/components/theme/ThemeProvider';
1010
import { getCurrentUser } from '@/lib/auth';
1111

12-
import {
13-
HeaderSwitcher,
14-
MainSwitcher,
15-
} from '@/components/header/HeaderSwitcher';
12+
import { MainSwitcher } from '@/components/header/MainSwitcher';
13+
import { AppChrome } from '@/components/header/AppChrome';
1614

1715
export const dynamic = 'force-dynamic';
1816

@@ -30,6 +28,9 @@ export default async function LocaleLayout({
3028
const messages = await getMessages({ locale });
3129
const user = await getCurrentUser();
3230

31+
const userExists = Boolean(user);
32+
const showAdminNavLink = process.env.NEXT_PUBLIC_ENABLE_ADMIN === 'true';
33+
3334
return (
3435
<NextIntlClientProvider messages={messages}>
3536
<ThemeProvider
@@ -38,8 +39,9 @@ export default async function LocaleLayout({
3839
enableSystem
3940
disableTransitionOnChange
4041
>
41-
<HeaderSwitcher userExists={Boolean(user)} />
42-
<MainSwitcher>{children}</MainSwitcher>
42+
<AppChrome userExists={userExists} showAdminLink={showAdminNavLink}>
43+
<MainSwitcher>{children}</MainSwitcher>
44+
</AppChrome>
4345

4446
<Footer />
4547
<Toaster position="top-right" richColors expand />

frontend/app/[locale]/shop/admin/layout.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type React from 'react';
2-
import Link from 'next/link';
2+
import { Link } from '@/i18n/routing';
3+
34
import { notFound, redirect } from 'next/navigation';
45

56
import {

frontend/app/[locale]/shop/admin/orders/[id]/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import Link from "next/link";
1+
import { Link } from '@/i18n/routing';
2+
23
import { notFound } from "next/navigation";
34

45
import { getAdminOrderDetail } from "@/db/queries/shop/admin-orders";

frontend/app/[locale]/shop/admin/orders/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Link from "next/link";
1+
import { Link } from '@/i18n/routing';
22

33
import { getAdminOrdersPage } from "@/db/queries/shop/admin-orders";
44
import { formatMoney, resolveCurrencyFromLocale, type CurrencyCode } from "@/lib/shop/currency";

frontend/app/[locale]/shop/admin/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import Link from "next/link"
1+
import { Link } from '@/i18n/routing';
2+
23

34
export default function ShopAdminHomePage() {
45
return (

frontend/app/[locale]/shop/admin/products/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Link from 'next/link';
1+
import { Link } from '@/i18n/routing';
22
import { desc } from 'drizzle-orm';
33

44
import { AdminProductStatusToggle } from '@/components/shop/admin/admin-product-status-toggle';

frontend/app/[locale]/shop/cart/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
'use client';
22

33
import Image from 'next/image';
4-
import Link from 'next/link';
4+
import { Link } from '@/i18n/routing';
5+
56
import { useState } from 'react';
67
import { useRouter } from 'next/navigation';
78
import { Minus, Plus, Trash2, ShoppingBag } from 'lucide-react';

frontend/app/[locale]/shop/checkout/error/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Link from "next/link"
1+
import { Link } from '@/i18n/routing';
22

33
import { formatPrice } from "@/lib/shop/currency"
44
import { OrderNotFoundError } from "@/lib/services/errors"

frontend/app/[locale]/shop/checkout/payment/StripePaymentClient.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
"use client";
22

33
import { useMemo, useState } from "react";
4-
import Link from "next/link";
4+
import { Link } from '@/i18n/routing';
5+
56
import { useRouter } from "next/navigation";
67
import { Elements, PaymentElement, useElements, useStripe } from "@stripe/react-stripe-js";
78
import { loadStripe, type StripeElementsOptions, type Stripe } from "@stripe/stripe-js";

frontend/app/[locale]/shop/checkout/payment/[orderId]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Link from "next/link";
1+
import { Link } from '@/i18n/routing';
22

33
import StripePaymentClient from "../StripePaymentClient";
44
import { formatMoney } from "@/lib/shop/currency";

0 commit comments

Comments
 (0)