DefinitelyTyped/types/react-native-actionsheet/react-native-actionsheet-tests.tsx
Krister Kari 0278a498f7 [@types/react-native-actionsheet] Add missing ActionSheetCustom (#37240)
* [@types/react-native-actionsheet] Add missing ActionSheetCustom

* Add missing buttonUnderlayColor
2019-08-01 12:38:05 -07:00

44 lines
1.3 KiB
TypeScript

import * as React from 'react';
import { Text } from 'react-native';
import ActionSheet, { ActionSheetCustom } from 'react-native-actionsheet';
class Example extends React.Component {
render() {
return (
<ActionSheet
options={['1', '2', '3']}
onPress={index => {}}
title="Test"
message="Test"
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={{}}
/>
);
}
}