import React, { Component } from 'react'
import { StyleSheet, View, Text, Image } from 'react-native'
import { ScrollView } from 'react-native-gesture-handler';
import { height, px2dp, width } from '../../utils/base';

export interface Props {

}

export interface State {

}

export default class ActionSheetTest extends React.Component<Props, State> {
    constructor(props: Props | Readonly<Props>) {
        super(props);

    }
    componentDidMount() {

    }

    componentWillUnmount() {
    }

    public readonly state: Readonly<State> = {

    }

    public ActionSheet = null

    show = () => {
        this.ActionSheet.show()
    }


    render() {
        return (
            <ScrollView style={{ flex: 1, width: width, height: height, backgroundColor: "red" }}>
                <Text onPress={this.show}>Open ActionSheet</Text>
                <ActionSheet
                    ref={o => this.ActionSheet = o}
                    title={'Which one do you like ?'}
                    options={['Apple', 'Banana', 'a', 'b', 'c', '关闭']}
                    cancelButtonIndex={2}
                    destructiveButtonIndex={1}
                    onPress={(index) => { /* do something */ }}
                    style={{ height: px2dp(700) }}
                />
            </ScrollView>
        );

    }
}
const styles = StyleSheet.create({
    main: {

    }
})