1.0.2 • Published 5 years ago

rn-easy-components v1.0.2

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

Gettings Started

rn-easy-components is package for simple/easy custom component react-native

Installation

visit this package at npmjs to install/show the doc.

npm i rn-easy-components --save

Components

* Container
* Button
* SweetAlert
* Loader

Usage

import React from 'react';
import {
    Text
} from 'react-native';
import { 
    Container, 
    Button, 
    SweetAlert,
    Loader 
} from 'rn-easy-components';

class MyApp extends React.Component {
    
    constructor() {
        super();
        this.state = {
            visible: false
        }
    }

    render() {
        return (
            <Container style={{ justifyContent: 'center' }}>
                <Loader visible={true} color="white" backgroundColor="grey" text="Please wait.."/>
                <SweetAlert 
                    type="danger" # danger|info|warning
                    visible={this.state.visible} # true|false -> value for hide/show
                    title="Warning!"
                    textDescription="Entah apa yang merasukimu"
                    onCancel={() => this.setState({ visible: false }) } # remove this line for hide cancel button
                    onConfirm={() => this.setState({ visible: false }) }

                /> 
                <Button style={{ alignSelf: 'center' }} onPress={() => this.setState({ visible: true }) }>
                    <Text style={{ color: 'white' }}>button</Text>
                </Button> 
            </Container>
        );
    }
}

export default MyApp;

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT