@pradip1995/segment-animation-order 0.2.1 → 0.2.2

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-animation-order",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Motion/Lumière order confirmed, failed, and details pages",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -16,6 +16,10 @@
16
16
  ".": "./src/index.ts",
17
17
  "./manifest": "./src/manifest.ts"
18
18
  },
19
+ "scripts": {
20
+ "typecheck": "tsc --noEmit",
21
+ "lint": "tsc --noEmit"
22
+ },
19
23
  "peerDependencies": {
20
24
  "@medusajs/types": ">=2",
21
25
  "@pradip1995/commerce-core": "^4.0.0",
@@ -25,7 +29,7 @@
25
29
  "react-dom": ">=19"
26
30
  },
27
31
  "dependencies": {
28
- "@pradip1995/segment-primitives": "^0.4.0",
32
+ "@pradip1995/segment-primitives": "^0.4.11",
29
33
  "framer-motion": "^11.0.0"
30
34
  },
31
35
  "devDependencies": {
@@ -36,9 +40,5 @@
36
40
  "next": ">=15",
37
41
  "react": "19.0.3",
38
42
  "typescript": "^5.7.2"
39
- },
40
- "scripts": {
41
- "typecheck": "tsc --noEmit",
42
- "lint": "tsc --noEmit"
43
43
  }
44
- }
44
+ }
@@ -6,6 +6,7 @@ import { usePathname, useRouter } from "next/navigation"
6
6
  import type { HttpTypes } from "@medusajs/types"
7
7
  import { addToCart } from "@pradip1995/commerce-core/client/actions/cart"
8
8
  import LocalizedLink from "@pradip1995/segment-primitives/localized-link"
9
+ import { presentOrderLines } from "@pradip1995/segment-primitives/order-lines"
9
10
  import {
10
11
  cancelOrderAction,
11
12
  downloadInvoiceAction,
@@ -99,7 +100,7 @@ export default function OrderActions({ order }: { order: HttpTypes.StoreOrder })
99
100
  const router = useRouter()
100
101
  const pathname = usePathname() || ""
101
102
  const countryCode = pathname.split("/").filter(Boolean)[0] || "in"
102
- const items = (order.items || []) as LineItem[]
103
+ const items = presentOrderLines(order).purchasedItems as LineItem[]
103
104
  const activeReturns = getActiveReturns(order)
104
105
  const hasOpenReturn = activeReturns.length > 0
105
106
  const showCancel = canCancelOrder(order)
@@ -4,6 +4,7 @@ import Image from "next/image"
4
4
  import { motion } from "framer-motion"
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
  import type { HttpTypes } from "@medusajs/types"
8
9
  import OrderActions from "./order-actions"
9
10
  import OrderTracking from "./order-tracking"
@@ -32,7 +33,8 @@ export default function OrderDetailsView({
32
33
  isLoggedIn: boolean
33
34
  }) {
34
35
  const currency = order.currency_code || "inr"
35
- const items = order.items || []
36
+ const presentation = presentOrderLines(order)
37
+ const items = presentation.purchasedItems
36
38
  const shipping = order.shipping_address
37
39
  const status = pretty(order.status)
38
40
  const fulfillment = pretty(order.fulfillment_status)
@@ -216,15 +218,15 @@ export default function OrderDetailsView({
216
218
  <dl className="anim-order__summary">
217
219
  <div>
218
220
  <dt>Subtotal</dt>
219
- <dd>{formatPrice(order.subtotal, currency)}</dd>
221
+ <dd>{formatPrice(presentation.paidSubtotal, currency)}</dd>
220
222
  </div>
221
223
  <div>
222
224
  <dt>Shipping</dt>
223
225
  <dd>{formatPrice(order.shipping_total, currency)}</dd>
224
226
  </div>
225
227
  <div className="anim-order__summary-total">
226
- <dt>Total</dt>
227
- <dd>{formatPrice(order.total, currency)}</dd>
228
+ <dt>Paid total</dt>
229
+ <dd>{formatPrice(presentation.paidTotal, currency)}</dd>
228
230
  </div>
229
231
  </dl>
230
232
  </div>