Skip to content

codedlines/throttles

Repository files navigation

throttles

React native services and components library

Installation

npm install throttles

or

yarn add throttles

Peer dependencies

Install these libraries to your local project

library version tested
react-native-toasty 1.0.1
@react-native-community/geolocation 2.0.2
@react-native-mapbox-gl/maps 8.1.0-rc.2
react-native-elements 2.0.4
react-native-permissions 2.1.5
@react-native-community/async-storage 1.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