@proulr/sdui-components 0.1.3 → 0.1.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.
package/package.json
CHANGED
|
@@ -189,6 +189,19 @@ function DiscoverGridCell({
|
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
export function SduiDiscoverGridBlock({ block, data, onAction }: SduiBlockRenderProps) {
|
|
192
|
+
const hybrid = useSduiHybridRenderer();
|
|
193
|
+
if (hybrid.renderDiscoverGrid) {
|
|
194
|
+
return (
|
|
195
|
+
<>
|
|
196
|
+
{hybrid.renderDiscoverGrid({
|
|
197
|
+
block,
|
|
198
|
+
data,
|
|
199
|
+
onAction,
|
|
200
|
+
})}
|
|
201
|
+
</>
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
|
|
192
205
|
const itemsRef = readStringProp(block, 'items_ref') ?? 'grid_items';
|
|
193
206
|
const columns = readNumberProp(block, 'columns', GRID_COLUMNS);
|
|
194
207
|
const profileActionId = readStringProp(block, 'profile_action_id');
|
|
@@ -98,6 +98,8 @@ export function SduiScrollBlock({ block, children }: SduiBlockRenderProps) {
|
|
|
98
98
|
: blockContentStyle
|
|
99
99
|
}
|
|
100
100
|
{...(chromeScroll?.scrollInsetProps ?? {})}
|
|
101
|
+
onScroll={chromeScroll?.onScroll}
|
|
102
|
+
scrollEventThrottle={chromeScroll?.onScroll ? 16 : undefined}
|
|
101
103
|
showsVerticalScrollIndicator={false}
|
|
102
104
|
>
|
|
103
105
|
{children}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { createContext, useContext, type ReactNode } from 'react';
|
|
2
|
-
import type { ViewStyle } from 'react-native';
|
|
2
|
+
import type { NativeScrollEvent, NativeSyntheticEvent, ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
4
|
export type SduiChromeScrollInsetProps = {
|
|
5
5
|
contentInset?: { top: number; bottom: number };
|
|
@@ -19,6 +19,7 @@ export type SduiChromeScrollConfig = {
|
|
|
19
19
|
scrollInsetProps: SduiChromeScrollInsetProps;
|
|
20
20
|
contentContainerStyle: ViewStyle;
|
|
21
21
|
chromeInsets: SduiChromeScrollInsets;
|
|
22
|
+
onScroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
|
|
22
23
|
};
|
|
23
24
|
|
|
24
25
|
const SduiChromeScrollContext = createContext<SduiChromeScrollConfig | null>(null);
|
|
@@ -45,6 +45,7 @@ export type SduiHybridRenderers = {
|
|
|
45
45
|
renderProfileCompletionBanner?: (props: SduiHybridProfileCompletionBannerProps) => ReactNode;
|
|
46
46
|
renderDiscoverMap?: (props: SduiHybridDiscoverMapProps) => ReactNode;
|
|
47
47
|
renderDiscoverProfileCard?: (props: SduiHybridDiscoverProfileCardProps) => ReactNode;
|
|
48
|
+
renderDiscoverGrid?: (props: SduiNativeBlockRenderProps) => ReactNode;
|
|
48
49
|
renderTextField?: (props: {
|
|
49
50
|
dataRef: string;
|
|
50
51
|
placeholder: string;
|