Skip to content

Commit e5a609b

Browse files
committed
Remove flags and middleware files, update package.json and vercel.json for dependency management, and implement new cart and product features in the app.
1 parent bac6c5f commit e5a609b

File tree

19 files changed

+4255
-317
lines changed

19 files changed

+4255
-317
lines changed

app/.well-known/vercel/flags/route.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

app/[code]/cart/page.tsx

Lines changed: 0 additions & 33 deletions
This file was deleted.

app/[code]/layout.tsx

Lines changed: 0 additions & 48 deletions
This file was deleted.

app/[code]/add-to-cart.tsx renamed to app/add-to-cart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ export function AddToCart() {
2727
}}
2828
/>
2929
);
30-
}
30+
}
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
import { proceedToCheckoutColorFlag } from '@/flags';
21
import { OrderSummarySection } from '@/components/shopping-cart/order-summary-section';
32
import { ProceedToCheckout } from './proceed-to-checkout';
43

5-
export async function OrderSummary({
4+
export function OrderSummary({
65
showSummerBanner,
76
freeDelivery,
87
}: {
98
showSummerBanner: boolean;
109
freeDelivery: boolean;
1110
}) {
12-
// This is a fast feature flag so we don't suspend on it
13-
const proceedToCheckoutColor = await proceedToCheckoutColorFlag();
11+
// Using default value: proceedToCheckoutColor = 'blue'
12+
const proceedToCheckoutColor = 'blue';
1413

1514
return (
1615
<OrderSummarySection
@@ -19,4 +18,4 @@ export async function OrderSummary({
1918
proceedToCheckout={<ProceedToCheckout color={proceedToCheckoutColor} />}
2019
/>
2120
);
22-
}
21+
}

app/cart/page.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { OrderSummary } from '@/app/cart/order-summary';
2+
import { Main } from '@/components/main';
3+
import { ShoppingCart } from '@/components/shopping-cart/shopping-cart';
4+
5+
export default function CartPage() {
6+
// Using default values: showSummerBanner = false, freeDelivery = false
7+
const showSummerBanner = false;
8+
const freeDelivery = false;
9+
10+
return (
11+
<Main>
12+
<div className="lg:grid lg:grid-cols-12 lg:items-start lg:gap-x-12 xl:gap-x-16">
13+
<ShoppingCart />
14+
<OrderSummary
15+
showSummerBanner={showSummerBanner}
16+
freeDelivery={freeDelivery}
17+
/>
18+
</div>
19+
</Main>
20+
);
21+
}

app/[code]/cart/proceed-to-checkout.tsx renamed to app/cart/proceed-to-checkout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ export function ProceedToCheckout({ color }: { color: string }) {
1818
}}
1919
/>
2020
);
21-
}
21+
}

app/layout.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,31 @@ import type { Metadata } from 'next';
44
import { Toaster } from 'sonner';
55

66
import './globals.css';
7-
import { ExamplesBanner } from '@/components/banners/examples-banner';
7+
import { FreeDelivery } from '@/app/free-delivery';
8+
import { Footer } from '@/components/footer';
9+
import { Navigation } from '@/components/navigation';
810

911
export const metadata: Metadata = {
10-
title: 'Flags SDK Example',
11-
description: 'A Flags SDK example for Ecommerce',
12+
title: 'Shirt Shop Example',
13+
description: 'A shirt shop example for Ecommerce',
1214
};
1315

1416
export default function RootLayout({
1517
children,
1618
}: Readonly<{
1719
children: React.ReactNode;
1820
}>) {
21+
const showFreeDeliveryBanner = true;
22+
1923
return (
2024
<html lang="en">
2125
<body className="antialiased">
22-
<ExamplesBanner />
23-
{children}
26+
<div className="bg-white">
27+
<FreeDelivery show={showFreeDeliveryBanner} />
28+
<Navigation />
29+
{children}
30+
<Footer />
31+
</div>
2432
<Toaster />
2533
<Analytics />
2634
<VercelToolbar />

app/[code]/page.tsx renamed to app/page.tsx

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,14 @@ import { SummerSale } from '@/app/summer-sale';
22
import { ImageGallery } from '@/components/image-gallery';
33
import { ProductDetails } from '@/components/product-detail-page/product-details';
44
import { ProductHeader } from '@/components/product-detail-page/product-header';
5-
import { AddToCart } from '@/app/[code]/add-to-cart';
5+
import { AddToCart } from '@/app/add-to-cart';
66
import { ColorPicker } from '@/components/product-detail-page/color-picker';
77
import { SizePicker } from '@/components/product-detail-page/size-picker';
88
import { ProductDetailPageProvider } from '@/components/utils/product-detail-page-context';
9-
10-
import { productFlags, showSummerBannerFlag } from '@/flags';
119
import { Main } from '@/components/main';
1210

13-
export default async function Page(props: {
14-
params: Promise<{ code: string }>;
15-
}) {
16-
const params = await props.params;
17-
18-
const showSummerBanner = await showSummerBannerFlag(
19-
params.code,
20-
productFlags,
21-
);
11+
export default function Page() {
12+
const showSummerBanner = true;
2213

2314
return (
2415
<ProductDetailPageProvider>
@@ -38,4 +29,4 @@ export default async function Page(props: {
3829
</Main>
3930
</ProductDetailPageProvider>
4031
);
41-
}
32+
}

flags.ts

Lines changed: 0 additions & 80 deletions
This file was deleted.

0 commit comments

Comments
 (0)