@lookiero/checkout 0.8.3-beta.3 → 0.8.3-beta.4

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.
@@ -1,5 +1,6 @@
1
1
  import { Notification } from "@lookiero/aurora-next/build/components/molecules/Notification/Notification";
2
2
  import { useStack } from "@lookiero/aurora-next/build/contexts/Stack/Stack";
3
+ import { useIntl } from "@lookiero/i18n-react";
3
4
  import { useCallback } from "react";
4
5
  import { StyleSheet } from "react-native";
5
6
  import { v4 as uuid } from "uuid";
@@ -31,12 +32,14 @@ const iOSInAppBrowser = window.screen.height > 667 && /FBIOS/.test(navigator.use
31
32
  const getNotificationDefaults = () => (iOSInAppBrowser ? IN_APP_NOTIFICATION_DEFAULTS : NOTIFICATION_DEFAULTS);
32
33
  const useToast = () => {
33
34
  const Stack = useStack();
35
+ const intl = useIntl();
36
+ const translate = useCallback((message) => intl.formatMessage({ id: message, defaultMessage: message }), [intl]);
34
37
  const showError = useCallback(({ message }) => {
35
- Stack.alert(uuid(), Notification, { ...getNotificationDefaults(), text: message });
36
- }, [Stack]);
38
+ Stack.alert(uuid(), Notification, { ...getNotificationDefaults(), text: translate(message) });
39
+ }, [Stack, translate]);
37
40
  const showSuccess = useCallback(({ message }) => {
38
- Stack.success(uuid(), Notification, { ...getNotificationDefaults(), text: message });
39
- }, [Stack]);
41
+ Stack.success(uuid(), Notification, { ...getNotificationDefaults(), text: translate(message) });
42
+ }, [Stack, translate]);
40
43
  return {
41
44
  showError,
42
45
  showSuccess,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "0.8.3-beta.3",
3
+ "version": "0.8.3-beta.4",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [