0.6.43 • Published 10 months ago

@quinninc/rn-core v0.6.43

Weekly downloads
-
License
ISC
Repository
-
Last release
10 months ago

Getting Started

Follow this README.md for getting started.

Note: Make sure you have completed the React Native - Environment Setup instructions till "Creating a new application" step, before proceeding.

Step 1: Install dependecies

First, you will need to install all the peer dependency.

# using npm
npm install @react-native-async-storage/async-storage @react-native-masked-view/masked-view react-native-linear-gradient react-native-skeleton-placeholder react-native-vector-icons react-native-video react-native-video-cache

# OR using Yarn
yarn @react-native-async-storage/async-storage @react-native-masked-view/masked-view react-native-linear-gradient react-native-skeleton-placeholder react-native-vector-icons react-native-video react-native-video-cache

cd ios && pod install

Note: Make sure you have completed all the packages setup for native android and ios for following packages.

  1. react-native-linear-gradient
  2. react-native-skeleton-placeholder
  3. react-native-vector-icons
  4. react-native-video
  5. @react-native-async-storage/async-storage
  6. react-native-video-cache

Step 2: Installing the SDK

Now you can install the package:

# using npm
npm install @quinninc/rn-core

# OR using Yarn
yarn add @quinninc/rn-core

Step 3: SDK Usage

Setting up the Widgets.

import React from 'react';
import { Modal } from 'react-native';
import {
	initApp,
	Carousel,
	Stories,
	Popup,
	Overlay,
	AppActions,
	getQuinnState
} from '@quinninc/rn-core';
import { getProductsById } from './ProductFetcher';

//Get config from Quinn admin portal
initApp({
	cdn: '', //shop CDN prefix
	shop_domain: '', //Shop domain
	shop_type: 'GENERAL'
});

AppActions.onFetchProductsById(getProductsById); //if shop_type is GENERAL, NOTE: define before app renders, this is optional

//url pathname /{page_type}/{page_id} for video pages in admin portal
setPage({
	page_type: 'INDEX', //products, collection, pages, empty for home page
	page_id: 'index', //ID of page
	page_handle: 'index' //my_product_handle, my_collection_handle, my_page_handle, empty for home page
});

function App() {
	const [overlayData, setOverlayData] = useState < (IOpenOverlayAction | null) > null;

	useEffect(() => {
		//implement function callbacks
		AppActions.onCartOpen(() => {
			console.log('Cart Open');
		});

		AppActions.onProductPageOpen((product) => {
			console.log('Product page Open', product);
		});

		AppActions.onAddToCart(async ({ product, variant }) => {
			console.log('Add to Cart', { product, variant });
		});

		AppActions.onOverlayOpen((data) => {
			setOverlayData(data);
		});

		AppActions.onOverlayClose(() => {
			setOverlayData(null);
		});

		AppActions.onCustomAction('CUSTOM_ACTION', async ({ payload }) => {
			const QuinnState = getQuinnState();
			console.log('Payload', payload);
		});
	}, []);

	return (
		<SafeAreaView>
			<Carousel layer={1} showLoader />

			<Stories layer={1} showLoader />

			<Popup layer={1} />

			<Modal animationType="slide" visible={!!overlayData} transparent>
				<Overlay data={overlayData} direction="vertical" />
			</Modal>
		</SafeAreaView>
	);
}
0.6.43

10 months ago

0.6.42

11 months ago

0.6.39

12 months ago

0.6.36

12 months ago

0.6.38

12 months ago

0.6.34

12 months ago

0.6.32

1 year ago

0.6.31

1 year ago

0.6.30

1 year ago

0.6.21

1 year ago

0.6.20

1 year ago

0.6.23

1 year ago

0.6.22

1 year ago

0.6.29

1 year ago

0.6.28

1 year ago

0.6.25

1 year ago

0.6.24

1 year ago

0.6.27

1 year ago

0.6.26

1 year ago

0.6.19

1 year ago

0.6.18

1 year ago

0.6.17

1 year ago

0.6.16

1 year ago

0.6.15

1 year ago

0.6.14

1 year ago

0.6.13

1 year ago

0.6.12

1 year ago

0.6.11

1 year ago

0.6.10

1 year ago

0.6.8

1 year ago

0.6.7

1 year ago

0.6.6

1 year ago

0.6.5

2 years ago

0.6.4

2 years ago

0.6.3

2 years ago

0.6.2

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.5.42

2 years ago

0.5.41

2 years ago

0.5.40

2 years ago

0.5.39

2 years ago

0.5.38

2 years ago

0.5.37

2 years ago

0.5.36

2 years ago

0.5.35

2 years ago

0.5.34

2 years ago

0.5.33

2 years ago

0.5.32

2 years ago

0.5.31

2 years ago

0.5.30

2 years ago

0.5.29

2 years ago

0.5.28

2 years ago

0.5.27

2 years ago

0.5.26

2 years ago

0.5.25

2 years ago

0.5.24

2 years ago

0.5.23

2 years ago

0.5.22

2 years ago

0.5.21

2 years ago

0.5.20

2 years ago

0.5.19

2 years ago

0.5.18

2 years ago

0.5.17

2 years ago

0.5.16

2 years ago

0.5.15

2 years ago

0.5.14

2 years ago

0.5.13

2 years ago

0.5.12

2 years ago

0.5.11

2 years ago

0.5.10

2 years ago

0.5.9

2 years ago

0.5.8

2 years ago

0.5.7

2 years ago

0.5.6

2 years ago

0.5.5

2 years ago

0.5.4

2 years ago

0.5.3

2 years ago

0.5.2

2 years ago

0.5.1

2 years ago

0.5.0

2 years ago

0.4.19

2 years ago

0.4.18

2 years ago

0.4.17

2 years ago

0.4.16

2 years ago

0.4.15

2 years ago

0.4.14

2 years ago

0.4.13

2 years ago

0.4.12

2 years ago

0.4.11

2 years ago

0.4.10

2 years ago

0.4.9

2 years ago

0.4.8

2 years ago

0.4.7

2 years ago

0.4.6

2 years ago

0.4.5

2 years ago

0.4.4

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.6

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago

0.0.20

2 years ago

0.0.19

2 years ago

0.0.18

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago