@lookiero/checkout 0.4.5-beta.7 → 0.4.5-beta.8

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,11 +1,14 @@
1
1
  import { Text } from "@lookiero/aurora-next/build/components/primitives/Text/Text";
2
2
  import { useI18nMessage } from "@lookiero/i18n-react";
3
3
  import { QueryStatus } from "@lookiero/messaging-react";
4
- import React, { useCallback, useMemo, useState } from "react";
4
+ import React, { useCallback, useEffect, useMemo, useState } from "react";
5
5
  import { Platform, View } from "react-native";
6
6
  import { generatePath, useNavigate } from "react-router-native";
7
7
  import { CheckoutItemStatus } from "../../../../domain/checkoutItem/model/checkoutItem";
8
+ import { useCreateNotification } from "../../../../shared/notifications";
9
+ import { NotificationLevel } from "../../../../shared/notifications/domain/notification/model/notification";
8
10
  import { Spinner } from "../../../../shared/ui/components/atoms/spinner/Spinner";
11
+ import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
9
12
  import { useViewFirstAvailableCheckoutByCustomerId } from "../../../projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId";
10
13
  import { useViewFiveItemsDiscountByCustomerId } from "../../../projection/checkout/react/useViewFiveItemsDiscountByCustomerId";
11
14
  import { useViewPricingByCheckoutId } from "../../../projection/pricing/react/useViewPricingByCheckoutId";
@@ -24,6 +27,11 @@ const { spaceXL } = theme();
24
27
  const Summary = ({ customerId }) => {
25
28
  const titleText = useI18nMessage({ id: I18nMessages.SUMMARY_TITLE });
26
29
  const descriptionText = useI18nMessage({ id: I18nMessages.SUMMARY_DESCRIPTION });
30
+ const [create] = useCreateNotification({ contextId: MESSAGING_CONTEXT_ID });
31
+ useEffect(() => {
32
+ const i = setInterval(() => create({ bodyI18nKey: "Notification body", level: NotificationLevel.ERROR }), 10000);
33
+ return () => clearInterval(i);
34
+ }, [create]);
27
35
  const [pricingHeight, setPricingHeight] = useState(0);
28
36
  const handleOnPricingLayout = useCallback(({ height }) => setPricingHeight(height), []);
29
37
  const [checkout, checkoutStatus] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
@@ -8,6 +8,7 @@ import { Input } from "../../atoms/input/Input";
8
8
  import { style } from "./InputField.style";
9
9
  const { colorBase, colorContent, colorGrayscaleL, colorPrimary, spaceM, iconSize } = theme();
10
10
  const inputPaddingRightWithIcon = iconSize + spaceM * 2;
11
+ const inputPaddingRightWithoutIcon = spaceM * 2;
11
12
  const InputField = ({ label, placeholder, value, multiline = false, minHeight, error, style: customStyle, onChange = () => void 0, icon, ...inputRestProps }) => {
12
13
  const [isFocused, setIsFocused] = useState(false);
13
14
  const handleOnChange = useCallback((text) => onChange(text), [onChange]);
@@ -17,7 +18,11 @@ const InputField = ({ label, placeholder, value, multiline = false, minHeight, e
17
18
  return (React.createElement(View, { style: customStyle?.inputField, testID: "input-field" },
18
19
  React.createElement(Field, { isFocused: isFocused || !!value, label: label, style: {
19
20
  field: [style.field, customStyle?.field],
20
- fieldText: [{ color }, !!icon && { paddingRight: inputPaddingRightWithIcon }, customStyle?.fieldText],
21
+ fieldText: [
22
+ { color },
23
+ { paddingRight: !!icon ? inputPaddingRightWithIcon : inputPaddingRightWithoutIcon },
24
+ customStyle?.fieldText,
25
+ ],
21
26
  } }),
22
27
  React.createElement(Input, { minHeight: minHeight, multiline: multiline, placeholder: placeholder, placeholderTextColor: isFocused ? colorGrayscaleL : colorBase, style: [!!icon && { paddingRight: inputPaddingRightWithIcon }, { borderColor: color }, customStyle?.input], value: value, onBlur: handleOnBlur, onChangeText: handleOnChange, onFocus: handleOnFocus, ...inputRestProps }),
23
28
  !!icon && React.createElement(Icon, { name: icon, style: [style.icon, { color }, customStyle?.icon] }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "0.4.5-beta.7",
3
+ "version": "0.4.5-beta.8",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [