react-native-mba

0.1.2 • Public • Published

react-native-mba

React Native Components by MustBeApp

Works on iOS and Android.

Getting started

$ npm install react-native-mba --save

Expo example

Example

  • FacebookLogin
How to use
import { FacebookLogin }  from 'react-native-mba';
 
class MyComponent extends Component
{
    handleFacebookLogin()
    {
        const { fbLogin } = this.refs;
        fbLogin.loginWithFacebook(function(data) {
        setTimeout(function() {
            alert(JSON.stringify(data));
        }, 500);
        });
    }
 
    render()
    {
        <View>
            <TouchableOpacity onPress={this.handleFacebookLogin.bind(this)}>
                <Text>FacebookLogin</Text>
            </TouchableOpacity>
            <FacebookLogin ref="fbLogin" clientId="830435910451170" redirectUri="http://fb.mustbeapp.com/"/>
        </View>
    }
}
  • SelectListView
How to use
import { SelectListView }  from 'react-native-mba';
 
class MyComponent extends Component
{
    handleSelectListView()
    {
        const { selectList } = this.refs;
        selectList.openSelectionBox();
    }
 
    onItemPicked(item)
    {
        alert('Item picked:' + JSON.stringify(item));
    }
 
    render()
    {
        <View>
            <TouchableOpacity onPress={this.handleSelectListView.bind(this)}>
                <Text>SelectListView</Text>
            </TouchableOpacity>
            <SelectListView ref="selectList"
                  onItemSelected={this.onItemPicked}
                  selectionBoxStyle={styles.selectionBox}
                  data={[
                    { name: 'Item 0: React' },
                    { name: 'Item 1: Native' },
                    { name: 'Item 2: is' },
                    { name: 'Item 3: Awesome' },
                    { name: 'Item 4: React-Native-Mba' },
                    { name: 'Item 5: Another one' },
                  ]}
                  placeholder="select list view" />
        </View>
    }
}

Package Sidebar

Install

npm i react-native-mba

Weekly Downloads

2

Version

0.1.2

License

MIT

Last publish

Collaborators

  • vramosx