Skip to content

Commit 04f992e

Browse files
committed
Add badges to pages
1 parent 94526fd commit 04f992e

12 files changed

Lines changed: 103 additions & 31 deletions

File tree

packages/docs-gesture-handler/docs/components/pressable.mdx

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ sidebar_label: Pressable
77
import useBaseUrl from '@docusaurus/useBaseUrl';
88
import GifGallery from '@site/components/GifGallery';
99

10+
import HeaderWithBadge from '@site/src/components/HeaderWithBadge';
11+
1012
:::info
1113
This component is a drop-in replacement for the `Pressable` component.
1214
:::
@@ -87,31 +89,39 @@ cancelable?: null | boolean;
8789

8890
Whether a press gesture can be interrupted by a parent gesture such as a scroll event. Defaults to `true`.
8991

90-
### onHoverIn (Web only)
92+
<HeaderWithBadge platforms={['web']}>
93+
### onHoverIn
94+
</HeaderWithBadge>
9195

9296
```ts
9397
onHoverIn?: null | ((event: PressableEvent) => void);
9498
```
9599

96100
Called when pointer is hovering over the element.
97101

98-
### onHoverOut (Web only)
102+
<HeaderWithBadge platforms={['web']}>
103+
### onHoverOut
104+
</HeaderWithBadge>
99105

100106
```ts
101107
onHoverOut?: null | ((event: PressableEvent) => void);
102108
```
103109

104110
Called when pointer stops hovering over the element.
105111

106-
### delayHoverIn (Web only)
112+
<HeaderWithBadge platforms={['web']}>
113+
### delayHoverIn
114+
</HeaderWithBadge>
107115

108116
```ts
109117
delayHoverIn?: number | null;
110118
```
111119

112120
Duration to wait after hover in before calling `onHoverIn`.
113121

114-
### delayHoverOut (Web only)
122+
<HeaderWithBadge platforms={['web']}>
123+
### delayHoverOut
124+
</HeaderWithBadge>
115125

