0.2.7 • Published 4 years ago

@coded-lines/throttles v0.2.7

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

throttles

React native services and components library

Installation

npm install throttles

or

yarn add throttles

Peer dependencies

Install these libraries to your local project

libraryversion tested
react-native-toasty1.0.1
@react-native-community/geolocation2.0.2
@react-native-mapbox-gl/maps8.1.0-rc.2
react-native-elements2.0.4
react-native-permissions2.1.5
@react-native-community/async-storage1.11.0

Usage

Toast

import {Toast} from "@coded-lines/throttles";

// ...

Toast.showToastShortCenter('message');
Toast.showToastLongCenter('message');

Terms and conditions

import { TermsAndConditions } from '@coded-lines/throttles';

// ...

function TnC() {
  return (
    <TermsAndConditions
      text={TERMS_AND_CONDITIONS}
      onAccept={() => console.log('ok')}
    />
  );
}

Map with directions

Add this in App.tsx to initialize mapbox

import { MapBoxClient } from '@coded-lines/throttles';

MapBoxClient.initMapbox(MAPBOX_GL_ACCESS_TOKEN);

Component usage example

import { MapDirections } from '@coded-lines/throttles';

function MwD() {
  return <MapDirections storeLocation={STORE_LOCATION} />;
}

Ways of contact

import { Contact } from '@coded-lines/throttles';

function Cnt() {
  const onLocationClick = ...

  return (
    <Contact
      onLocationClick={onLocationClick}
      phoneNumber={PHONE_NUMBER}
      locationText={LOCATION_TEXT}
    />
  );
}

Gdpr

import { GdprList } from '@coded-lines/throttles';

function Gdpr() {
  return <GdprList listData={getGdprListData().privacyCenter} />;
}

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT