0.6.17 • Published 1 day ago

@quinninc/rn-core v0.6.17

Weekly downloads
-
License
ISC
Repository
-
Last release
1 day 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

# 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

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

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.17

1 day ago

0.6.16

2 days ago

0.6.15

6 days ago

0.6.14

16 days ago

0.6.13

16 days ago

0.6.12

17 days ago

0.6.11

24 days ago

0.6.10

1 month ago

0.6.8

2 months ago

0.6.7

2 months ago

0.6.6

2 months ago

0.6.5

3 months ago

0.6.4

3 months ago

0.6.3

3 months ago

0.6.2

3 months ago

0.6.1

3 months ago

0.6.0

5 months ago

0.5.42

5 months ago

0.5.41

5 months ago

0.5.40

5 months ago

0.5.39

6 months ago

0.5.38

6 months ago

0.5.37

6 months ago

0.5.36

6 months ago

0.5.35

6 months ago

0.5.34

6 months ago

0.5.33

7 months ago

0.5.32

7 months ago

0.5.31

7 months ago

0.5.30

7 months ago

0.5.29

7 months ago

0.5.28

7 months ago

0.5.27

7 months ago

0.5.26

8 months ago

0.5.25

8 months ago

0.5.24

8 months ago

0.5.23

8 months ago

0.5.22

8 months ago

0.5.21

8 months ago

0.5.20

8 months ago

0.5.19

8 months ago

0.5.18

8 months ago

0.5.17

8 months ago

0.5.16

8 months ago

0.5.15

8 months ago

0.5.14

8 months ago

0.5.13

8 months ago

0.5.12

8 months ago

0.5.11

8 months ago

0.5.10

8 months ago

0.5.9

8 months ago

0.5.8

8 months ago

0.5.7

8 months ago

0.5.6

8 months ago

0.5.5

8 months ago

0.5.4

8 months ago

0.5.3

8 months ago

0.5.2

8 months ago

0.5.1

8 months ago

0.5.0

8 months ago

0.4.19

8 months ago

0.4.18

8 months ago

0.4.17

9 months ago

0.4.16

9 months ago

0.4.15

9 months ago

0.4.14

9 months ago

0.4.13

9 months ago

0.4.12

9 months ago

0.4.11

9 months ago

0.4.10

9 months ago

0.4.9

9 months ago

0.4.8

9 months ago

0.4.7

9 months ago

0.4.6

9 months ago

0.4.5

9 months ago

0.4.4

9 months ago

0.4.3

9 months ago

0.4.2

9 months ago

0.4.1

9 months ago

0.4.0

9 months ago

0.3.2

9 months ago

0.3.1

9 months ago

0.3.0

9 months ago

0.2.6

9 months ago

0.2.5

9 months ago

0.2.4

9 months ago

0.2.3

9 months ago

0.2.2

9 months ago

0.2.1

9 months ago

0.2.0

9 months ago

0.1.0

9 months ago

0.0.20

10 months ago

0.0.19

10 months ago

0.0.18

10 months ago

0.0.17

10 months ago

0.0.16

10 months ago

0.0.15

10 months ago

0.0.14

10 months ago

0.0.13

10 months ago

0.0.12

10 months ago

0.0.11

10 months ago

0.0.10

10 months ago

0.0.8

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago