Skip to content

Commit

Permalink
fix: updated types for styles (#616)
Browse files Browse the repository at this point in the history
  • Loading branch information
vonovak authored Aug 31, 2021
1 parent 338da06 commit 7fa1453
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 21 deletions.
2 changes: 1 addition & 1 deletion example/src/Dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const App = () => {
style={styles.flatlist}
contentContainerStyle={styles.flatlistContainer}
/>
<BottomSheetFooter appearanceBehavior={['fade', 'scale']}>
<BottomSheetFooter>
<RectButton style={styles.footer}>
<Text style={styles.footerText}>this is a footer!</Text>
</RectButton>
Expand Down
35 changes: 18 additions & 17 deletions src/components/bottomSheet/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type React from 'react';
import type { ViewStyle, Insets } from 'react-native';
import type { ViewStyle, Insets, StyleProp } from 'react-native';
import type Animated from 'react-native-reanimated';
import type { PanGestureHandlerProps } from 'react-native-gesture-handler';
import type { BottomSheetHandleProps } from '../bottomSheetHandle';
Expand Down Expand Up @@ -165,17 +165,19 @@ export interface BottomSheetProps
* @type Animated.AnimateStyle<ViewStyle>
* @default undefined
*/
style?: Animated.AnimateStyle<
Omit<
ViewStyle,
| 'flexDirection'
| 'position'
| 'top'
| 'left'
| 'bottom'
| 'right'
| 'opacity'
| 'transform'
style?: StyleProp<
Animated.AnimateStyle<
Omit<
ViewStyle,
| 'flexDirection'
| 'position'
| 'top'
| 'left'
| 'bottom'
| 'right'
| 'opacity'
| 'transform'
>
>
>;
/**
Expand All @@ -184,24 +186,23 @@ export interface BottomSheetProps
* @type ViewStyle
* @default undefined
*/
backgroundStyle?: Omit<
ViewStyle,
'position' | 'top' | 'left' | 'bottom' | 'right'
backgroundStyle?: StyleProp<
Omit<ViewStyle, 'position' | 'top' | 'left' | 'bottom' | 'right'>
>;
/**
* View style to be applied to the handle component.
*
* @type ViewStyle
* @default undefined
*/
handleStyle?: ViewStyle;
handleStyle?: StyleProp<ViewStyle>;
/**
* View style to be applied to the handle indicator component.
*
* @type ViewStyle
* @default undefined
*/
handleIndicatorStyle?: ViewStyle;
handleIndicatorStyle?: StyleProp<ViewStyle>;
/**
* Custom hook to provide pan gesture events handler, which will allow advance and
* customize handling for pan gesture.
Expand Down
6 changes: 3 additions & 3 deletions src/components/bottomSheetHandle/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type React from 'react';
import type { ViewStyle } from 'react-native';
import type { StyleProp, ViewStyle } from 'react-native';
import type Animated from 'react-native-reanimated';
import type { BottomSheetVariables } from '../../types';

Expand All @@ -11,13 +11,13 @@ export interface BottomSheetDefaultHandleProps extends BottomSheetHandleProps {
* @type Animated.AnimateStyle<ViewStyle> | ViewStyle
* @default undefined
*/
style?: ViewStyle | Animated.AnimateStyle<ViewStyle>;
style?: StyleProp<ViewStyle | Animated.AnimateStyle<ViewStyle>>;
/**
* View style to be applied to the handle indicator.
* @type Animated.AnimateStyle<ViewStyle> | ViewStyle
* @default undefined
*/
indicatorStyle?: ViewStyle | Animated.AnimateStyle<ViewStyle>;
indicatorStyle?: StyleProp<ViewStyle | Animated.AnimateStyle<ViewStyle>>;
/**
* Content to be added below the indicator.
* @type React.ReactNode | React.ReactNode[];
Expand Down

0 comments on commit 7fa1453

Please sign in to comment.