116126
```ts
117127
delayHoverOut?: number | null;
@@ -135,7 +145,9 @@ disabled?: null | boolean;
135145

136146
Whether the `Pressable` behavior is disabled.
137147

138-
### hitSlop (Android & iOS only)
148+
<HeaderWithBadge platforms={['android', 'iOS']}>
149+
### hitSlop
150+
</HeaderWithBadge>
139151

140152
```ts
141153
hitSlop?: null | Insets | number;
@@ -145,7 +157,9 @@ Additional distance outside of the view in which a press is detected and [`onPre
145157

146158
The `Insets` type is essentially the same as [`Rect`](https://reactnative.dev/docs/rect).
147159

148-
### pressRetentionOffset (Android & iOS only)
160+
<HeaderWithBadge platforms={['android', 'iOS']}>
161+
### pressRetentionOffset
162+
</HeaderWithBadge>
149163

150164
```ts
151165
pressRetentionOffset?: null | Insets | number;
@@ -156,15 +170,19 @@ press before [`onPressOut`](#onpressout) is triggered.
156170

157171
The `Insets` type is essentially the same as [`Rect`](https://reactnative.dev/docs/rect).
158172

159-
### android_disableSound (Android only)
173+
<HeaderWithBadge platforms={['android']}>
174+
### android_disableSound
175+
</HeaderWithBadge>
160176

161177
```ts
162178
android_disableSound?: null | boolean;
163179
```
164180

165181
If `true`, doesn't play system sound on touch.
166182

167-
### android_ripple (Android only)
183+
<HeaderWithBadge platforms={['android']}>
184+
### android_ripple
185+
</HeaderWithBadge>
168186

169187
```ts
170188
android_ripple?: null | PressableAndroidRippleConfig;

packages/docs-gesture-handler/docs/components/reanimated-drawer-layout.mdx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ sidebar_label: Reanimated Drawer Layout
66

77
import useBaseUrl from '@docusaurus/useBaseUrl';
88

9+
import HeaderWithBadge from '@site/src/components/HeaderWithBadge';
10+
911
:::info
1012
This component acts as a cross-platform replacement for React Native's [`DrawerLayoutAndroid`](http://reactnative.dev/docs/drawerlayoutandroid.html) component, written using [Reanimated](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started). For detailed information on standard parameters, please refer to the [React Native documentation](http://reactnative.dev/docs/drawerlayoutandroid.html).
1113
:::
@@ -132,7 +134,9 @@ export enum DrawerState {
132134

133135
A function is called when the status of the drawer changes, taking `newState` to represent the drawer's interaction state and `drawerWillShow`, which is `true` when the drawer starts animating towards the open position and `false` otherwise.
134136

135-
### enableTrackpadTwoFingerGesture (iOS only)
137+
<HeaderWithBadge platforms={['iOS']}>
138+
### enableTrackpadTwoFingerGesture
139+
</HeaderWithBadge>
136140

137141
```ts
138142
enableTrackpadTwoFingerGesture?: boolean;
@@ -149,7 +153,9 @@ children?: ReactNode | ((openValue?: SharedValue<number>) => ReactNode);
149153

150154
Either a component rendered in the content view or a function. If `children` is a function, it receives an `openValue` parameter - [`SharedValue`](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#shared-value) that indicates the progress of the drawer's opening or closing animation. This value equals `0` when the drawer is closed and `1` when it is fully opened. The drawer component can use this value to animate its children during the opening or closing process. This function must return a [`ReactNode`](https://reactnative.dev/docs/react-node).
151155

152-
### mouseButton (Web & Android only)
156+
<HeaderWithBadge platforms={['android', 'web']}>
157+
### mouseButton
158+
</HeaderWithBadge>
153159

154160
<CollapsibleCode
155161
label="Show composed types definitions"
@@ -170,8 +176,9 @@ enum MouseButton {
170176

171177
Allows users to choose which mouse button should handler respond to. Arguments can be combined using `|` operator, e.g. `mouseButton(MouseButton.LEFT | MouseButton.RIGHT)`. Default value is set to `MouseButton.LEFT`.
172178

173-
174-
### enableContextMenu (Web only)
179+
<HeaderWithBadge platforms={['web']}>
180+
### enableContextMenu
181+
</HeaderWithBadge>
175182

176183
```ts
177184
enableContextMenu: boolean;

packages/docs-gesture-handler/docs/components/reanimated_swipeable.mdx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ sidebar_label: Reanimated Swipeable
77
import useBaseUrl from '@docusaurus/useBaseUrl';
88
import GifGallery from '@site/components/GifGallery'
99

10+
import HeaderWithBadge from '@site/src/components/HeaderWithBadge';
11+
1012
:::info
1113
This component is a drop-in replacement for the `Swipeable` component, rewritten using [Reanimated](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started).
1214
:::
@@ -240,15 +242,19 @@ blocksExternalGesture?: AnyGesture | AnyGesture[];
240242

241243
Gestures that `Swipeable` will prevent from activating (see [gesture composition section](/docs/fundamentals/gesture-composition#simultaneouswith)).
242244

243-
### enableTrackpadTwoFingerGesture (iOS only)
245+
<HeaderWithBadge platforms={['iOS']}>
246+
### enableTrackpadTwoFingerGesture
247+
</HeaderWithBadge>
244248

245249
```ts
246250
enableTrackpadTwoFingerGesture?: boolean;
247251
```
248252

249253
Enables two-finger gestures on supported devices, for example iPads with trackpads. If not enabled the gesture will require click + drag, with `enableTrackpadTwoFingerGesture` swiping with two fingers will also trigger the gesture.
250254

251-
### mouseButton (Web & Android only)
255+
<HeaderWithBadge platforms={['android', 'web']}>
256+
### mouseButton
257+
</HeaderWithBadge>
252258

253259
<CollapsibleCode
254260
label="Show composed types definitions"
@@ -269,7 +275,9 @@ enum MouseButton {
269275

270276
Allows users to choose which mouse button should handler respond to. Arguments can be combined using `|` operator, e.g. `mouseButton(MouseButton.LEFT | MouseButton.RIGHT)`. Default value is set to `MouseButton.LEFT`.
271277

272-
### enableContextMenu (Web only)
278+
<HeaderWithBadge platforms={[ 'web']}>
279+
### enableContextMenu
280+
</HeaderWithBadge>
273281

274282
```ts
275283
enableContextMenu: boolean;

packages/docs-gesture-handler/docs/fundamentals/gesture-detector.mdx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar_position: 3
66
---
77

88
import CollapsibleCode from '@site/src/components/CollapsibleCode';
9-
9+
import HeaderWithBadge from '@site/src/components/HeaderWithBadge';
1010

1111
## Gesture Detector
1212

@@ -190,23 +190,29 @@ gesture: SingleGesture | ComposedGesture;
190190

191191
A gesture object containing the configuration and callbacks. Can be any of the base gestures or any [`ComposedGesture`](/docs/fundamentals/gesture-composition).
192192

193-
### userSelect (Web only)
193+
<HeaderWithBadge platforms={['web']}>
194+
### userSelect
195+
</HeaderWithBadge>
194196

195197
```ts
196198
userSelect: 'none' | 'auto' | 'text';
197199
```
198200

199201
This parameter allows to specify which `userSelect` property should be applied to underlying view. Default value is set to `"none"`.
200202

201-
### touchAction (Web only)
203+
<HeaderWithBadge platforms={['web']}>
204+
### touchAction
205+
</HeaderWithBadge>
202206

203207
```ts
204208
touchAction: TouchAction;
205209
```
206210

207211
This parameter allows to specify which `touchAction` property should be applied to underlying view. Supports all CSS [touch-action](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/touch-action) values. Default value is set to `"none"`.
208212

209-
### enableContextMenu (Web only)
213+
<HeaderWithBadge platforms={['web']}>
214+
### enableContextMenu
215+
</HeaderWithBadge>
210216

211217
```ts
212218
enableContextMenu: boolean;

packages/docs-gesture-handler/docs/gestures/_shared/base-gesture-config.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import CollapsibleCode from '@site/src/components/CollapsibleCode';
22

3+
import HeaderWithBadge from '@site/src/components/HeaderWithBadge';
4+
35
### enabled
46

57
```ts
@@ -67,7 +69,9 @@ testID: string;
6769

6870
Sets a `testID` property for gesture object, allowing for querying for it in tests.
6971

70-
### cancelsTouchesInView (**iOS only**)
72+
<HeaderWithBadge platforms={['iOS']}>
73+
### cancelsTouchesInView
74+
</HeaderWithBadge>
7175

7276
```ts
7377
cancelsTouchesInView: boolean | SharedValue<boolean>;

packages/docs-gesture-handler/docs/gestures/use-fling-gesture.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import useBaseUrl from '@docusaurus/useBaseUrl';
1212
import FlingGestureBasic from '@site/static/examples/FlingGestureBasic';
1313
import FlingGestureBasicSrc from '!!raw-loader!@site/static/examples/FlingGestureBasicSrc';
1414

15+
import HeaderWithBadge from '@site/src/components/HeaderWithBadge';
16+
1517
<div className={webContainer}>
1618
<div className={vanishOnMobile} style={{ display: 'flex', justifyContent: 'center', maxWidth: 360 }}>
1719
<video playsInline autoPlay muted loop style={{maxWidth: 360}}>
@@ -140,7 +142,9 @@ numberOfPointers: number | SharedValue<number>;
140142

141143
Determine exact number of points required to handle the fling gesture.
142144

143-
### mouseButton (Web & Android only)
145+
<HeaderWithBadge platforms={['android', 'web']}>
146+
### mouseButton
147+
</HeaderWithBadge>
144148

145149
<CollapsibleCode
146150
label="Show composed types definitions"

packages/docs-gesture-handler/docs/gestures/use-hover-gesture.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import useBaseUrl from '@docusaurus/useBaseUrl';
1212
import HoverGestureBasic from '@site/static/examples/HoverGestureBasic';
1313
import HoverGestureBasicSrc from '!!raw-loader!@site/static/examples/HoverGestureBasic';
1414

15+
import HeaderWithBadge from '@site/src/components/HeaderWithBadge';
16+
1517
<div className={webContainer}>
1618
<div className={vanishOnMobile} style={{ display: 'flex', justifyContent: 'center', maxWidth: 360 }}>
1719
<video playsInline autoPlay muted loop style={{maxWidth: 360}}>
@@ -91,7 +93,9 @@ const styles = StyleSheet.create({
9193

9294
<SharedValueInfo />
9395

94-
### effect (iOS only)
96+
<HeaderWithBadge platforms={['iOS']}>
97+
### effect
98+
</HeaderWithBadge>
9599

96100
<CollapsibleCode
97101
label="Show composed types definitions"

packages/docs-gesture-handler/docs/gestures/use-long-press-gesture.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import useBaseUrl from '@docusaurus/useBaseUrl';
1212
import LongPressGestureBasic from '@site/static/examples/LongPressGestureBasic';
1313
import LongPressGestureBasicSrc from '!!raw-loader!@site/static/examples/LongPressGestureBasic';
1414

15+
import HeaderWithBadge from '@site/src/components/HeaderWithBadge';
16+
1517
<div className={webContainer}>
1618
<div className={vanishOnMobile} style={{ display: 'flex', justifyContent: 'center', maxWidth: 360 }}>
1719
<video playsInline autoPlay muted loop style={{maxWidth: 360}}>
@@ -73,7 +75,9 @@ maxDistance: number | SharedValue<number>;
7375

7476
Maximum distance, expressed in points, that defines how far the finger is allowed to travel during a long press gesture. If the finger travels further than the defined distance and the gesture hasn't yet activated, it will fail to recognize the gesture. The default value is 10.
7577

76-
### mouseButton (Web & Android only)
78+
<HeaderWithBadge platforms={['android', 'web']}>
79+
### mouseButton
80+
</HeaderWithBadge>
7781

7882
<CollapsibleCode
7983
label="Show composed types definitions"

packages/docs-gesture-handler/docs/gestures/use-native-gesture.mdx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import BaseGestureCallbacks from './\_shared/base-gesture-callbacks.mdx';
1111
import BaseContinuousGestureCallbacks from './\_shared/base-continuous-gesture-callbacks.mdx';
1212
import SharedValueInfo from './\_shared/shared-value-info.md';
1313

14+
import HeaderWithBadge from '@site/src/components/HeaderWithBadge';
15+
1416
A gesture that allows other touch handling components to work within RNGH's gesture system. This streamlines interactions between gestures and the native component, allowing it to form [relations](/docs/fundamentals/gesture-composition) with other gestures.
1517

1618
When used, the native component should be the direct child of a [`GestureDetector`](/docs/fundamentals/gesture-detectors#gesture-detector).
@@ -96,7 +98,10 @@ export default function App() {
9698

9799
<SharedValueInfo />
98100

99-
### shouldActivateOnStart (**Android only**)
101+
<HeaderWithBadge platforms={['android']}>
102+
### shouldActivateOnStart
103+
</HeaderWithBadge>
104+
100105

101106
```ts
102107
shouldActivateOnStart: boolean | SharedValue<boolean>;

packages/docs-gesture-handler/docs/gestures/use-pan-gesture.mdx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import SharedValueInfo from './\_shared/shared-value-info.md';
2121

2222
import CollapsibleCode from '@site/src/components/CollapsibleCode';
2323

24+
import HeaderWithBadge from '@site/src/components/HeaderWithBadge';
25+
2426
<div className={webContainer}>
2527
<div className={vanishOnMobile} style={{ display: 'flex', justifyContent: 'center', maxWidth: 360 }}>
2628
<video playsInline autoPlay muted loop style={{maxWidth: 360}}>
@@ -209,23 +211,29 @@ When the finger moves outside this range (in points) along X axis and gesture ha
209211
If range is set as an array, first value must be lower or equal to 0, a the second one higher or equal to 0.
210212
If only one number `p` is given a range of `(-inf, p)` will be used if `p` is higher or equal to 0 and `(-p, inf)` otherwise.
211213

212-
### averageTouches (Android only)
214+
<HeaderWithBadge platforms={['android']}>
215+
### averageTouches
216+
</HeaderWithBadge>
213217

214218
```ts
215219
averageTouches: boolean | SharedValue<boolean>;
216220
```
217221

218222
Android, by default, will calculate translation values based on the position of the leading pointer (the first one that was placed on the screen). This modifier allows that behavior to be changed to the one that is default on iOS - the averaged position of all active pointers will be used to calculate the translation values.
219223

220-
### enableTrackpadTwoFingerGesture (iOS only)
224+
<HeaderWithBadge platforms={['iOS']}>
225+
### enableTrackpadTwoFingerGesture
226+
</HeaderWithBadge>
221227

222228
```ts
223229
enableTrackpadTwoFingerGesture: boolean | SharedValue<boolean>;
224230
```
225231

226232
Enables two-finger gestures on supported devices, for example iPads with trackpads. If not enabled the gesture will require click + drag, with enableTrackpadTwoFingerGesture swiping with two fingers will also trigger the gesture.
227233

228-
### mouseButton (Web & Android only)
234+
<HeaderWithBadge platforms={['android', 'web']}>
235+
### mouseButton
236+
</HeaderWithBadge>
229237

230238
<CollapsibleCode
231239
label="Show composed types definitions"

0 commit comments

Comments
 (0)