@pradip1995/layout-product 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +35 -0
- package/src/index.ts +2 -0
- package/src/layout.tsx +43 -0
- package/src/manifest.ts +10 -0
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pradip1995/layout-product",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"files": [
|
|
10
|
+
"src"
|
|
11
|
+
],
|
|
12
|
+
"exports": {
|
|
13
|
+
".": "./src/index.ts",
|
|
14
|
+
"./manifest": "./src/manifest.ts"
|
|
15
|
+
},
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"@pradip1995/plugin-sdk": "^0.2.0",
|
|
18
|
+
"react": ">=19"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@pradip1995/layout-default": "0.2.0",
|
|
22
|
+
"@pradip1995/segment-primitives": "0.2.0",
|
|
23
|
+
"@pradip1995/segment-tokens": "0.2.0"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@pradip1995/plugin-sdk": "^0.2.0",
|
|
27
|
+
"@types/react": "^19",
|
|
28
|
+
"react": "19.0.3",
|
|
29
|
+
"typescript": "^5.7.2"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"typecheck": "tsc --noEmit",
|
|
33
|
+
"lint": "tsc --noEmit"
|
|
34
|
+
}
|
|
35
|
+
}
|
package/src/index.ts
ADDED
package/src/layout.tsx
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ReactNode } from "react"
|
|
2
|
+
import { Children } from "react"
|
|
3
|
+
import { StorefrontShell } from "@pradip1995/layout-default/shell"
|
|
4
|
+
|
|
5
|
+
export default function LayoutProduct({
|
|
6
|
+
data,
|
|
7
|
+
children,
|
|
8
|
+
}: {
|
|
9
|
+
data: Record<string, unknown>
|
|
10
|
+
children: ReactNode
|
|
11
|
+
}) {
|
|
12
|
+
const segments = Children.toArray(children)
|
|
13
|
+
const [gallery, info, actions, related] = segments
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<StorefrontShell data={data}>
|
|
17
|
+
<div className="mx-auto px-4 sm:px-6 py-6 lg:py-10" style={{ maxWidth: "var(--container-max)" }}>
|
|
18
|
+
<div
|
|
19
|
+
className="flex flex-col lg:flex-row lg:items-start gap-8 lg:gap-10 mt-2 lg:mt-4 product-page__grid"
|
|
20
|
+
data-testid="product-container"
|
|
21
|
+
>
|
|
22
|
+
<div
|
|
23
|
+
id="product-gallery-container"
|
|
24
|
+
className="product-images-sticky w-full lg:w-[55%] min-w-0 shrink-0"
|
|
25
|
+
>
|
|
26
|
+
{gallery}
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<div className="product-details-column product-details-scroll w-full lg:w-[45%] min-w-0 shrink-0 flex flex-col gap-4 lg:gap-5 lg:pt-0">
|
|
30
|
+
{info}
|
|
31
|
+
{actions}
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
{related ? (
|
|
36
|
+
<div id="related-products" className="related-products-section" data-testid="related-products-container">
|
|
37
|
+
<div className="related-products-section__inner">{related}</div>
|
|
38
|
+
</div>
|
|
39
|
+
) : null}
|
|
40
|
+
</div>
|
|
41
|
+
</StorefrontShell>
|
|
42
|
+
)
|
|
43
|
+
}
|