2.0.6 • Published 3 years ago

react-native-baochau v2.0.6

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Information

Create by NGUYEN PHUC BAO CHAU

Date: 19/03/2021

Requirements

Install vector-icons

npm install react-native-vector-icons

Link vector-icons to your project

npx react-native link

Installation

npm i react-native-baochau

Version 1.0

Add Header and scale Sizes

Usage

import React from 'react';
import { View, Text } from 'react-native';
import {Header, Sizes} from 'react-native-header-baochau9xx';

export default class Home extends React.Component {
  render() {
    return (
      <View style={{ flex: 1 }}>
        <Header
          title={'This is header'}
          iconLeft={'chevron-back'}  // Ionicons (vector-icons)
          iconRight={'plus'}  // Octicons (vector-icons)
          colorTitle={'red'}
          colorIcon={'green'}
          colorBackground={'yellow'}
          headerSize={Sizes.h100}
          onPressLeft={() => console.log('Click left')}
          onPressRight={() => console.log('Click Right')}
        />
        <View style={{ flex: 1, alignItems: 'center' }}>
          <View style={{ flex: 1, flexDirection: 'row', alignItems: 'center' }}>
            <Text style={{ fontSize: 18 }}>Running..</Text>
          </View>
        </View>
      </View>
    );
  }
}

Available props

NameTypeDefaultDescription
colorBackgroundcolor'#fff'Color background of header
colorTitlecolor'#555555'Color of title (text center)
colorIconcolor'#d4d5d8'Color of icon left and right
titlestringThis is titleTitle of header (screen name)
headerSizenumberScale 100Size (height) of header
iconLeftIoniconsIcon in left of header (Ionicons)
iconRightOcticonsIcon in right of header (Octicons)
onPressLeftfunctionWhen click left icon
onPressRightfunctionWhen click right icon

Version 2.0

Add some function

Usage

import {plus, saveToStorage, getFromStorage, randomNonRepeat} from 'react-native-baochau';

usePlus() {
  var a = 0;
  var b = 0;

  return plus(a, b);
}

useSaveToStorage() {
  saveToStorage('name', 'value');
}

async useGetFromStorage() {
  var data = await getFromStorage('name');
}

useRandomNonRepeat() {
  var data = randomNonRepeat(10); // random 0 - 10
}

About me

Facebook: My Facebook

Linkedin: My Linkedin

2.0.6

3 years ago

2.0.5

3 years ago

2.0.3

3 years ago

2.0.4

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago