@blocklet/payment-react 1.13.141 → 1.13.143

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.
@@ -68,7 +68,7 @@ export default function PricingTable({ table, alignItems, interval, mode, onSele
68
68
  width: 90% !important;
69
69
  }
70
70
  }
71
- @media (min-width: ${({ theme }) => theme.breakpoints.values.lg}px) {
71
+ @media (min-width: ${({ theme }) => theme.breakpoints.values.md}px) {
72
72
  .price-table-wrap:has(> div:nth-child(2)) {
73
73
  width: 300px !important;
74
74
  }
@@ -3,11 +3,10 @@ import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
3
3
  import { Box, Button, CircularProgress, Stack, Typography } from "@mui/material";
4
4
  import { fromUnitToToken } from "@ocap/util";
5
5
  import { useInfiniteScroll } from "ahooks";
6
- import { joinURL } from "ufo";
7
6
  import api from "../../api.js";
8
7
  import TxLink from "../../components/blockchain/tx.js";
9
8
  import Status from "../../components/status.js";
10
- import { formatToDate, getPaymentIntentStatusColor, getPrefix } from "../../util.js";
9
+ import { formatToDate, getPaymentIntentStatusColor } from "../../util.js";
11
10
  const groupByDate = (items) => {
12
11
  const grouped = {};
13
12
  items.forEach((item) => {
@@ -64,7 +63,6 @@ export default function CustomerPaymentList({ customer_id }) {
64
63
  },
65
64
  flexWrap: "nowrap",
66
65
  children: [
67
- /* @__PURE__ */ jsx(Box, { flex: 3, children: /* @__PURE__ */ jsx("a", { href: joinURL(window.location.origin, getPrefix(), `/customer/payment/${item.id}`), children: /* @__PURE__ */ jsx(Typography, { children: item.id }) }) }),
68
66
  /* @__PURE__ */ jsx(Box, { flex: 3, children: /* @__PURE__ */ jsx(Typography, { children: formatToDate(item.created_at) }) }),
69
67
  /* @__PURE__ */ jsx(Box, { flex: 2, children: /* @__PURE__ */ jsxs(Typography, { textAlign: "right", children: [
70
68
  fromUnitToToken(item.amount, item.paymentCurrency.decimal),
package/es/util.js CHANGED
@@ -418,7 +418,7 @@ export function sleep(ms) {
418
418
  });
419
419
  }
420
420
  export function formatSubscriptionProduct(items, maxLength = 2) {
421
- const names = items.map((x) => x.price.product?.name).filter(Boolean);
421
+ const names = items.map((x) => x.price?.product?.name).filter(Boolean);
422
422
  return names.slice(0, maxLength).join(", ") + (names.length > maxLength ? ` and ${names.length - maxLength} more` : "");
423
423
  }
424
424
  export const getSubscriptionTimeSummary = (subscription) => {
@@ -91,7 +91,7 @@ function PricingTable({
91
91
  }
92
92
  @media (min-width: ${({
93
93
  theme
94
- }) => theme.breakpoints.values.lg}px) {
94
+ }) => theme.breakpoints.values.md}px) {
95
95
  .price-table-wrap:has(> div:nth-child(2)) {
96
96
  width: 300px !important;
97
97
  }
@@ -9,7 +9,6 @@ var _context = require("@arcblock/ux/lib/Locale/context");
9
9
  var _material = require("@mui/material");
10
10
  var _util = require("@ocap/util");
11
11
  var _ahooks = require("ahooks");
12
- var _ufo = require("ufo");
13
12
  var _api = _interopRequireDefault(require("../../api"));
14
13
  var _tx = _interopRequireDefault(require("../../components/blockchain/tx"));
15
14
  var _status = _interopRequireDefault(require("../../components/status"));
@@ -96,14 +95,6 @@ function CustomerPaymentList({
96
95
  },
97
96
  flexWrap: "nowrap",
98
97
  children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
99
- flex: 3,
100
- children: /* @__PURE__ */(0, _jsxRuntime.jsx)("a", {
101
- href: (0, _ufo.joinURL)(window.location.origin, (0, _util2.getPrefix)(), `/customer/payment/${item.id}`),
102
- children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
103
- children: item.id
104
- })
105
- })
106
- }), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
107
98
  flex: 3,
108
99
  children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
109
100
  children: (0, _util2.formatToDate)(item.created_at)
package/lib/util.js CHANGED
@@ -503,7 +503,7 @@ function sleep(ms) {
503
503
  });
504
504
  }
505
505
  function formatSubscriptionProduct(items, maxLength = 2) {
506
- const names = items.map(x => x.price.product?.name).filter(Boolean);
506
+ const names = items.map(x => x.price?.product?.name).filter(Boolean);
507
507
  return names.slice(0, maxLength).join(", ") + (names.length > maxLength ? ` and ${names.length - maxLength} more` : "");
508
508
  }
509
509
  const getSubscriptionTimeSummary = subscription => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/payment-react",
3
- "version": "1.13.141",
3
+ "version": "1.13.143",
4
4
  "description": "Reusable react components for payment kit v2",
5
5
  "keywords": [
6
6
  "react",
@@ -89,7 +89,7 @@
89
89
  "@babel/core": "^7.23.9",
90
90
  "@babel/preset-env": "^7.23.9",
91
91
  "@babel/preset-react": "^7.23.3",
92
- "@blocklet/payment-types": "1.13.141",
92
+ "@blocklet/payment-types": "1.13.143",
93
93
  "@storybook/addon-essentials": "^7.6.13",
94
94
  "@storybook/addon-interactions": "^7.6.13",
95
95
  "@storybook/addon-links": "^7.6.13",
@@ -118,5 +118,5 @@
118
118
  "vite-plugin-babel": "^1.2.0",
119
119
  "vite-plugin-node-polyfills": "^0.19.0"
120
120
  },
121
- "gitHead": "1ba6793cbc8e55e7164997697058bff996a53b05"
121
+ "gitHead": "7eca8fb8eda6bd07cddb0f916602a35d4f7b39a3"
122
122
  }
@@ -90,7 +90,7 @@ export default function PricingTable({ table, alignItems, interval, mode, onSele
90
90
  width: 90% !important;
91
91
  }
92
92
  }
93
- @media (min-width: ${({ theme }) => theme.breakpoints.values.lg}px) {
93
+ @media (min-width: ${({ theme }) => theme.breakpoints.values.md}px) {
94
94
  .price-table-wrap:has(> div:nth-child(2)) {
95
95
  width: 300px !important;
96
96
  }
@@ -4,12 +4,11 @@ import type { Paginated, TPaymentIntentExpanded } from '@blocklet/payment-types'
4
4
  import { Box, Button, CircularProgress, Stack, Typography } from '@mui/material';
5
5
  import { fromUnitToToken } from '@ocap/util';
6
6
  import { useInfiniteScroll } from 'ahooks';
7
- import { joinURL } from 'ufo';
8
7
 
9
8
  import api from '../../api';
10
9
  import TxLink from '../../components/blockchain/tx';
11
10
  import Status from '../../components/status';
12
- import { formatToDate, getPaymentIntentStatusColor, getPrefix } from '../../util';
11
+ import { formatToDate, getPaymentIntentStatusColor } from '../../util';
13
12
 
14
13
  const groupByDate = (items: TPaymentIntentExpanded[]) => {
15
14
  const grouped: { [key: string]: TPaymentIntentExpanded[] } = {};
@@ -81,11 +80,6 @@ export default function CustomerPaymentList({ customer_id }: Props) {
81
80
  md: 3,
82
81
  }}
83
82
  flexWrap="nowrap">
84
- <Box flex={3}>
85
- <a href={joinURL(window.location.origin, getPrefix(), `/customer/payment/${item.id}`)}>
86
- <Typography>{item.id}</Typography>
87
- </a>
88
- </Box>
89
83
  <Box flex={3}>
90
84
  <Typography>{formatToDate(item.created_at)}</Typography>
91
85
  </Box>
package/src/util.ts CHANGED
@@ -569,7 +569,7 @@ export function sleep(ms: number) {
569
569
  }
570
570
 
571
571
  export function formatSubscriptionProduct(items: TSubscriptionItemExpanded[], maxLength = 2) {
572
- const names = items.map((x) => x.price.product?.name).filter(Boolean);
572
+ const names = items.map((x) => x.price?.product?.name).filter(Boolean);
573
573
  return (
574
574
  names.slice(0, maxLength).join(', ') + (names.length > maxLength ? ` and ${names.length - maxLength} more` : '')
575
575
  );