mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
[@types/react-native-actionsheet] Add missing ActionSheetCustom (#37240)
* [@types/react-native-actionsheet] Add missing ActionSheetCustom * Add missing buttonUnderlayColor
This commit is contained in:
parent
7befb82fde
commit
0278a498f7
17
types/react-native-actionsheet/index.d.ts
vendored
17
types/react-native-actionsheet/index.d.ts
vendored
@ -7,16 +7,31 @@
|
||||
import * as React from 'react';
|
||||
|
||||
export interface ActionSheetProps {
|
||||
options: React.ReactNode[];
|
||||
options: string[];
|
||||
onPress: (index: number) => void;
|
||||
title?: string;
|
||||
message?: string;
|
||||
tintColor?: string;
|
||||
cancelButtonIndex?: number;
|
||||
destructiveButtonIndex?: number;
|
||||
}
|
||||
|
||||
export interface ActionSheetCustomProps {
|
||||
options: React.ReactNode[];
|
||||
onPress: (index: number) => void;
|
||||
title?: React.ReactNode;
|
||||
message?: string;
|
||||
tintColor?: string;
|
||||
buttonUnderlayColor?: string;
|
||||
cancelButtonIndex?: number;
|
||||
destructiveButtonIndex?: number;
|
||||
styles?: object;
|
||||
}
|
||||
|
||||
export default class ActionSheet extends React.Component<ActionSheetProps> {
|
||||
show: () => void;
|
||||
}
|
||||
|
||||
export class ActionSheetCustom extends React.Component<ActionSheetCustomProps> {
|
||||
show: () => void;
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import * as React from 'react';
|
||||
import ActionSheet from 'react-native-actionsheet';
|
||||
import { Text } from 'react-native';
|
||||
import ActionSheet, { ActionSheetCustom } from 'react-native-actionsheet';
|
||||
|
||||
class Example extends React.Component {
|
||||
render() {
|
||||
@ -12,6 +13,29 @@ class Example extends React.Component {
|
||||
tintColor="white"
|
||||
cancelButtonIndex={0}
|
||||
destructiveButtonIndex={1}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class CustomSheetExample extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<ActionSheetCustom
|
||||
options={[
|
||||
'Cancel',
|
||||
'Apple',
|
||||
<Text style={{ color: 'yellow' }}>Banana</Text>,
|
||||
'Watermelon',
|
||||
<Text style={{ color: 'red' }}>Durian</Text>,
|
||||
]}
|
||||
onPress={index => {}}
|
||||
title={<Text style={{ color: '#000', fontSize: 18 }}>Which one do you like?</Text>}
|
||||
message="Test"
|
||||
tintColor="white"
|
||||
buttonUnderlayColor="rebeccapurple"
|
||||
cancelButtonIndex={0}
|
||||
destructiveButtonIndex={1}
|
||||
styles={{}}
|
||||
/>
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user