forked from beefe/react-native-actionsheet
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #4
- Loading branch information
Alessio Cancian
committed
Mar 10, 2021
1 parent
c2e3d12
commit f09ce5d
Showing
1 changed file
with
44 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,52 @@ | ||
import { Component } from 'react'; | ||
|
||
interface Props { | ||
options: (string | React.ReactNode)[]; | ||
onPress: (index: number) => void; | ||
title?: string; | ||
message?: string; | ||
tintColor?: string; | ||
cancelButtonIndex?: number; | ||
destructiveButtonIndex?: number; | ||
styles?: object; | ||
import React, { Component } from 'react'; | ||
import { TextStyle, ViewStyle } from 'react-native'; | ||
|
||
type Props = { | ||
options: string[]; | ||
onPress: (index: number) => void; | ||
title?: string; | ||
message?: string; | ||
tintColor?: string; | ||
cancelButtonIndex?: number; | ||
destructiveButtonIndex?: number; | ||
/** | ||
* Only for Android or ActionSheetCustom | ||
*/ | ||
styles?: { | ||
titleBox?: ViewStyle, | ||
titleText?: TextStyle, | ||
|
||
messageBox?: ViewStyle, | ||
messageText?: TextStyle, | ||
|
||
buttonText?: TextStyle, | ||
buttonBox?: ViewStyle, | ||
cancelButtonBox?: ViewStyle, | ||
|
||
overlay?: TextStyle, | ||
wrapper?: ViewStyle, | ||
body?: ViewStyle, | ||
}; | ||
} | ||
|
||
type ActionSheetProps = Props & { | ||
/** | ||
* iOS only, change default theme | ||
* @default system theme color | ||
*/ | ||
userInterfaceStyle?: "light" | "dark" | ||
} | ||
|
||
export default class ActionSheet extends Component<Props> { | ||
public show: () => void; | ||
export default class ActionSheet extends Component<ActionSheetProps> { | ||
public show: () => void; | ||
} | ||
|
||
type ActionSheetCustomProps = Props | { | ||
title?: string | React.ReactNode | ||
message?: string | React.ReactNode | ||
options: (string | React.ReactChild)[] | ||
} | ||
|
||
export class ActionSheetCustom extends Component<ActionSheetCustomProps> { | ||
public show: () => void; | ||
} |