How to use native-base - 10 common examples

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 transistorsoft / rn-background-geolocation-demo / src / advanced / SettingsView.tsx View on Github external
Platform,
} from 'react-native';

import {
  Container,
  Button, Icon,
  Text,
  Header, Title,
  Content,
  Left, Body, Right,
  Form, Label, Input, Picker, Switch,
  Item as FormItem,
  Spinner
} from 'native-base';

const Item = Picker.Item;

////
// Import BackgroundGeolocation plugin
// Note: normally you will not specify a relative url ../ here.  I do this in the sample app
// because the plugin can be installed from 2 sources:
//
// 1.  npm:  react-native-background-geolocation
// 2.  private github repo (customers only):  react-native-background-geolocation-android
//
// This simply allows one to change the import in a single file.
import BackgroundGeolocation, {
  State,
  DeviceSettingsRequest
} from "../react-native-background-geolocation";

import SettingsService from './lib/SettingsService';
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 Bit-Nation / BITNATION-Pangea-mobile / src / PangeaCommonReactNative / UI / ArrowButton.js View on Github external
onPress={onPress}
    >

      
      {/*  */}

    
  ));
};

Button.defaultProps = {
  style: undefined,
  enabled: true,
  onPress: () => null,
  title: '',
};

export default ArrowButton;
github Cosecha / redadalertas / src / screens / Events / EventsMap.js View on Github external
async populateMap(newEvent) {
    try {
      await this.props.getEvents();
      if (this.props.errors.event) throw this.props.errors.event;
      if (newEvent) this.focusMarker(newEvent);
      Toast.show({
        buttonText: "OK",
        text: "Events fetched successfully.",
        type: "success"
      });
    } catch (error) {
      console.log("Error rendering map: ", error);
      Toast.show({
        buttonText: "OK",
        text: "Error rendering map.",
        type: "danger"
      });
    }
  }
github Space-Cowboy-2018 / AR-Shooter-FrontEnd / screens / AllRooms.js View on Github external
createRoom() {
    let navigate = this.props.navigation.navigate;
    if (this.state.name) {
      const roomName = this.state.name;
      const playerName = this.props.navigation.state.params.playerName;
      socket.emit(CREATE_ROOM, roomName, playerName);
      this.setState({ name: '' });
      navigate('Lobby', { room: this.state.name, playerName });
    } else {
      Toast.show({
        text: 'Please Enter Room Name!',
        buttonText: 'Okay'
      });
    }
  }
  handleChange(text) {
github Space-Cowboy-2018 / AR-Shooter-FrontEnd / screens / rooms.js View on Github external
createRoom() {
    if (this.state.name) {
      this.props.navigation.state.params.socket.emit(
        'createRoom',
        this.state.name
      );
      Toast.show({
        text: 'Room Created!',
        position: 'top',
        buttonText: 'Okay'
      });
    } else {
      Toast.show({
        text: 'Please Enter Room Name!',
        buttonText: 'Okay'
      });
    }
  }
  handleChange(text) {
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 Cosecha / redadalertas / src / screens / Settings / ChangePassword.js View on Github external
}
      const response = await userServices.put(data);
      if (response instanceof Error) throw response;

      const loginResponse = await authServices.login({
        username: response.data.email,
        password: values.newPassword2
      });
      if (loginResponse instanceof Error) throw new Error("Error logging in with new password.");

      asyncStore.save("user", JSON.stringify(loginResponse));
      this.clearForm(resetForm);
      this.props.navigation.navigate("SettingsPage", {
        refresh: true
      });
      Toast.show({
        buttonText: "OK",
        text: "Password change successful.",
        type: "success"
      });
    } catch (error) {
      Toast.show({
        buttonText: "OK",
        text: "Error changing password: " + (error.message || error),
        type: "danger"
      });
    }
  };