@pradip1995/segment-login-template 0.5.13 → 0.5.15
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-login-template",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.15",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -23,6 +23,11 @@
|
|
|
23
23
|
"./google-auth-section": "./src/google-auth-section.tsx",
|
|
24
24
|
"./otp-input": "./src/otp-input.tsx"
|
|
25
25
|
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"typecheck": "tsc --noEmit",
|
|
28
|
+
"lint": "tsc --noEmit",
|
|
29
|
+
"test": "node --experimental-strip-types --test src/*.test.ts"
|
|
30
|
+
},
|
|
26
31
|
"peerDependencies": {
|
|
27
32
|
"@pradip1995/commerce-auth": "^4.0.0",
|
|
28
33
|
"@pradip1995/commerce-core": "^4.0.0",
|
|
@@ -34,7 +39,7 @@
|
|
|
34
39
|
"dependencies": {
|
|
35
40
|
"@pradip1995/commerce-auth": "^4.0.0",
|
|
36
41
|
"@pradip1995/commerce-core": "^4.0.0",
|
|
37
|
-
"@pradip1995/segment-primitives": "^0.4.
|
|
42
|
+
"@pradip1995/segment-primitives": "^0.4.11",
|
|
38
43
|
"@pradip1995/segment-tokens": "^0.3.7"
|
|
39
44
|
},
|
|
40
45
|
"devDependencies": {
|
|
@@ -42,10 +47,5 @@
|
|
|
42
47
|
"@types/react": "^19",
|
|
43
48
|
"react": "19.0.3",
|
|
44
49
|
"typescript": "^5.7.2"
|
|
45
|
-
},
|
|
46
|
-
"scripts": {
|
|
47
|
-
"typecheck": "tsc --noEmit",
|
|
48
|
-
"lint": "tsc --noEmit",
|
|
49
|
-
"test": "node --experimental-strip-types --test src/*.test.ts"
|
|
50
50
|
}
|
|
51
|
-
}
|
|
51
|
+
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import type { HttpTypes } from "@medusajs/types"
|
|
4
4
|
import LocalizedLink from "@pradip1995/segment-primitives/localized-link"
|
|
5
5
|
import { formatPrice } from "@pradip1995/segment-primitives/format-price"
|
|
6
|
+
import { presentOrderLines } from "@pradip1995/segment-primitives/order-lines"
|
|
6
7
|
import { logoutGuest } from "@pradip1995/commerce-core/data/guest"
|
|
7
8
|
import { acct } from "./account-theme"
|
|
8
9
|
|
|
@@ -83,7 +84,10 @@ export default function AccountGuestOrders({
|
|
|
83
84
|
</p>
|
|
84
85
|
</div>
|
|
85
86
|
<p className="text-sm font-semibold text-brand-accent shrink-0">
|
|
86
|
-
{formatPrice(
|
|
87
|
+
{formatPrice(
|
|
88
|
+
presentOrderLines(order).paidTotal,
|
|
89
|
+
order.currency_code
|
|
90
|
+
)}
|
|
87
91
|
</p>
|
|
88
92
|
</LocalizedLink>
|
|
89
93
|
</li>
|
package/src/account-orders.tsx
CHANGED
|
@@ -6,6 +6,7 @@ import type { HttpTypes } from "@medusajs/types"
|
|
|
6
6
|
import { addToCart } from "@pradip1995/commerce-core/client/actions/cart"
|
|
7
7
|
import LocalizedLink from "@pradip1995/segment-primitives/localized-link"
|
|
8
8
|
import { formatPrice } from "@pradip1995/segment-primitives/format-price"
|
|
9
|
+
import { presentOrderLines } from "@pradip1995/segment-primitives/order-lines"
|
|
9
10
|
import { acct } from "./account-theme"
|
|
10
11
|
|
|
11
12
|
function isCancelled(order: HttpTypes.StoreOrder) {
|
|
@@ -76,7 +77,8 @@ export default function AccountOrders({
|
|
|
76
77
|
if (!canReorder(order) || reorderingId) return
|
|
77
78
|
setReorderingId(order.id)
|
|
78
79
|
try {
|
|
79
|
-
|
|
80
|
+
const reorderItems = presentOrderLines(order).reorderItems
|
|
81
|
+
for (const item of reorderItems) {
|
|
80
82
|
if (!item.variant_id) continue
|
|
81
83
|
await addToCart({
|
|
82
84
|
variantId: item.variant_id,
|
|
@@ -125,6 +127,7 @@ export default function AccountOrders({
|
|
|
125
127
|
{filtered.map((order) => {
|
|
126
128
|
const label = statusLabel(order)
|
|
127
129
|
const showReorder = canReorder(order)
|
|
130
|
+
const presentation = presentOrderLines(order)
|
|
128
131
|
return (
|
|
129
132
|
<li key={order.id}>
|
|
130
133
|
<div
|
|
@@ -148,11 +151,11 @@ export default function AccountOrders({
|
|
|
148
151
|
dateStyle: "medium",
|
|
149
152
|
})}
|
|
150
153
|
{" · "}
|
|
151
|
-
{
|
|
152
|
-
{
|
|
154
|
+
{presentation.purchasedItems.length} item
|
|
155
|
+
{presentation.purchasedItems.length === 1 ? "" : "s"}
|
|
153
156
|
</p>
|
|
154
157
|
<p className={`text-base font-bold ${acct.accent}`}>
|
|
155
|
-
{formatPrice(
|
|
158
|
+
{formatPrice(presentation.paidTotal, order.currency_code)}
|
|
156
159
|
</p>
|
|
157
160
|
</LocalizedLink>
|
|
158
161
|
{showReorder ? (
|