@pradip1995/segment-jewelry-account-pages 0.1.1 → 0.1.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pradip1995/segment-jewelry-account-pages",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -15,6 +15,10 @@
15
15
  ".": "./src/index.ts",
16
16
  "./manifest": "./src/manifest.ts"
17
17
  },
18
+ "scripts": {
19
+ "typecheck": "tsc --noEmit",
20
+ "lint": "tsc --noEmit"
21
+ },
18
22
  "peerDependencies": {
19
23
  "@pradip1995/commerce-auth": "^4.0.0",
20
24
  "@pradip1995/commerce-core": "^4.0.0",
@@ -27,8 +31,8 @@
27
31
  "@medusajs/types": "^2.8.0",
28
32
  "@pradip1995/commerce-auth": "^4.0.0",
29
33
  "@pradip1995/commerce-core": "^4.0.0",
30
- "@pradip1995/segment-login-template": "^0.5.7",
31
- "@pradip1995/segment-primitives": "^0.4.3",
34
+ "@pradip1995/segment-login-template": "^0.5.13",
35
+ "@pradip1995/segment-primitives": "^0.4.11",
32
36
  "@pradip1995/segment-tokens": "^0.3.7"
33
37
  },
34
38
  "devDependencies": {
@@ -37,9 +41,5 @@
37
41
  "next": ">=15",
38
42
  "react": "19.0.3",
39
43
  "typescript": "^5.7.2"
40
- },
41
- "scripts": {
42
- "typecheck": "tsc --noEmit",
43
- "lint": "tsc --noEmit"
44
44
  }
45
45
  }
@@ -4,6 +4,7 @@ import Image from "next/image"
4
4
  import type { HttpTypes } from "@medusajs/types"
5
5
  import LocalizedLink from "@pradip1995/segment-primitives/localized-link"
6
6
  import { formatPrice } from "@pradip1995/segment-primitives/format-price"
7
+ import { presentOrderLines } from "@pradip1995/segment-primitives/order-lines"
7
8
 
8
9
  function getStatusDetails(status?: string, fulfillment?: string) {
9
10
  const s = (fulfillment || status || "").toLowerCase()
@@ -87,7 +88,8 @@ export default function ModernAccountOrderCard({
87
88
  }) {
88
89
  const currency = order.currency_code
89
90
  const statusInfo = getStatusDetails(order.status, order.fulfillment_status)
90
- const items = order.items || []
91
+ const presentation = presentOrderLines(order)
92
+ const items = presentation.purchasedItems
91
93
 
92
94
  const dateStr = order.created_at
93
95
  ? new Date(order.created_at).toLocaleDateString("en-US", {
@@ -116,7 +118,7 @@ export default function ModernAccountOrderCard({
116
118
  <div className="modern-order-row__col">
117
119
  <p className="modern-order-row__label">Total amount</p>
118
120
  <p className="modern-order-row__val modern-order-row__val--price">
119
- {formatPrice(order.total, currency)}
121
+ {formatPrice(presentation.paidTotal, currency)}
120
122
  </p>
121
123
  </div>
122
124
 
@@ -204,7 +206,7 @@ export default function ModernAccountOrderCard({
204
206
  <div className="modern-order-card__foot">
205
207
  <div>
206
208
  <span className="modern-order-card__label">Total Amount</span>
207
- <p className="modern-order-card__total-val">{formatPrice(order.total, currency)}</p>
209
+ <p className="modern-order-card__total-val">{formatPrice(presentation.paidTotal, currency)}</p>
208
210
  </div>
209
211
  <LocalizedLink href={`/orders/${order.id}`} className="modern-btn modern-btn--outline">
210
212
  View Order Details →