Skip to content

Commit 7710058

Browse files
committed
add utils, update package.json
1 parent b0dd8bb commit 7710058

File tree

5 files changed

+33
-31
lines changed

5 files changed

+33
-31
lines changed

index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './src/ActionSheet';
2+
export * from './src/utils';

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "react-native-actionsheet-cstm",
33
"version": "0.0.2",
44
"description": "Custom ActionSheet for React Native",
5-
"main": "/src/index.tsx",
5+
"main": "index.tsx",
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1"
88
},

src/ActionSheet.tsx

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,11 @@ import {
66
View,
77
Text,
88
Animated,
9-
StyleProp,
10-
ViewStyle,
119
} from 'react-native';
1210

11+
import {ActionSheetProps} from './utils';
1312
import st from './style';
1413

15-
export interface ActionItem {
16-
textStyle?: StyleProp<ViewStyle>;
17-
18-
// Default Action Sheet Provided
19-
text: string;
20-
onPress: () => void;
21-
}
22-
23-
export interface ActionSheetProps {
24-
onShow?: () => void;
25-
onDismiss?: () => void;
26-
backdropStyle?: StyleProp<ViewStyle>;
27-
containerStyle?: StyleProp<ViewStyle>;
28-
titleContainerStyle?: StyleProp<ViewStyle>;
29-
title?: string;
30-
titleTextStyle?: StyleProp<ViewStyle>;
31-
cancelButtonStyle?: StyleProp<ViewStyle>;
32-
cancelText?: string;
33-
cancelTextStyle?: StyleProp<ViewStyle>;
34-
hiddeCancel?: boolean;
35-
36-
// Default Action Sheet Provided
37-
visible: boolean;
38-
onClose: () => void;
39-
actionItems: Array<ActionItem>;
40-
}
41-
4214
export const ActionSheet: React.FC<ActionSheetProps> = props => {
4315
const top = new Animated.Value(100);
4416
const hiddeCancel: boolean = props.hiddeCancel || false;

src/index.tsx

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/utils.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import React from 'react';
2+
import {StyleProp, ViewStyle} from 'react-native';
3+
4+
export interface ActionItem {
5+
textStyle?: StyleProp<ViewStyle>;
6+
7+
// Default Action Sheet Provided
8+
text: string;
9+
onPress: () => void;
10+
}
11+
12+
export interface ActionSheetProps {
13+
onShow?: () => void;
14+
onDismiss?: () => void;
15+
backdropStyle?: StyleProp<ViewStyle>;
16+
containerStyle?: StyleProp<ViewStyle>;
17+
titleContainerStyle?: StyleProp<ViewStyle>;
18+
title?: string;
19+
titleTextStyle?: StyleProp<ViewStyle>;
20+
cancelButtonStyle?: StyleProp<ViewStyle>;
21+
cancelText?: string;
22+
cancelTextStyle?: StyleProp<ViewStyle>;
23+
hiddeCancel?: boolean;
24+
25+
// Default Action Sheet Provided
26+
visible: boolean;
27+
onClose: () => void;
28+
actionItems: Array<ActionItem>;
29+
}

0 commit comments

Comments
 (0)