@lookiero/checkout 3.7.0-beta.0 → 3.7.0-beta.100
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/infrastructure/projection/checkout/checkout.js +13 -0
- package/dist/infrastructure/ui/components/layouts/layout/dummyLayout/useScrollViewRef.d.ts +15 -0
- package/dist/infrastructure/ui/components/layouts/layout/dummyLayout/useScrollViewRef.js +14 -0
- package/dist/infrastructure/ui/components/organisms/checkoutQuestions/CheckoutQuestion.js +1 -1
- package/dist/infrastructure/ui/components/organisms/checkoutQuestions/components/CheckoutQuestionItem.d.ts +0 -1
- package/dist/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.js +2 -2
- package/dist/infrastructure/ui/components/organisms/checkoutQuestions/components/iconCheckoutQuestionItem/IconCheckoutQuestionItem.js +3 -3
- package/dist/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.js +2 -2
- package/dist/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.js +1 -1
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.d.ts +0 -1
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +2 -2
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.js +2 -2
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +2 -2
- package/dist/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.js +1 -1
- package/dist/infrastructure/ui/views/item/components/itemActions/ItemActions.js +2 -2
- package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +1 -1
- package/dist/infrastructure/ui/views/summary/components/pricing/Pricing.js +2 -2
- package/dist/shared/notifications/infrastructure/ui/components/modalNotifications/ModalNotificationItem.js +1 -1
- package/dist/shared/ui/components/atoms/input/Input.js +2 -2
- package/dist/shared/ui/components/layouts/carousel/Carousel.d.ts +11 -0
- package/dist/shared/ui/components/layouts/carousel/Carousel.js +31 -0
- package/dist/shared/ui/components/layouts/carousel/Carousel.style.d.ts +17 -0
- package/dist/shared/ui/components/layouts/carousel/Carousel.style.js +7 -0
- package/dist/shared/ui/components/layouts/carousel/Carousel2.d.ts +16 -0
- package/dist/shared/ui/components/layouts/carousel/Carousel2.js +72 -0
- package/dist/shared/ui/components/layouts/carousel/DragComponent.d.ts +3 -0
- package/dist/shared/ui/components/layouts/carousel/DragComponent.js +48 -0
- package/dist/shared/ui/components/layouts/modal/Modal.js +1 -1
- package/dist/shared/ui/components/layouts/slider/SliderDots.d.ts +8 -0
- package/dist/shared/ui/components/layouts/slider/SliderDots.js +16 -0
- package/dist/shared/ui/components/layouts/slider/SliderDots.style.d.ts +12 -0
- package/dist/shared/ui/components/layouts/slider/SliderDots.style.js +15 -0
- package/dist/shared/ui/components/molecules/selectField/SelectField.js +3 -3
- package/package.json +1 -1
- package/dist/domain/checkoutBooking/event/createNotificationWhenCheckoutBookingExpired.d.ts +0 -6
- package/dist/domain/checkoutBooking/event/createNotificationWhenCheckoutBookingExpired.js +0 -13
- package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.d.ts +0 -10
- package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.js +0 -11
- package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.d.ts +0 -6
- package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.js +0 -7
- package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.d.ts +0 -6
- package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.js +0 -9
- package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.d.ts +0 -13
- package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.js +0 -19
- package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.style.ts.d.ts +0 -6
- package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.style.ts.js +0 -7
- package/dist/infrastructure/ui/components/templates/header/header/Header.d.ts +0 -3
- package/dist/infrastructure/ui/components/templates/header/header/Header.js +0 -10
- package/dist/infrastructure/ui/components/templates/header/header/Header.style.d.ts +0 -9
- package/dist/infrastructure/ui/components/templates/header/header/Header.style.js +0 -12
- package/dist/infrastructure/ui/components/templates/safeAreaScrollView/SafeAreaScrollView.d.ts +0 -13
- package/dist/infrastructure/ui/components/templates/safeAreaScrollView/SafeAreaScrollView.js +0 -19
- package/dist/infrastructure/ui/components/templates/safeAreaScrollView/SafeAreaScrollView.style.ts.d.ts +0 -6
- package/dist/infrastructure/ui/components/templates/safeAreaScrollView/SafeAreaScrollView.style.ts.js +0 -7
- package/dist/infrastructure/ui/hooks/usePaymentInstrumentUpdateEvents.d.ts +0 -2
- package/dist/infrastructure/ui/hooks/usePaymentInstrumentUpdateEvents.js +0 -28
- package/dist/infrastructure/ui/hooks/useToast.d.ts +0 -11
- package/dist/infrastructure/ui/hooks/useToast.js +0 -49
- package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.d.ts +0 -7
- package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.js +0 -25
- package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.style.d.ts +0 -16
- package/dist/infrastructure/ui/views/checkout/components/checkoutSuccessModal/CheckoutSuccessModal.style.js +0 -19
- package/dist/infrastructure/ui/views/intro/Intro.d.ts +0 -6
- package/dist/infrastructure/ui/views/intro/Intro.js +0 -52
- package/dist/infrastructure/ui/views/intro/Intro.style.d.ts +0 -52
- package/dist/infrastructure/ui/views/intro/Intro.style.js +0 -55
- package/dist/infrastructure/ui/views/item/Item.style.d.ts +0 -15
- package/dist/infrastructure/ui/views/item/Item.style.js +0 -18
- package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.d.ts +0 -26
- package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.js +0 -44
- package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.d.ts +0 -45
- package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.js +0 -53
- package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.d.ts +0 -7
- package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.js +0 -25
- package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.d.ts +0 -16
- package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.js +0 -19
- package/dist/infrastructure/ui/views/navigation/Navigation.d.ts +0 -21
- package/dist/infrastructure/ui/views/navigation/Navigation.js +0 -45
- package/dist/infrastructure/ui/views/navigation/Navigation.style.d.ts +0 -5
- package/dist/infrastructure/ui/views/navigation/Navigation.style.js +0 -30
- package/dist/infrastructure/ui/views/navigation/components/header/Header.d.ts +0 -46
- package/dist/infrastructure/ui/views/navigation/components/header/Header.js +0 -120
- package/dist/infrastructure/ui/views/navigation/components/header/Header.style.d.ts +0 -31
- package/dist/infrastructure/ui/views/navigation/components/header/Header.style.js +0 -34
- package/dist/infrastructure/ui/views/navigation/components/header/Logo.d.ts +0 -7
- package/dist/infrastructure/ui/views/navigation/components/header/Logo.js +0 -11
- package/dist/infrastructure/ui/views/navigation/components/header/Logo.style.d.ts +0 -7
- package/dist/infrastructure/ui/views/navigation/components/header/Logo.style.js +0 -8
- package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.d.ts +0 -12
- package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.js +0 -24
- package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.style.d.ts +0 -15
- package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.style.js +0 -18
- package/dist/shared/notifications/domain/notification/command/createNotification.d.ts +0 -17
- package/dist/shared/notifications/domain/notification/command/createNotification.js +0 -7
- package/dist/shared/notifications/infrastructure/domain/notification/react/useCreateNotification.d.ts +0 -21
- package/dist/shared/notifications/infrastructure/domain/notification/react/useCreateNotification.js +0 -22
- package/dist/shared/notifications/infrastructure/ui/components/NotificationItem.d.ts +0 -12
- package/dist/shared/notifications/infrastructure/ui/components/NotificationItem.js +0 -24
- package/dist/shared/notifications/infrastructure/ui/components/Notifications.d.ts +0 -9
- package/dist/shared/notifications/infrastructure/ui/components/Notifications.js +0 -20
- package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.d.ts +0 -36
- package/dist/shared/notifications/infrastructure/ui/components/Notifications.style.js +0 -31
- package/dist/shared/tracking/infrastructure/usePageView.d.ts +0 -13
- package/dist/shared/tracking/infrastructure/usePageView.js +0 -27
- package/dist/shared/ui/components/atoms/error/Error.style.d.ts +0 -6
- package/dist/shared/ui/components/atoms/error/Error.style.js +0 -9
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
const toCheckoutProjection = (checkoutDto) => ({
|
|
2
2
|
...checkoutDto,
|
|
3
|
+
items: checkoutDto.items.map((item) => ({
|
|
4
|
+
...item,
|
|
5
|
+
productVariant: {
|
|
6
|
+
...item.productVariant,
|
|
7
|
+
media: [
|
|
8
|
+
...item.productVariant.media,
|
|
9
|
+
...item.productVariant.media,
|
|
10
|
+
...item.productVariant.media,
|
|
11
|
+
...item.productVariant.media,
|
|
12
|
+
...item.productVariant.media,
|
|
13
|
+
],
|
|
14
|
+
},
|
|
15
|
+
})),
|
|
3
16
|
expiresOn: new Date(checkoutDto.expiresOn),
|
|
4
17
|
});
|
|
5
18
|
export { toCheckoutProjection };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FC, ReactNode, Ref } from "react";
|
|
2
|
+
import { GestureType, ScrollView } from "react-native-gesture-handler";
|
|
3
|
+
interface ContextShape {
|
|
4
|
+
readonly scrollViewRef: Ref<ScrollView>;
|
|
5
|
+
readonly panGestureRef: Ref<GestureType>;
|
|
6
|
+
}
|
|
7
|
+
interface ScrollViewRefContextProviderProps {
|
|
8
|
+
readonly children: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare const ScrollViewRefContextProvider: FC<ScrollViewRefContextProviderProps>;
|
|
11
|
+
interface UseScrollViewRefFunction {
|
|
12
|
+
(): ContextShape;
|
|
13
|
+
}
|
|
14
|
+
declare const useScrollViewRef: UseScrollViewRefFunction;
|
|
15
|
+
export { useScrollViewRef, ScrollViewRefContextProvider };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { createContext, useContext, useRef } from "react";
|
|
2
|
+
import invariant from "tiny-invariant";
|
|
3
|
+
const ScrollViewRefContext = createContext(null);
|
|
4
|
+
const ScrollViewRefContextProvider = ({ children }) => {
|
|
5
|
+
const scrollViewRef = useRef(null);
|
|
6
|
+
const panGestureRef = useRef(null);
|
|
7
|
+
return (React.createElement(ScrollViewRefContext.Provider, { value: { scrollViewRef, panGestureRef } }, children));
|
|
8
|
+
};
|
|
9
|
+
const useScrollViewRef = () => {
|
|
10
|
+
const ref = useContext(ScrollViewRefContext);
|
|
11
|
+
invariant(ref, "Your are trying to use the useScrollViewRef hook without wrapping your app with the <ScrollViewRefContextProvider>.");
|
|
12
|
+
return ref;
|
|
13
|
+
};
|
|
14
|
+
export { useScrollViewRef, ScrollViewRefContextProvider };
|
|
@@ -2,7 +2,7 @@ import React, { memo } from "react";
|
|
|
2
2
|
import { useCheckoutQuestionItem } from "./behaviors/useCheckoutQuestionItem";
|
|
3
3
|
const CheckoutQuestion = ({ checkoutQuestion, checkoutQuestionParentId, }) => {
|
|
4
4
|
const Item = useCheckoutQuestionItem({ type: checkoutQuestion.type });
|
|
5
|
-
return (React.createElement(Item, { checkoutQuestion: checkoutQuestion, checkoutQuestionParentId: checkoutQuestionParentId
|
|
5
|
+
return (React.createElement(Item, { checkoutQuestion: checkoutQuestion, checkoutQuestionParentId: checkoutQuestionParentId },
|
|
6
6
|
React.createElement(React.Fragment, null, checkoutQuestion.children?.map((childCheckoutQuestion) => (React.createElement(CheckoutQuestion, { key: childCheckoutQuestion.id, checkoutQuestion: childCheckoutQuestion, checkoutQuestionParentId: checkoutQuestion.id }))))));
|
|
7
7
|
};
|
|
8
8
|
export default memo(CheckoutQuestion);
|
|
@@ -5,7 +5,6 @@ interface CheckoutQuestionItemProps {
|
|
|
5
5
|
readonly checkoutQuestionParentId: string;
|
|
6
6
|
readonly children?: ReactNode;
|
|
7
7
|
readonly portalHostName?: string;
|
|
8
|
-
readonly testID: string;
|
|
9
8
|
}
|
|
10
9
|
type CheckoutQuestionItem = FC<CheckoutQuestionItemProps>;
|
|
11
10
|
export type { CheckoutQuestionItem, CheckoutQuestionItemProps };
|
|
@@ -5,10 +5,10 @@ import { theme } from "../../../../../theme/theme";
|
|
|
5
5
|
import { useCheckoutQuestionFeedbackForId } from "../../behaviors/useCheckoutQuestionFeedback";
|
|
6
6
|
import { style } from "./ButtonCheckoutQuestionItem.style";
|
|
7
7
|
const { colorAccent, colorBase } = theme();
|
|
8
|
-
const ButtonCheckoutQuestionItem = ({ checkoutQuestion, checkoutQuestionParentId,
|
|
8
|
+
const ButtonCheckoutQuestionItem = ({ checkoutQuestion, checkoutQuestionParentId, }) => {
|
|
9
9
|
const { feedback, onChange } = useCheckoutQuestionFeedbackForId({ id: checkoutQuestionParentId });
|
|
10
10
|
const optionText = useI18nMessage({ id: checkoutQuestion.name });
|
|
11
11
|
const handleOnPress = useCallback(() => onChange({ checkoutQuestionId: checkoutQuestionParentId, checkoutQuestionFeedback: checkoutQuestion.id }), [onChange, checkoutQuestion.id, checkoutQuestionParentId]);
|
|
12
|
-
return (React.createElement(Button, {
|
|
12
|
+
return (React.createElement(Button, { style: [style.button, { backgroundColor: feedback === checkoutQuestion.id ? colorAccent : colorBase }], variant: BUTTON_VARIANT.SECONDARY, onPress: handleOnPress }, optionText));
|
|
13
13
|
};
|
|
14
14
|
export { ButtonCheckoutQuestionItem };
|
|
@@ -16,12 +16,12 @@ const ICON = {
|
|
|
16
16
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
17
17
|
"checkout_question.icon.good": Happy,
|
|
18
18
|
};
|
|
19
|
-
const IconCheckoutQuestionItem = ({ checkoutQuestion, checkoutQuestionParentId,
|
|
19
|
+
const IconCheckoutQuestionItem = ({ checkoutQuestion, checkoutQuestionParentId, }) => {
|
|
20
20
|
const Icon = ICON[checkoutQuestion.name];
|
|
21
21
|
const { feedback, onChange } = useCheckoutQuestionFeedbackForId({ id: checkoutQuestionParentId });
|
|
22
22
|
const handleOnPress = useCallback(() => onChange({ checkoutQuestionId: checkoutQuestionParentId, checkoutQuestionFeedback: checkoutQuestion.id }), [onChange, checkoutQuestion.id, checkoutQuestionParentId]);
|
|
23
23
|
invariant(Icon, "CheckoutQuestion icon does not exist");
|
|
24
|
-
return (React.createElement(Pressable, {
|
|
25
|
-
React.createElement(Icon, { fill: feedback === checkoutQuestion.id ? colorAccent : "none", style: style.icon })));
|
|
24
|
+
return (React.createElement(Pressable, { onPress: handleOnPress },
|
|
25
|
+
React.createElement(Icon, { fill: feedback === checkoutQuestion.id ? colorAccent : "none", style: style.icon, testID: checkoutQuestion.name })));
|
|
26
26
|
};
|
|
27
27
|
export { IconCheckoutQuestionItem };
|
|
@@ -3,11 +3,11 @@ import React, { useCallback, useMemo } from "react";
|
|
|
3
3
|
import { InputField } from "../../../../../../../shared/ui/components/molecules/inputField/InputField";
|
|
4
4
|
import { useCheckoutQuestionFeedbackForId } from "../../behaviors/useCheckoutQuestionFeedback";
|
|
5
5
|
const TEXTAREA_MIN_HEIGHT = 96;
|
|
6
|
-
const TextareaCheckoutQuestionItem = ({ checkoutQuestion, checkoutQuestionParentId,
|
|
6
|
+
const TextareaCheckoutQuestionItem = ({ checkoutQuestion, checkoutQuestionParentId, }) => {
|
|
7
7
|
const { formatMessage } = useIntl();
|
|
8
8
|
const placeholderText = useMemo(() => (checkoutQuestion.placeholder ? formatMessage({ id: checkoutQuestion.placeholder }) : ""), [formatMessage, checkoutQuestion.placeholder]);
|
|
9
9
|
const { feedback, onChange } = useCheckoutQuestionFeedbackForId({ id: checkoutQuestionParentId });
|
|
10
10
|
const handleOnChange = useCallback((value) => onChange({ checkoutQuestionId: checkoutQuestionParentId, checkoutQuestionFeedback: value }), [onChange, checkoutQuestionParentId]);
|
|
11
|
-
return (React.createElement(InputField, { label: placeholderText, minHeight: TEXTAREA_MIN_HEIGHT, placeholder: placeholderText,
|
|
11
|
+
return (React.createElement(InputField, { label: placeholderText, minHeight: TEXTAREA_MIN_HEIGHT, placeholder: placeholderText, value: feedback, multiline: true, onChange: handleOnChange }));
|
|
12
12
|
};
|
|
13
13
|
export { TextareaCheckoutQuestionItem };
|
|
@@ -2,7 +2,7 @@ import React, { memo } from "react";
|
|
|
2
2
|
import { useReturnQuestionItem } from "./behaviors/useReturnQuestionItem";
|
|
3
3
|
const ReturnQuestion = ({ returnQuestion, returnQuestionParentId, portalHostName, }) => {
|
|
4
4
|
const Item = useReturnQuestionItem({ type: returnQuestion.type });
|
|
5
|
-
return (React.createElement(Item, { portalHostName: portalHostName, returnQuestion: returnQuestion, returnQuestionParentId: returnQuestionParentId
|
|
5
|
+
return (React.createElement(Item, { portalHostName: portalHostName, returnQuestion: returnQuestion, returnQuestionParentId: returnQuestionParentId },
|
|
6
6
|
React.createElement(React.Fragment, null, returnQuestion.children?.map((childReturnQuestion) => (React.createElement(ReturnQuestion, { key: childReturnQuestion.id, portalHostName: portalHostName, returnQuestion: childReturnQuestion, returnQuestionParentId: returnQuestion.id }))))));
|
|
7
7
|
};
|
|
8
8
|
export default memo(ReturnQuestion);
|
|
@@ -5,7 +5,6 @@ interface ReturnQuestionItemProps {
|
|
|
5
5
|
readonly returnQuestionParentId: string;
|
|
6
6
|
readonly children?: ReactNode;
|
|
7
7
|
readonly portalHostName?: string;
|
|
8
|
-
readonly testID: string;
|
|
9
8
|
}
|
|
10
9
|
type ReturnQuestionItem = FC<ReturnQuestionItemProps>;
|
|
11
10
|
export type { ReturnQuestionItem, ReturnQuestionItemProps };
|
|
@@ -7,7 +7,7 @@ import { InputField } from "../../../../../../../shared/ui/components/molecules/
|
|
|
7
7
|
import { useReturnQuestionFeedback, useReturnQuestionFeedbackForId } from "../../behaviors/useReturnQuestionFeedback";
|
|
8
8
|
import { deepestReturnQuestionWithFeedbackForReturnQuestion, feedbackForReturnQuestion, } from "../../util/returnQuestionFeedback";
|
|
9
9
|
import { style, containerUnderlayColor } from "./HostSelectReturnQuestionItem.style";
|
|
10
|
-
const HostSelectReturnQuestionItem = ({ returnQuestion, children, portalHostName,
|
|
10
|
+
const HostSelectReturnQuestionItem = ({ returnQuestion, children, portalHostName, }) => {
|
|
11
11
|
const { formatMessage } = useIntl();
|
|
12
12
|
const placeholderText = useMemo(() => (returnQuestion.placeholder ? formatMessage({ id: returnQuestion.placeholder }) : ""), [formatMessage, returnQuestion.placeholder]);
|
|
13
13
|
const [modalVisible, setModalVisible] = useState(false);
|
|
@@ -31,7 +31,7 @@ const HostSelectReturnQuestionItem = ({ returnQuestion, children, portalHostName
|
|
|
31
31
|
// deepestReturnQuestionWithFeedback needs to be as a dependency in order to be re-evaluated whenever it changes
|
|
32
32
|
}, [handleOnModalClose, deepestReturnQuestionWithFeedback, isLeaf]);
|
|
33
33
|
return (React.createElement(React.Fragment, null,
|
|
34
|
-
React.createElement(TouchableHighlight, {
|
|
34
|
+
React.createElement(TouchableHighlight, { style: style.container, underlayColor: containerUnderlayColor, onPress: handleOnPress },
|
|
35
35
|
React.createElement(View, { pointerEvents: "none" },
|
|
36
36
|
React.createElement(InputField, { editable: false, icon: "arrow-down", label: placeholderText, value: inputValue }))),
|
|
37
37
|
React.createElement(Modal, { portalHostName: portalHostName, visible: modalVisible, header: deepestReturnQuestionWithFeedback && (React.createElement(ButtonIcon, { name: "arrow-left", testID: "modal-back-button", onPress: handleOnBackButtonPress })), scroll: true, showCloseButton: true, onClose: handleOnModalClose },
|
|
@@ -4,11 +4,11 @@ import React, { useCallback } from "react";
|
|
|
4
4
|
import { TouchableHighlight } from "react-native";
|
|
5
5
|
import { useReturnQuestionFeedbackForId } from "../../behaviors/useReturnQuestionFeedback";
|
|
6
6
|
import { containerUnderlayColor, style } from "./OptionReturnQuestionItem.style";
|
|
7
|
-
const OptionReturnQuestionItem = ({ returnQuestion, returnQuestionParentId,
|
|
7
|
+
const OptionReturnQuestionItem = ({ returnQuestion, returnQuestionParentId, }) => {
|
|
8
8
|
const { onChange } = useReturnQuestionFeedbackForId({ id: returnQuestionParentId });
|
|
9
9
|
const optionText = useI18nMessage({ id: returnQuestion.name });
|
|
10
10
|
const handleOnPress = useCallback(() => onChange({ returnQuestionId: returnQuestionParentId, returnQuestionFeedback: returnQuestion.id }), [onChange, returnQuestion.id, returnQuestionParentId]);
|
|
11
|
-
return (React.createElement(TouchableHighlight, {
|
|
11
|
+
return (React.createElement(TouchableHighlight, { style: style.container, underlayColor: containerUnderlayColor, onPress: handleOnPress },
|
|
12
12
|
React.createElement(Text, { level: 3, style: style.text }, optionText)));
|
|
13
13
|
};
|
|
14
14
|
export { OptionReturnQuestionItem };
|
|
@@ -3,11 +3,11 @@ import React, { useCallback, useMemo } from "react";
|
|
|
3
3
|
import { InputField } from "../../../../../../../shared/ui/components/molecules/inputField/InputField";
|
|
4
4
|
import { useReturnQuestionFeedbackForId } from "../../behaviors/useReturnQuestionFeedback";
|
|
5
5
|
const TEXTAREA_MIN_HEIGHT = 96;
|
|
6
|
-
const TextareaReturnQuestionItem = ({ returnQuestion, returnQuestionParentId,
|
|
6
|
+
const TextareaReturnQuestionItem = ({ returnQuestion, returnQuestionParentId, }) => {
|
|
7
7
|
const { formatMessage } = useIntl();
|
|
8
8
|
const placeholderText = useMemo(() => (returnQuestion.placeholder ? formatMessage({ id: returnQuestion.placeholder }) : ""), [formatMessage, returnQuestion.placeholder]);
|
|
9
9
|
const { feedback, onChange } = useReturnQuestionFeedbackForId({ id: returnQuestionParentId });
|
|
10
10
|
const handleOnChange = useCallback((value) => onChange({ returnQuestionId: returnQuestionParentId, returnQuestionFeedback: value }), [onChange, returnQuestionParentId]);
|
|
11
|
-
return (React.createElement(InputField, { label: placeholderText, minHeight: TEXTAREA_MIN_HEIGHT, placeholder: placeholderText,
|
|
11
|
+
return (React.createElement(InputField, { label: placeholderText, minHeight: TEXTAREA_MIN_HEIGHT, placeholder: placeholderText, value: feedback, multiline: true, onChange: handleOnChange }));
|
|
12
12
|
};
|
|
13
13
|
export { TextareaReturnQuestionItem };
|
|
@@ -32,6 +32,6 @@ const CheckoutQuestionsForm = ({ checkoutQuestions, submitButtonDisabled, onSubm
|
|
|
32
32
|
return (React.createElement(React.Fragment, null,
|
|
33
33
|
React.createElement(CheckoutQuestionItemProvider, { checkoutQuestionItems: checkoutQuestionItems },
|
|
34
34
|
React.createElement(CheckoutQuestions, { checkoutQuestions: filteredCheckoutQuestions })),
|
|
35
|
-
React.createElement(Button, { busy: submitButtonDisabled, style: style.button,
|
|
35
|
+
React.createElement(Button, { busy: submitButtonDisabled, style: style.button, onPress: handlePress }, buttonText)));
|
|
36
36
|
};
|
|
37
37
|
export { CheckoutQuestionsForm };
|
|
@@ -20,7 +20,7 @@ const ItemActions = ({ productVariants, currentProductVariant, country, onSizeSe
|
|
|
20
20
|
(sizeSelectorOptions.length === 1 && sizeSelectorOptions[0]?.value === currentProductVariant.id), [sizeSelectorOptions, currentProductVariant.id]);
|
|
21
21
|
return (React.createElement(Sticky, { onLayout: onLayout },
|
|
22
22
|
React.createElement(Body, { style: { column: style.container } },
|
|
23
|
-
React.createElement(Button, {
|
|
23
|
+
React.createElement(Button, { onPress: onKeep }, keepButtonText),
|
|
24
24
|
React.createElement(View, { style: style.row },
|
|
25
25
|
!currentProductVariant.size.unique && productVariants && (React.createElement(SelectField, { ...(disabledSizeSelector && {
|
|
26
26
|
onPress: onSizeSelectorPress,
|
|
@@ -29,7 +29,7 @@ const ItemActions = ({ productVariants, currentProductVariant, country, onSizeSe
|
|
|
29
29
|
inputField: { input: disabledSizeSelector && style.inputDisabled },
|
|
30
30
|
}, onChange: onReplace })),
|
|
31
31
|
React.createElement(View, { style: style.returnButtonContainer },
|
|
32
|
-
React.createElement(Button, {
|
|
32
|
+
React.createElement(Button, { variant: BUTTON_VARIANT.SECONDARY, onPress: onReturn },
|
|
33
33
|
React.createElement(Text, { align: ALIGN.CENTER, level: 3, selectable: false, style: style.buttonText, action: true, upperCase: true }, returnButtonText)))))));
|
|
34
34
|
};
|
|
35
35
|
export { ItemActions };
|
package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js
CHANGED
|
@@ -35,7 +35,7 @@ const ReturnQuestionsForm = ({ returnQuestions, visible, onSubmit, onClose }) =>
|
|
|
35
35
|
React.createElement(View, { style: style.returnQuestionsContainer },
|
|
36
36
|
React.createElement(Text, { level: 2, style: style.title }, titleText),
|
|
37
37
|
React.createElement(ReturnQuestions, { portalHostName: RETURN_QUESTION_FORM_PORTAL_HOST_NAME, returnQuestions: returnQuestions }),
|
|
38
|
-
React.createElement(Button, { style: style.submit,
|
|
38
|
+
React.createElement(Button, { style: style.submit, onPress: handleOnSubmit },
|
|
39
39
|
React.createElement(Text, { align: ALIGN.CENTER, level: 3, selectable: false, style: style.buttonText, action: true, upperCase: true }, submitButtonText))))));
|
|
40
40
|
};
|
|
41
41
|
export { ReturnQuestionsForm };
|
|
@@ -40,7 +40,7 @@ const Pricing = ({ pendingToPay, subtotal, balanceDiscount, discount, discountPe
|
|
|
40
40
|
totalCheckoutItemsKeptText),
|
|
41
41
|
React.createElement(Price, { price: pendingToPay, variant: "detail" })),
|
|
42
42
|
React.createElement(View, { style: style.collapsedContent },
|
|
43
|
-
React.createElement(Button, { busy: busy,
|
|
43
|
+
React.createElement(Button, { busy: busy, small: true, onPress: onSubmit },
|
|
44
44
|
React.createElement(Text, { align: ALIGN.CENTER, level: 3, selectable: false, style: style.buttonText, action: true, upperCase: true }, submitButtonText))))) : (React.createElement(animated.View, { style: { opacity: notCollapsedStyle.opacitiy } },
|
|
45
45
|
React.createElement(Row, { text: `${subtotalText} ${totalCheckoutItemsKeptText}` },
|
|
46
46
|
React.createElement(Price, { price: subtotal, variant: "subtotal" })),
|
|
@@ -52,6 +52,6 @@ const Pricing = ({ pendingToPay, subtotal, balanceDiscount, discount, discountPe
|
|
|
52
52
|
React.createElement(View, { style: style.divider }),
|
|
53
53
|
React.createElement(Row, { level: 2, text: totalText },
|
|
54
54
|
React.createElement(Price, { price: pendingToPay, variant: "total" })),
|
|
55
|
-
React.createElement(Button, { busy: busy,
|
|
55
|
+
React.createElement(Button, { busy: busy, onPress: onSubmit }, submitButtonText)))));
|
|
56
56
|
};
|
|
57
57
|
export { Pricing };
|
|
@@ -26,7 +26,7 @@ const ModalNotificationItem = ({ visible, notification, onRemove, testID = "moda
|
|
|
26
26
|
React.createElement(View, { style: style.modal },
|
|
27
27
|
React.createElement(Text, { align: ALIGN.CENTER, level: 1, style: style.title }, titleText),
|
|
28
28
|
React.createElement(Text, { level: 3, style: style.description }, bodyText),
|
|
29
|
-
React.createElement(Button, { style: style.button,
|
|
29
|
+
React.createElement(Button, { style: style.button, onPress: handleOnClose },
|
|
30
30
|
React.createElement(Text, { align: ALIGN.CENTER, level: 3, selectable: false, style: style.buttonText, action: true, upperCase: true }, acceptText)))));
|
|
31
31
|
};
|
|
32
32
|
export { ModalNotificationItem };
|
|
@@ -6,7 +6,7 @@ const MIN_HEIGHT = 56;
|
|
|
6
6
|
const MAX_HEIGHT = 242; // 10 lines
|
|
7
7
|
const { colorGrayscaleL } = theme();
|
|
8
8
|
const clamp = (min, max, value) => Math.min(Math.max(min, value), max);
|
|
9
|
-
const Input = ({ minHeight = MIN_HEIGHT, maxHeight = MAX_HEIGHT, style: customStyle, placeholderTextColor = colorGrayscaleL, onChange, onContentSizeChange, value, multiline,
|
|
9
|
+
const Input = ({ minHeight = MIN_HEIGHT, maxHeight = MAX_HEIGHT, style: customStyle, placeholderTextColor = colorGrayscaleL, onChange, onContentSizeChange, value, multiline, ...restOfProps }) => {
|
|
10
10
|
const [height, setHeight] = useState(minHeight);
|
|
11
11
|
// When content height has became smaller the onContentSizeChange does in fact triggered but the internal height is incorrect.
|
|
12
12
|
const handleOnContentSizeChange = useCallback((event) => {
|
|
@@ -32,6 +32,6 @@ const Input = ({ minHeight = MIN_HEIGHT, maxHeight = MAX_HEIGHT, style: customSt
|
|
|
32
32
|
}, [maxHeight, minHeight, multiline]);
|
|
33
33
|
useLayoutEffect(handleOnContentSizeChangeWeb, [handleOnContentSizeChangeWeb, value]);
|
|
34
34
|
const textInputRef = useRef(null);
|
|
35
|
-
return (React.createElement(TextInput, { ref: textInputRef,
|
|
35
|
+
return (React.createElement(TextInput, { ...restOfProps, ref: textInputRef, multiline: multiline, numberOfLines: !!multiline ? undefined : 1, placeholderTextColor: placeholderTextColor, style: [style.input, customStyle, { height }], testID: "input", textAlignVertical: "top", value: value, onChange: onChange, onContentSizeChange: handleOnContentSizeChange }));
|
|
36
36
|
};
|
|
37
37
|
export { Input };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TCarouselProps } from "react-native-reanimated-carousel";
|
|
3
|
+
type CarouselRenderItem<T> = TCarouselProps<T>["renderItem"];
|
|
4
|
+
interface CarouselProps<T> {
|
|
5
|
+
readonly data: T[];
|
|
6
|
+
readonly children: CarouselRenderItem<T>;
|
|
7
|
+
readonly onActiveIndexChanged?: (index: number) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const Carousel: <T>({ data, children, onActiveIndexChanged }: CarouselProps<T>) => JSX.Element;
|
|
10
|
+
export type { CarouselRenderItem };
|
|
11
|
+
export { Carousel };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React, { useCallback, useRef, useState } from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import { GestureHandlerRootView } from "react-native-gesture-handler";
|
|
4
|
+
import RNRCarousel from "react-native-reanimated-carousel";
|
|
5
|
+
import { Bullets } from "../slider/Bullets";
|
|
6
|
+
const Carousel = ({ data, children, onActiveIndexChanged }) => {
|
|
7
|
+
const [carouselDimensions, setCarouselDimensions] = useState();
|
|
8
|
+
const handleOnLayout = useCallback(({ nativeEvent: { layout: { width, height }, }, }) => setCarouselDimensions({ width, height }), []);
|
|
9
|
+
const ref = React.useRef(null);
|
|
10
|
+
const [activeIndex, setActiveIndex] = useState(0);
|
|
11
|
+
const activeIndexRef = useRef(activeIndex);
|
|
12
|
+
activeIndexRef.current = activeIndex;
|
|
13
|
+
const handleOnActiveChanged = useCallback((index) => ref.current?.scrollTo({ index, animated: true }), []);
|
|
14
|
+
const handleOnProgressChanged = useCallback(
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
16
|
+
(_offsetProgress, absoluteProgress) => {
|
|
17
|
+
const index = Math.round(absoluteProgress);
|
|
18
|
+
if (activeIndexRef.current === index) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
setActiveIndex(index);
|
|
22
|
+
onActiveIndexChanged?.(index);
|
|
23
|
+
}, [onActiveIndexChanged]);
|
|
24
|
+
return (React.createElement(React.Fragment, null,
|
|
25
|
+
React.createElement(View, { style: { flex: 1 }, onLayout: handleOnLayout }, carouselDimensions && (React.createElement(GestureHandlerRootView, { style: { flex: 1 } },
|
|
26
|
+
React.createElement(RNRCarousel, { ref: ref, data: data, height: carouselDimensions.height, loop: false, renderItem: children, width: carouselDimensions.width, panGestureHandlerProps: {
|
|
27
|
+
activeOffsetX: [-10, 10],
|
|
28
|
+
}, onProgressChange: handleOnProgressChanged })))),
|
|
29
|
+
React.createElement(Bullets, { activeIndex: activeIndex, count: data.length, onChange: handleOnActiveChanged })));
|
|
30
|
+
};
|
|
31
|
+
export { Carousel };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare const style: {
|
|
2
|
+
carousel: {
|
|
3
|
+
flex: number;
|
|
4
|
+
flexDirection: "row";
|
|
5
|
+
height: string;
|
|
6
|
+
position: "absolute";
|
|
7
|
+
};
|
|
8
|
+
carouselItem: {
|
|
9
|
+
flex: number;
|
|
10
|
+
};
|
|
11
|
+
container: {
|
|
12
|
+
flex: number;
|
|
13
|
+
overflow: "hidden";
|
|
14
|
+
position: "relative";
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export { style };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
const style = StyleSheet.create({
|
|
3
|
+
carousel: { flex: 1, flexDirection: "row", height: "100%", position: "absolute" },
|
|
4
|
+
carouselItem: { flex: 1 },
|
|
5
|
+
container: { flex: 1, overflow: "hidden", position: "relative" },
|
|
6
|
+
});
|
|
7
|
+
export { style };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface RenderItemFunctionArgs<T> {
|
|
3
|
+
readonly item: T;
|
|
4
|
+
readonly index: number;
|
|
5
|
+
}
|
|
6
|
+
interface RenderItemFunction<T> {
|
|
7
|
+
(args: RenderItemFunctionArgs<T>): JSX.Element;
|
|
8
|
+
}
|
|
9
|
+
interface CarouselProps<T> {
|
|
10
|
+
readonly data: T[];
|
|
11
|
+
readonly children: RenderItemFunction<T>;
|
|
12
|
+
readonly onActiveIndexChanged?: (index: number) => void;
|
|
13
|
+
}
|
|
14
|
+
declare const Carousel2: <T>({ data, children, onActiveIndexChanged }: CarouselProps<T>) => JSX.Element;
|
|
15
|
+
export type { RenderItemFunction };
|
|
16
|
+
export { Carousel2 };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { clamp } from "@react-spring/shared";
|
|
2
|
+
import React, { useCallback, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
import { Gesture, GestureDetector } from "react-native-gesture-handler";
|
|
5
|
+
import Animated, { useSharedValue, withSpring, useAnimatedStyle, runOnJS } from "react-native-reanimated";
|
|
6
|
+
import { useScrollViewRef } from "../../../../../infrastructure/ui/components/layouts/layout/dummyLayout/useScrollViewRef";
|
|
7
|
+
import { Bullets } from "../slider/Bullets";
|
|
8
|
+
import { style } from "./Carousel.style";
|
|
9
|
+
const SPRING_CONFIG = {
|
|
10
|
+
damping: 25,
|
|
11
|
+
mass: 1,
|
|
12
|
+
stiffness: 300,
|
|
13
|
+
};
|
|
14
|
+
const Carousel2 = ({ data, children, onActiveIndexChanged }) => {
|
|
15
|
+
const { scrollViewRef, panGestureRef } = useScrollViewRef();
|
|
16
|
+
const [carouselDimensions, setCarouselDimensions] = useState();
|
|
17
|
+
const carouselItemWidth = carouselDimensions?.width || 1;
|
|
18
|
+
const handleOnLayout = useCallback(({ nativeEvent: { layout: { width, height }, }, }) => setCarouselDimensions({ width, height }), []);
|
|
19
|
+
const [activeIndex, setActiveIndex] = useState(0);
|
|
20
|
+
const activeIndexRef = useRef(activeIndex);
|
|
21
|
+
activeIndexRef.current = activeIndex;
|
|
22
|
+
const panTranslationX = useSharedValue(0);
|
|
23
|
+
const panInitialTranslationX = useSharedValue(0);
|
|
24
|
+
const updateActiveIndex = useCallback((index) => {
|
|
25
|
+
if (activeIndexRef.current === index) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
setActiveIndex(index);
|
|
29
|
+
onActiveIndexChanged?.(index);
|
|
30
|
+
}, [onActiveIndexChanged]);
|
|
31
|
+
const panGesture = useMemo(() => Gesture.Pan()
|
|
32
|
+
.maxPointers(1)
|
|
33
|
+
.activeOffsetX([-20, 20])
|
|
34
|
+
.onStart(() => {
|
|
35
|
+
panInitialTranslationX.value = panTranslationX.value;
|
|
36
|
+
})
|
|
37
|
+
.onUpdate(({ translationX }) => {
|
|
38
|
+
const tX = panInitialTranslationX.value + translationX;
|
|
39
|
+
const index = clamp(0, data.length - 1, Math.round(-tX / carouselItemWidth));
|
|
40
|
+
panTranslationX.value = tX;
|
|
41
|
+
runOnJS(updateActiveIndex)(index);
|
|
42
|
+
})
|
|
43
|
+
.onEnd(({ translationX }) => {
|
|
44
|
+
const tX = panInitialTranslationX.value + translationX;
|
|
45
|
+
const index = clamp(0, data.length - 1, Math.round(-tX / carouselItemWidth));
|
|
46
|
+
panTranslationX.value = withSpring(-index * carouselItemWidth, SPRING_CONFIG);
|
|
47
|
+
})
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
49
|
+
// @ts-ignore
|
|
50
|
+
.simultaneousWithExternalGesture(scrollViewRef)
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
52
|
+
// @ts-ignore
|
|
53
|
+
.withRef(panGestureRef), [
|
|
54
|
+
carouselItemWidth,
|
|
55
|
+
data.length,
|
|
56
|
+
panGestureRef,
|
|
57
|
+
panInitialTranslationX,
|
|
58
|
+
panTranslationX,
|
|
59
|
+
scrollViewRef,
|
|
60
|
+
updateActiveIndex,
|
|
61
|
+
]);
|
|
62
|
+
const animatedStyle = useAnimatedStyle(() => ({ transform: [{ translateX: panTranslationX.value }] }), [panTranslationX]);
|
|
63
|
+
return (React.createElement(React.Fragment, null,
|
|
64
|
+
React.createElement(View, { style: style.container, onLayout: handleOnLayout }, carouselDimensions && (
|
|
65
|
+
// <GestureHandlerRootView style={{ flex: 1 }}>
|
|
66
|
+
React.createElement(GestureDetector, { gesture: panGesture },
|
|
67
|
+
React.createElement(Animated.View, { style: [style.carousel, { width: carouselDimensions.width * data.length }, animatedStyle] }, data.map((item, index) => (React.createElement(View, { key: index, style: [style.carouselItem, { width: carouselDimensions.width }] }, children({ index, item }))))))
|
|
68
|
+
// </GestureHandlerRootView>
|
|
69
|
+
)),
|
|
70
|
+
React.createElement(Bullets, { activeIndex: activeIndex, count: data.length, onChange: () => void 0 })));
|
|
71
|
+
};
|
|
72
|
+
export { Carousel2 };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
import { Gesture, GestureDetector } from "react-native-gesture-handler";
|
|
5
|
+
import { useSharedValue } from "react-native-reanimated";
|
|
6
|
+
import { useScrollViewRef } from "../../../../../infrastructure/ui/components/layouts/layout/dummyLayout/useScrollViewRef";
|
|
7
|
+
const TOUCH_SLOP = 5;
|
|
8
|
+
const TIME_TO_ACTIVATE_PAN = 400;
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
const DragComponent = (props) => {
|
|
11
|
+
const { scrollViewRef, panGestureRef } = useScrollViewRef();
|
|
12
|
+
const touchStart = useSharedValue({ x: 0, y: 0, time: 0 });
|
|
13
|
+
const gesture = Gesture.Pan()
|
|
14
|
+
.manualActivation(true)
|
|
15
|
+
.onTouchesDown((e) => {
|
|
16
|
+
touchStart.value = {
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
x: e.changedTouches[0].x,
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
y: e.changedTouches[0].y,
|
|
21
|
+
time: Date.now(),
|
|
22
|
+
};
|
|
23
|
+
})
|
|
24
|
+
.onTouchesMove((e, state) => {
|
|
25
|
+
if (Date.now() - touchStart.value.time > TIME_TO_ACTIVATE_PAN) {
|
|
26
|
+
state.activate();
|
|
27
|
+
console.log("activate");
|
|
28
|
+
}
|
|
29
|
+
else if (
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
Math.abs(touchStart.value.x - e.changedTouches[0].x) > TOUCH_SLOP ||
|
|
32
|
+
// @ts-ignore
|
|
33
|
+
Math.abs(touchStart.value.y - e.changedTouches[0].y) > TOUCH_SLOP) {
|
|
34
|
+
state.fail();
|
|
35
|
+
console.log("fail");
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
.onUpdate(() => {
|
|
39
|
+
console.log("pan update");
|
|
40
|
+
})
|
|
41
|
+
// @ts-ignore
|
|
42
|
+
.simultaneousWithExternalGesture(scrollViewRef)
|
|
43
|
+
// @ts-ignore
|
|
44
|
+
.withRef(panGestureRef);
|
|
45
|
+
return (React.createElement(GestureDetector, { gesture: gesture },
|
|
46
|
+
React.createElement(View, null, props.children)));
|
|
47
|
+
};
|
|
48
|
+
export { DragComponent };
|
|
@@ -75,7 +75,7 @@ const Modal = ({ children, visible, header, footer, portalHostName, onClose, sho
|
|
|
75
75
|
(header || showCloseButton) && (React.createElement(View, { style: [style.header, customStyle?.header] },
|
|
76
76
|
React.createElement(View, null, header),
|
|
77
77
|
showCloseButton && (React.createElement(ButtonIcon, { name: "close", style: { button: customStyle?.closeButton }, onPress: onClose })))),
|
|
78
|
-
React.createElement(ModalContentView,
|
|
78
|
+
React.createElement(ModalContentView, null,
|
|
79
79
|
React.createElement(View, { style: {
|
|
80
80
|
paddingBottom: safeAreaInsetBottom +
|
|
81
81
|
(Platform.OS !== "ios" ? spaceXL : 0) +
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TouchableWithoutFeedback, View } from "react-native";
|
|
3
|
+
import { theme } from "../../../../../infrastructure/ui/theme/theme";
|
|
4
|
+
import { style } from "./SliderDots.style";
|
|
5
|
+
const { colorContent } = theme();
|
|
6
|
+
const SliderDot = ({ diameter, color }) => (React.createElement(View, { style: [style.sliderDot, { width: diameter, height: diameter, backgroundColor: color, borderRadius: diameter }] }));
|
|
7
|
+
const SliderDots = () => {
|
|
8
|
+
return (React.createElement(View, { style: style.sliderDots },
|
|
9
|
+
React.createElement(TouchableWithoutFeedback, null,
|
|
10
|
+
React.createElement(SliderDot, { color: colorContent, diameter: 8 })),
|
|
11
|
+
React.createElement(TouchableWithoutFeedback, null,
|
|
12
|
+
React.createElement(SliderDot, { color: colorContent, diameter: 8 })),
|
|
13
|
+
React.createElement(TouchableWithoutFeedback, null,
|
|
14
|
+
React.createElement(SliderDot, { color: colorContent, diameter: 8 }))));
|
|
15
|
+
};
|
|
16
|
+
export { SliderDots };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
import { theme } from "../../../../../infrastructure/ui/theme/theme";
|
|
3
|
+
const { spaceM } = theme();
|
|
4
|
+
const style = StyleSheet.create({
|
|
5
|
+
sliderDot: {
|
|
6
|
+
marginHorizontal: 3,
|
|
7
|
+
},
|
|
8
|
+
sliderDots: {
|
|
9
|
+
alignItems: "center",
|
|
10
|
+
flexDirection: "row",
|
|
11
|
+
justifyContent: "center",
|
|
12
|
+
paddingVertical: spaceM,
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
export { style };
|
|
@@ -6,7 +6,7 @@ import { Modal } from "../../layouts/modal/Modal";
|
|
|
6
6
|
import { InputField } from "../inputField/InputField";
|
|
7
7
|
import { style } from "./SelectField.style";
|
|
8
8
|
const { colorGrayscaleS } = theme();
|
|
9
|
-
const SelectField = ({ title, placeholder, value, options, style: customStyle, onChange = () => void 0,
|
|
9
|
+
const SelectField = ({ title, placeholder, value, options, style: customStyle, onChange = () => void 0, ...touchableRestProps }) => {
|
|
10
10
|
const [modalVisible, setModalVisible] = useState(false);
|
|
11
11
|
const handleOnPressSelectField = useCallback(() => setModalVisible(true), []);
|
|
12
12
|
const handleOnModalClose = useCallback(() => setModalVisible(false), []);
|
|
@@ -16,13 +16,13 @@ const SelectField = ({ title, placeholder, value, options, style: customStyle, o
|
|
|
16
16
|
}, [handleOnModalClose, onChange]);
|
|
17
17
|
const selectedValue = useMemo(() => options.find((option) => option.value === value), [options, value]);
|
|
18
18
|
return (React.createElement(React.Fragment, null,
|
|
19
|
-
React.createElement(TouchableHighlight, {
|
|
19
|
+
React.createElement(TouchableHighlight, { style: customStyle?.selectField, underlayColor: colorGrayscaleS, onPress: handleOnPressSelectField, ...touchableRestProps },
|
|
20
20
|
React.createElement(View, { pointerEvents: "none" },
|
|
21
21
|
React.createElement(InputField, { editable: false, icon: "arrow-down", label: placeholder, style: customStyle?.inputField, value: selectedValue?.label }))),
|
|
22
22
|
React.createElement(Modal, { testID: "select-field-modal", visible: modalVisible, scroll: true, showCloseButton: true, onClose: handleOnModalClose },
|
|
23
23
|
React.createElement(View, { style: [style.modalContent, customStyle?.modalContent] },
|
|
24
24
|
title && (React.createElement(Text, { level: 2, style: style.modalTitle }, title)),
|
|
25
|
-
options.map(({ label, value: optionValue }) => (React.createElement(TouchableHighlight, { key: optionValue,
|
|
25
|
+
options.map(({ label, value: optionValue }) => (React.createElement(TouchableHighlight, { key: optionValue, disabled: value === optionValue, style: [style.option, customStyle?.option], underlayColor: colorGrayscaleS, onPress: value !== optionValue ? () => handleOnPressOption(optionValue) : undefined },
|
|
26
26
|
React.createElement(Text, { color: value === optionValue ? COLOR.GRAYSCALE_M : COLOR.CONTENT, level: 3, style: [style.optionText, customStyle?.optionText] }, label))))))));
|
|
27
27
|
};
|
|
28
28
|
export { SelectField };
|
package/package.json
CHANGED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ProcessManagerFunction } from "@lookiero/messaging";
|
|
2
|
-
import { CheckoutBookingExpired } from "../model/checkoutBookingExpired";
|
|
3
|
-
interface CreateNotificationWhenCheckoutBookingExpiredFunction extends ProcessManagerFunction<CheckoutBookingExpired> {
|
|
4
|
-
}
|
|
5
|
-
declare const createNotificationWhenCheckoutBookingExpired: CreateNotificationWhenCheckoutBookingExpiredFunction;
|
|
6
|
-
export { createNotificationWhenCheckoutBookingExpired };
|