@odynn/awayz-core 0.9.3 → 0.9.5
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.
|
@@ -2,18 +2,18 @@ import { jsxs as p } from "react/jsx-runtime";
|
|
|
2
2
|
import { useQuery as m } from "@tanstack/react-query";
|
|
3
3
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
4
4
|
import { E as u } from "../../noRetryInstance-oiHCni_Z.js";
|
|
5
|
-
import { useMemo as
|
|
6
|
-
import { useAwayzContext as
|
|
5
|
+
import { useMemo as y } from "react";
|
|
6
|
+
import { useAwayzContext as f } from "../../hooks/useAwayzContext.js";
|
|
7
7
|
import "react-i18next";
|
|
8
8
|
import '../../assets/_styles3.css';import '../../assets/_styles4.css';import '../../assets/_styles.css';import '../../assets/_styles2.css';/* empty css */
|
|
9
9
|
import "../../_styles.flight-booking-DEUJthTJ.js";
|
|
10
10
|
/* empty css */
|
|
11
|
-
import { CurrencyService as
|
|
11
|
+
import { CurrencyService as C } from "../../services/currency/CurrencyService.js";
|
|
12
12
|
/* empty css */
|
|
13
13
|
/* empty css */
|
|
14
14
|
import "../../configs/awayzClient.js";
|
|
15
15
|
import "../../context/AwayzContext.js";
|
|
16
|
-
import { useFeatureFlags as
|
|
16
|
+
import { useFeatureFlags as l } from "../../hooks/useFeatureFlags.js";
|
|
17
17
|
import { useWallet as d } from "../../hooks/useWallet/useWallet.js";
|
|
18
18
|
function g(t) {
|
|
19
19
|
if (!t || isNaN(t) || t < 0) return "N/A";
|
|
@@ -27,19 +27,19 @@ const v = (t, e) => {
|
|
|
27
27
|
cashAmount: t,
|
|
28
28
|
currency: e
|
|
29
29
|
}) => {
|
|
30
|
-
const { pointsAsCash: r } = d(), { user: o } =
|
|
30
|
+
const { pointsAsCash: r } = d(), { user: o } = f(), { featureFlags: i } = l(), n = y(
|
|
31
31
|
() => v(i.defaultCurrencyFeature, o),
|
|
32
32
|
[o]
|
|
33
33
|
), { data: c } = m({
|
|
34
34
|
queryKey: [u.CONVERT_CURRENCY, e, r.currency],
|
|
35
|
-
queryFn: () =>
|
|
35
|
+
queryFn: () => C.convertCurrency({
|
|
36
36
|
baseCurrency: e,
|
|
37
37
|
targetCurrency: r.currency
|
|
38
38
|
}),
|
|
39
39
|
staleTime: 1e3 * 60 * 60,
|
|
40
40
|
// 1 hour
|
|
41
41
|
enabled: !!e && !!n && e !== n && r.currency !== e && !!r.currency
|
|
42
|
-
}), s = t * (c ?? 1), a = Math.
|
|
42
|
+
}), s = t * (c ?? 1), a = Math.round(s / r.valuePerPoint);
|
|
43
43
|
return /* @__PURE__ */ p("p", { className: "client-points-amount", children: [
|
|
44
44
|
g(a),
|
|
45
45
|
" pts."
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@odynn/awayz-core",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
7
7
|
],
|
|
8
8
|
"main": "dist/main.js",
|
|
9
|
-
"types": "./dist/main.d.ts",
|
|
9
|
+
"types": "./dist/lib/main.d.ts",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"test": "echo \"NOTE: Please run tests from the root\"",
|
|
12
12
|
"build": "tsc -b && vite build",
|