How to use the native-base.ActionSheet.show function in native-base

To help you get started, we’ve selected a few native-base examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aaronksaunders / expo-rn-firebase-image-upload / screens / HomeScreen.js View on Github external
_pickImageSource() {
    try {
      ActionSheet.show({
        options: [
          "Take Photo", "Pick From Album", "Cancel"
        ],
        cancelButtonIndex: 2,
        title: "Testing ActionSheet"
      }, buttonIndex => {
        // this 'buttonIndex value is a string on android and number on ios :-(
        console.log(buttonIndex)
        if (buttonIndex + "" === '0') {
          this._pickImage(true)
        } else if (buttonIndex + "" === '1') {
          this._pickImage(false)
        } else {
          console.log('nothing')
        }
      })
github vobi-io / markdown-editor / editor / src / TextEditor.js View on Github external
handleImage = ({ row, index }) => () => {
    const { activeRowIndex, rows = [] } = this.state
    ActionSheet.show({
      options: ['Delete', 'Cancel'],
      cancelButtonIndex: 1,
      destructiveButtonIndex: 0,
      title: "Delete Image"
    }, i => {
      if (i === 0) {
        // this.changeRowType({ index: activeRowIndex, type: ROW_TYPES.TEXT })
        this.removeRow({ index, focusPrev: true })
      }
    })
  }
github daper / nextcloud-passwords-app / src / SingleView.js View on Github external
delete () {
    ActionSheet.show({
      options: ['Delete', 'Cancel'],
      cancelButtonIndex: 1,
      destructiveButtonIndex: 0,
      title: 'Do you really want to delete this entry?'
    },
    (buttonIndex) => {
      if (buttonIndex === 0) {
        Passwords.deleteItem(this.state.item.id)
          .then(() => this.goBack())
          .catch((err) => {
            if (__DEV__) console.log('err', err)
          })
      }
    })
  }
github syun0216 / goforeat / goforeat_app / app / RegisterView.js View on Github external
_showActionSheet = () => {
    ActionSheet.show(
      {
        options: BUTTONS,
        cancelButtonIndex: CANCEL_INDEX,
        destructiveButtonIndex: DESTRUCTIVE_INDEX,
        title: "選擇電話類型"
      },
      buttonIndex => {
        switch (BUTTONS[buttonIndex]) {
          case GLOBAL_PARAMS.phoneType.HK.label:
            this.setState({ selectedValue: GLOBAL_PARAMS.phoneType.HK });
            break;
          case GLOBAL_PARAMS.phoneType.CHN.label:
            this.setState({ selectedValue: GLOBAL_PARAMS.phoneType.CHN });
            break;
        }
      }
github yongqianvip / react-native-base-project / src / container / pm / iampm.js View on Github external
onPress={() =>
                  ActionSheet.show(
                    {
                      options: BUTTONS,
                      cancelButtonIndex: CANCEL_INDEX,
                      title: "Testing ActionSheet"
                    },
                    buttonIndex => {
                      this.setState({ clicked: BUTTONS[buttonIndex] });
                    }
                  )}
              >
github Mangeneh / akkaskhooneh-frontend / src / pages / signUpComplete / SignUpComplete.js View on Github external
text: strings(Strings.CAMERA),
        icon: 'camera',
        iconColor: Colors.ACCENT,
      },
      {
        text: strings(Strings.PHOTO_GALLERY),
        icon: 'flower',
        iconColor: Colors.BASE,
      },
      {
        text: strings(Strings.CANCEL),
        icon: 'close',
        iconColor: Colors.ICON,
      }];
    const CANCEL_INDEX = 2;
    ActionSheet.show({
      options: BUTTONS,
      cancelButtonIndex: CANCEL_INDEX,
    },
    (buttonIndex) => {
      if (buttonIndex === 0) {
        this.onOpenCameraPress();
      }
      if (buttonIndex === 1) {
        this.onChooseFromGalleryPress();
      }
    });
  }
github syun0216 / goforeat / goforeat_app / app / LoginView.js View on Github external
_showActionSheet = () => {
    ActionSheet.show(
      {
        options: BUTTONS,
        cancelButtonIndex: CANCEL_INDEX,
        destructiveButtonIndex: DESTRUCTIVE_INDEX,
        title: "選擇電話類型"
      },
      buttonIndex => {
        switch (BUTTONS[buttonIndex]) {
          case GLOBAL_PARAMS.phoneType.HK.label:
            this.setState({ selectedValue: GLOBAL_PARAMS.phoneType.HK });
            break;
          case GLOBAL_PARAMS.phoneType.CHN.label:
            this.setState({ selectedValue: GLOBAL_PARAMS.phoneType.CHN });
            break;
        }
      }
github GeekyAnts / NativeBase-KitchenSink / js / components / actionsheet / icon.js View on Github external
onPress={() =>
              ActionSheet.show(
                {
                  options: BUTTONS,
                  cancelButtonIndex: CANCEL_INDEX,
                  destructiveButtonIndex: DESTRUCTIVE_INDEX,
                  title: "Testing ActionSheet"
                },
                buttonIndex => {
                  this.setState({ clicked: BUTTONS[buttonIndex] });
                }
              )}
          >
github Mangeneh / akkaskhooneh-frontend / src / pages / profileEdit / ProfileEdit.js View on Github external
text: strings(Strings.CAMERA),
        icon: 'camera',
        iconColor: Colors.ACCENT,
      },
      {
        text: strings(Strings.PHOTO_GALLERY),
        icon: 'flower',
        iconColor: Colors.BASE,
      },
      {
        text: strings(Strings.CANCEL),
        icon: 'close',
        iconColor: Colors.ICON,
      }];
    const CANCEL_INDEX = 2;
    ActionSheet.show({
      options: BUTTONS,
      cancelButtonIndex: CANCEL_INDEX,
    },
    (buttonIndex) => {
      if (buttonIndex === 0) {
        this.onOpenCameraPress();
      }
      if (buttonIndex === 1) {
        this.onChooseFromGalleryPress();
      }
    });
  }