@orderly.network/affiliate 3.0.1-alpha.0 → 3.0.2-alpha.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/dist/index.js CHANGED
@@ -523,7 +523,7 @@ var useReferralCodeFormScript = (options) => {
523
523
  const onEdit = async () => {
524
524
  const editReferralCodeParams = {
525
525
  current_referral_code: referralCode,
526
- new_referral_code: newCode
526
+ new_referral_code: newCode.toUpperCase().replace(/[^A-Z0-9]/g, "")
527
527
  };
528
528
  const updateRebateRateParams = {
529
529
  referee_rebate_rate: new utils.Decimal(refereeRebatePercentage).div(100).toNumber(),
@@ -946,7 +946,7 @@ var RebateRateSlider = (props) => {
946
946
  /* @__PURE__ */ jsxRuntime.jsx(
947
947
  ui.Text,
948
948
  {
949
- size: "base",
949
+ size: "sm",
950
950
  intensity: 54,
951
951
  as: "span",
952
952
  className: "oui-inline-flex oui-items-center oui-gap-1 oui-tracking-[0.03em]",
@@ -4327,7 +4327,7 @@ var UnPinIcon = (props) => {
4327
4327
  );
4328
4328
  };
4329
4329
  var ReferralCodes = (props) => {
4330
- const isTablet = hooks.useMediaQuery("(max-width: 767px)");
4330
+ const { isMobile } = ui.useScreen();
4331
4331
  return /* @__PURE__ */ jsxRuntime.jsxs(
4332
4332
  ui.Flex,
4333
4333
  {
@@ -4341,7 +4341,7 @@ var ReferralCodes = (props) => {
4341
4341
  /* @__PURE__ */ jsxRuntime.jsx(Title4, { ...props }),
4342
4342
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "oui-flex oui-w-full oui-flex-col 2xl:oui-h-full", children: [
4343
4343
  /* @__PURE__ */ jsxRuntime.jsx(ui.Divider, {}),
4344
- isTablet ? /* @__PURE__ */ jsxRuntime.jsx(MobileLayout, { ...props }) : /* @__PURE__ */ jsxRuntime.jsx(DesktopLayout, { ...props })
4344
+ isMobile ? /* @__PURE__ */ jsxRuntime.jsx(MobileLayout, { ...props }) : /* @__PURE__ */ jsxRuntime.jsx(DesktopLayout, { ...props })
4345
4345
  ] })
4346
4346
  ]
4347
4347
  }
@@ -4530,7 +4530,7 @@ var MobileCell2 = (props) => {
4530
4530
  };
4531
4531
  var DesktopLayout = (props) => {
4532
4532
  const { t } = i18n.useTranslation();
4533
- const moreColumn = hooks.useMediaQuery("(min-width: 1024px)");
4533
+ const { isDesktop: moreColumn } = ui.useScreen();
4534
4534
  const columns = react.useMemo(() => {
4535
4535
  const cols = [
4536
4536
  {
@@ -5071,7 +5071,7 @@ var MobileCellItem2 = (props) => {
5071
5071
  };
5072
5072
  var CommissionList = (props) => {
5073
5073
  const { t } = i18n.useTranslation();
5074
- const isLG = hooks.useMediaQuery("(max-width: 767px)");
5074
+ const { isMobile } = ui.useScreen();
5075
5075
  const columns = react.useMemo(() => {
5076
5076
  const cols = [
5077
5077
  {
@@ -5112,7 +5112,7 @@ var CommissionList = (props) => {
5112
5112
  return cols;
5113
5113
  }, [t]);
5114
5114
  const body = react.useMemo(() => {
5115
- if (isLG) {
5115
+ if (isMobile) {
5116
5116
  return /* @__PURE__ */ jsxRuntime.jsx(
5117
5117
  ui.ListView,
5118
5118
  {
@@ -5187,7 +5187,7 @@ var CommissionList = (props) => {
5187
5187
  }
5188
5188
  }
5189
5189
  );
5190
- }, [isLG, props.commission]);
5190
+ }, [isMobile, props.commission]);
5191
5191
  return /* @__PURE__ */ jsxRuntime.jsxs(
5192
5192
  ui.Flex,
5193
5193
  {
@@ -5210,7 +5210,7 @@ var CommissionList = (props) => {
5210
5210
  };
5211
5211
  var RefereesList = (props) => {
5212
5212
  const { t } = i18n.useTranslation();
5213
- const isLG = hooks.useMediaQuery("(max-width: 767px)");
5213
+ const { isMobile } = ui.useScreen();
5214
5214
  const columns = react.useMemo(() => {
5215
5215
  const cols = [
5216
5216
  {
@@ -5254,7 +5254,7 @@ var RefereesList = (props) => {
5254
5254
  return cols;
5255
5255
  }, [t]);
5256
5256
  const body = react.useMemo(() => {
5257
- if (isLG) {
5257
+ if (isMobile) {
5258
5258
  return /* @__PURE__ */ jsxRuntime.jsx(
5259
5259
  ui.ListView,
5260
5260
  {
@@ -5349,7 +5349,7 @@ var RefereesList = (props) => {
5349
5349
  }
5350
5350
  }
5351
5351
  );
5352
- }, [isLG, props.referees]);
5352
+ }, [isMobile, props.referees]);
5353
5353
  return /* @__PURE__ */ jsxRuntime.jsx(
5354
5354
  ui.Flex,
5355
5355
  {
@@ -5392,13 +5392,13 @@ var useCommissionDataScript = () => {
5392
5392
  to: dateFns.subDays(/* @__PURE__ */ new Date(), 1)
5393
5393
  }
5394
5394
  );
5395
- const isLG = hooks.useMediaQuery("(max-width: 767px)");
5395
+ const { isMobile } = ui.useScreen();
5396
5396
  const { page, pageSize, setPage, parsePagination } = ui.usePagination();
5397
5397
  const [commissionData, { refresh, isLoading, loadMore, meta }] = hooks.useReferralRebateSummary({
5398
5398
  startDate: commissionRange?.from !== void 0 ? dateFns.format(commissionRange.from, "yyyy-MM-dd") : void 0,
5399
5399
  endDate: commissionRange?.to !== void 0 ? dateFns.format(commissionRange.to, "yyyy-MM-dd") : void 0,
5400
5400
  size: pageSize,
5401
- page: !isLG ? page : void 0
5401
+ page: !isMobile ? page : void 0
5402
5402
  });
5403
5403
  react.useEffect(() => {
5404
5404
  refresh();
@@ -5426,13 +5426,13 @@ var useRefereesDataScript = () => {
5426
5426
  to: dateFns.subDays(/* @__PURE__ */ new Date(), 1)
5427
5427
  }
5428
5428
  );
5429
- const isLG = hooks.useMediaQuery("(max-width: 767px)");
5429
+ const { isMobile } = ui.useScreen();
5430
5430
  const { page, pageSize, setPage, parsePagination } = ui.usePagination();
5431
5431
  const [commissionData, { refresh, isLoading, loadMore, meta }] = hooks.useRefereeInfo({
5432
5432
  startDate: commissionRange?.from !== void 0 ? dateFns.format(commissionRange.from, "yyyy-MM-dd") : void 0,
5433
5433
  endDate: commissionRange?.to !== void 0 ? dateFns.format(commissionRange.to, "yyyy-MM-dd") : void 0,
5434
5434
  size: pageSize,
5435
- page: !isLG ? page : void 0,
5435
+ page: !isMobile ? page : void 0,
5436
5436
  sort: "descending_code_binding_time"
5437
5437
  });
5438
5438
  react.useEffect(() => {
@@ -5549,7 +5549,7 @@ var BecomeAffiliate = (props) => {
5549
5549
  width: "100%",
5550
5550
  children: [
5551
5551
  /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { children: t("affiliate.process.title") }),
5552
- /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { className: "oui-flex oui-flex-col oui-gap-3 lg:oui-w-full lg:oui-flex-row lg:oui-items-stretch", children: [
5552
+ /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { className: "oui-flex oui-flex-col oui-gap-3 xl:oui-w-full xl:oui-flex-row xl:oui-items-stretch", children: [
5553
5553
  /* @__PURE__ */ jsxRuntime.jsx(
5554
5554
  Item,
5555
5555
  {
@@ -5558,7 +5558,7 @@ var BecomeAffiliate = (props) => {
5558
5558
  content: applyText.desc
5559
5559
  }
5560
5560
  ),
5561
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "oui-shrink lg:oui-flex lg:-oui-rotate-90 lg:oui-flex-row lg:oui-items-center lg:oui-justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(ArrowDownIcon, {}) }),
5561
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "oui-shrink xl:oui-flex xl:-oui-rotate-90 xl:oui-flex-row xl:oui-items-center xl:oui-justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(ArrowDownIcon, {}) }),
5562
5562
  /* @__PURE__ */ jsxRuntime.jsx(
5563
5563
  Item,
5564
5564
  {
@@ -5567,7 +5567,7 @@ var BecomeAffiliate = (props) => {
5567
5567
  content: t("affiliate.process.step2.description")
5568
5568
  }
5569
5569
  ),
5570
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "oui-shrink lg:oui-flex lg:-oui-rotate-90 lg:oui-flex-row lg:oui-items-center lg:oui-justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(ArrowDownIcon, {}) }),
5570
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "oui-shrink xl:oui-flex xl:-oui-rotate-90 xl:oui-flex-row xl:oui-items-center xl:oui-justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(ArrowDownIcon, {}) }),
5571
5571
  /* @__PURE__ */ jsxRuntime.jsx(
5572
5572
  Item,
5573
5573
  {
@@ -5587,7 +5587,7 @@ var Item = (props) => {
5587
5587
  {
5588
5588
  className: ui.cn(
5589
5589
  "oui-flex oui-flex-row oui-gap-3",
5590
- "lg:oui-flex-1 lg:oui-flex-col lg:oui-gap-[6px]"
5590
+ "xl:oui-flex-1 xl:oui-flex-col xl:oui-gap-[6px]"
5591
5591
  ),
5592
5592
  width: "100%",
5593
5593
  children: [
@@ -5598,11 +5598,11 @@ var Item = (props) => {
5598
5598
  className: ui.cn(
5599
5599
  "oui-flex oui-flex-col oui-items-start oui-h-full oui-justify-between",
5600
5600
  // lg
5601
- "lg:oui-items-center lg:oui-justify-start"
5601
+ "xl:oui-items-center xl:oui-justify-start"
5602
5602
  ),
5603
5603
  children: [
5604
- /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { className: "oui-text-sm md:oui-text-base 2xl:oui-text-lg lg:oui-text-center", children: props.title }),
5605
- /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { className: "oui-text-2xs oui-text-base-contrast-36 lg:oui-text-center", children: props.content })
5604
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { className: "oui-text-sm md:oui-text-base 2xl:oui-text-lg xl:oui-text-center", children: props.title }),
5605
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { className: "oui-text-2xs oui-text-base-contrast-36 xl:oui-text-center", children: props.content })
5606
5606
  ]
5607
5607
  }
5608
5608
  )
@@ -5619,7 +5619,7 @@ var ApplyIcon = () => {
5619
5619
  viewBox: "0 0 48 48",
5620
5620
  fill: "none",
5621
5621
  xmlns: "http://www.w3.org/2000/svg",
5622
- className: "lg:oui-w-[64px] lg:oui-h-[64px] 2xl:oui-w-[80px] 2xl:oui-h-[80px]",
5622
+ className: "xl:oui-w-[64px] xl:oui-h-[64px] 2xl:oui-w-[80px] 2xl:oui-h-[80px]",
5623
5623
  children: [
5624
5624
  /* @__PURE__ */ jsxRuntime.jsx(
5625
5625
  "path",
@@ -5687,7 +5687,7 @@ var ShareIcon = () => {
5687
5687
  viewBox: "0 0 48 48",
5688
5688
  fill: "none",
5689
5689
  xmlns: "http://www.w3.org/2000/svg",
5690
- className: "lg:oui-w-[64px] lg:oui-h-[64px] 2xl:oui-w-[80px] 2xl:oui-h-[80px]",
5690
+ className: "xl:oui-w-[64px] xl:oui-h-[64px] 2xl:oui-w-[80px] 2xl:oui-h-[80px]",
5691
5691
  children: [
5692
5692
  /* @__PURE__ */ jsxRuntime.jsx(
5693
5693
  "path",
@@ -5729,7 +5729,7 @@ var EarnIcon = () => {
5729
5729
  viewBox: "0 0 48 48",
5730
5730
  fill: "none",
5731
5731
  xmlns: "http://www.w3.org/2000/svg",
5732
- className: "lg:oui-w-[64px] lg:oui-h-[64px] 2xl:oui-w-[80px] 2xl:oui-h-[80px]",
5732
+ className: "xl:oui-w-[64px] xl:oui-h-[64px] 2xl:oui-w-[80px] 2xl:oui-h-[80px]",
5733
5733
  children: [
5734
5734
  /* @__PURE__ */ jsxRuntime.jsx(
5735
5735
  "path",
@@ -6835,7 +6835,7 @@ var Title8 = (props) => {
6835
6835
  };
6836
6836
  var List = (props) => {
6837
6837
  const { t } = i18n.useTranslation();
6838
- const layout767 = hooks.useMediaQuery("(max-width: 767px)");
6838
+ const { isMobile } = ui.useScreen();
6839
6839
  const columns = [
6840
6840
  {
6841
6841
  title: `${t("affiliate.trader.rebates")} (USDC)`,
@@ -6866,7 +6866,7 @@ var List = (props) => {
6866
6866
  width: 127
6867
6867
  }
6868
6868
  ];
6869
- if (layout767) {
6869
+ if (isMobile) {
6870
6870
  return /* @__PURE__ */ jsxRuntime.jsx(
6871
6871
  ui.ListView,
6872
6872
  {