@meatech/payblend_app_ui_component 1.1.34 → 1.1.36
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,5 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { StyleSheet, View
|
|
1
|
+
import React, {forwardRef} from "react";
|
|
2
|
+
import { StyleSheet, View } from "react-native";
|
|
3
3
|
import Carousel, { CarouselProps } from "react-native-snap-carousel";
|
|
4
4
|
import { useSharedValue } from "react-native-reanimated";
|
|
5
5
|
import { PaginationItem } from "./PaginationItem";
|
|
@@ -64,7 +64,7 @@ export const SnapImageCarousel = forwardRef<TSnapImageCarouselItem, SnapImageCar
|
|
|
64
64
|
return (
|
|
65
65
|
<>
|
|
66
66
|
<View style={styles.carousel}>
|
|
67
|
-
<Carousel
|
|
67
|
+
<Carousel
|
|
68
68
|
ref={ref}
|
|
69
69
|
data={cardList}
|
|
70
70
|
renderItem={renderItem}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import React__default, { forwardRef } from 'react';
|
|
2
|
+
import { View, StyleSheet } from 'react-native';
|
|
3
3
|
import Carousel from 'react-native-snap-carousel';
|
|
4
4
|
import { useSharedValue } from 'react-native-reanimated';
|
|
5
5
|
import { PaginationItem } from './PaginationItem.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SnapImageCarousel.js","sources":["../../../../components/SnapImageCarousel/SnapImageCarousel.tsx"],"sourcesContent":["import React from \"react\";\nimport { StyleSheet, View
|
|
1
|
+
{"version":3,"file":"SnapImageCarousel.js","sources":["../../../../components/SnapImageCarousel/SnapImageCarousel.tsx"],"sourcesContent":["import React, {forwardRef} from \"react\";\nimport { StyleSheet, View } from \"react-native\";\nimport Carousel, { CarouselProps } from \"react-native-snap-carousel\";\nimport { useSharedValue } from \"react-native-reanimated\";\nimport { PaginationItem } from \"./PaginationItem\";\nimport { CardStatusThumbnail } from \"./CardStatusThumbnail\";\nimport { THUMBNAIL_HEIGHT } from \"./consts\";\nimport { deviceWidth, metrics } from \"@ui/themes\";\nimport { SnapImageCarouselProps, TSnapImageCarouselItem } from \"./types\";\n\nexport const SnapImageCarousel = forwardRef<TSnapImageCarouselItem, SnapImageCarouselProps<T>>(({\n cardList,\n hidePagination,\n isLoading,\n onCreate,\n ...props\n}, ref) => {\n const animation = useSharedValue<number>(0);\n const handleSnapToItem: CarouselProps<string>[\"onScroll\"] = (event) => {\n const index = Math.round(\n event.nativeEvent.contentOffset.x / (deviceWidth() * 0.55)\n );\n if (index >= 0) {\n animation.value = index;\n }\n };\n\n const renderItem = ({\n item,\n index,\n }: {\n item: TSnapImageCarouselItem<T>;\n index: number;\n }) => (\n <CardStatusThumbnail\n key={index.toString()}\n animation={animation}\n index={index}\n onCreate={onCreate}\n isLoading={isLoading}\n {...item}\n />\n );\n\n const renderPaginationItem = (_: unknown, index: number) => (\n <PaginationItem\n key={index.toString()}\n animation={animation}\n index={index}\n />\n );\n\n // if (cardList?.length === 0) {\n // return (\n // <CardStatusThumbnail<T>\n // style={styles.carousel}\n // type={ECardThumbnailType.NOT_ISSUED}\n // photo={thumbnailDefault}\n // onCreate={onCreate}\n // />\n // );\n // }\n\n return (\n <>\n <View style={styles.carousel}>\n <Carousel\n ref={ref}\n data={cardList}\n renderItem={renderItem}\n sliderWidth={deviceWidth()}\n sliderHeight={THUMBNAIL_HEIGHT}\n itemWidth={deviceWidth() * 0.55}\n itemHeight={THUMBNAIL_HEIGHT}\n inactiveSlideScale={1}\n inactiveSlideOpacity={1}\n onScroll={handleSnapToItem}\n {...props}\n />\n </View>\n {!hidePagination && cardList.length > 0 && (\n <View style={styles.pagination}>\n {cardList.map(renderPaginationItem)}\n </View>\n )}\n </>\n );\n});\n\nconst styles = StyleSheet.create({\n carousel: {\n height: THUMBNAIL_HEIGHT,\n marginTop: metrics.height.spacingBase,\n },\n pagination: {\n flexDirection: \"row\",\n justifyContent: \"center\",\n gap: metrics.width.spacingExtraSmall,\n paddingVertical: metrics.height.spacingTiny,\n marginTop: metrics.height.spacingSlightlySmall,\n },\n});\n"],"names":["React"],"mappings":";;;;;;;;;;;;MAUa,iBAAiB,GAAG,UAAU,CAAoD,CAAC,EAC9F,QAAQ,EACR,cAAc,EACd,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,GAAG,KAAI;AACR,IAAA,MAAM,SAAS,GAAG,cAAc,CAAS,CAAC,CAAC;AAC3C,IAAA,MAAM,gBAAgB,GAAsC,CAAC,KAAK,KAAI;QACpE,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CACtB,KAAK,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,IAAI,WAAW,EAAE,GAAG,IAAI,CAAC,CAC3D;AACD,QAAA,IAAI,KAAK,IAAI,CAAC,EAAE;AACd,YAAA,SAAS,CAAC,KAAK,GAAG,KAAK;;AAE3B,KAAC;AAED,IAAA,MAAM,UAAU,GAAG,CAAC,EAClB,IAAI,EACJ,KAAK,GAIN,MACCA,cAAC,CAAA,aAAA,CAAA,mBAAmB,IAClB,GAAG,EAAE,KAAK,CAAC,QAAQ,EAAE,EACrB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,KAChB,IAAI,EAAA,CACR,CACH;AAED,IAAA,MAAM,oBAAoB,GAAG,CAAC,CAAU,EAAE,KAAa,MACrDA,cAAC,CAAA,aAAA,CAAA,cAAc,EACb,EAAA,GAAG,EAAE,KAAK,CAAC,QAAQ,EAAE,EACrB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,EAAA,CACZ,CACH;;;;;;;;;;;AAaD,IAAA,QACEA,cAAA,CAAA,aAAA,CAAAA,cAAA,CAAA,QAAA,EAAA,IAAA;AACE,QAAAA,cAAA,CAAA,aAAA,CAAC,IAAI,EAAC,EAAA,KAAK,EAAE,M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