Initial commit

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F22Ms5Cxam5UHyxaCrtZzu
This commit is contained in:
Rami Bitar
2026-07-29 11:02:40 -04:00
co-authored by Claude Fable 5
commit f23332e42c
88 changed files with 7947 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
"use client";
import { defaultI18n, type shop as shopConfigType } from "@shared/config";
import { ShopifyScripts } from "@shopify/hydrogen/react";
import { useRouter } from "next/navigation";
import { routeTemplates } from "@/lib/route-templates";
/**
* `ShopifyScripts` client wrapper (`hydrogen-analytics` / `references/react.md`
* + `hydrogen-setup` / `references/analytics.md`). The root layout is a server
* component and cannot call `useRouter`, so `ShopifyScripts` (which needs a
* `navigate` callback) must live in a client component. Rendered once in the
* root layout with the resolved market `i18n` (single-market example →
* `defaultI18n`) and the numeric `shop` from `@shared/config`.
*/
type ShopConfig = typeof shopConfigType;
export function ShopifyScriptsClient({ shop }: { shop: ShopConfig }) {
const router = useRouter();
return (
<ShopifyScripts
i18n={defaultI18n}
shop={shop}
navigate={(url: string) => router.push(url)}
routes={routeTemplates}
/>
);
}