2.20.25 • Published 2 days ago

@quintype/native-components v2.20.25

Weekly downloads
713
License
-
Repository
-
Last release
2 days ago

@quintype/native-components

Getting started

$ npm install @quintype/native-components --save

Linking

This library has both js only as well as native components. Please check the instructions for the respective components for more details.

Components

ResponsiveImage Header PrimaryStoryCard SecondaryStoryCard CollectionTitle CollectionCard WebView Tabs 

ResponsiveImage

This component takes an image, and resizes it to the correct aspect ratio using imgix or thumbor.

import { ResponsiveImage, getScreenPercentageWidth } from "@quintype/native-components";

<ResponsiveImage
  cdn={CDN}
  style={style.image}
  imageWidth={getScreenPercentageWidth(20)}
  slug={SLUG}
  metadata={META_DATA}
/>;
Props
resizeMode: Image.propTypes.resizeMode,
slug: PropTypes.string.isRequired,
cdn: PropTypes.string.isRequired,
style: Image.propTypes.style,
imageWidth: PropTypes.number
Setup

This component uses FastImage under the hood.

npm install react-native-fast-image
cd ios/ && pod install

If the current react-native version is >60.4,

and building the app should be enough for it to work. For versions <60.4, please run

react-native link react-native-fast-image

Header

Header component for the app. The header and title can be styled using the style and titleStyle props respectively.

import { Header } from "@quintype/native-components";

<Header
  title="BAR & BENCH"
  rightComponent={
    <TouchableOpacity>
      <Icon name="bell" size={26} color="#FFF" />
    </TouchableOpacity>
  }
/>;
Props
rightComponent: PropTypes.element,
style: ViewStyle,
title: PropTypes.string.isRequired,
titleStyle: TextStyle

PrimaryStoryCard

PrimaryStoryCard component for the app. onPress event available to navigate or perform other functionality. Takes story as a prop.

import { PrimaryStoryCard, getScreenPercentageWidth } from "@quintype/native-components";

<PrimaryStoryCard
  onPress={() => /* Do something */}
  cdn={cdn}
  story={story}
  imageWidth={getScreenPercentageWidth(100)}
/>
Props
cdn: PropTypes.string.isRequired,
imageStyle: Image.style,
imageWidth: PropTypes.number,
headlineStyle: TextStyle,
dividerStyle: ViewStyle,
authorTextStyle: TextStyle,
story: PropTypes.any.isRequired

SecondaryStoryCard

SecondaryStoryCard component for the app. onPress event available to navigate or perform other functionality. Takes story as a prop.

import { SecondaryStoryCard, getScreenPercentageWidth } from "@quintype/native-components";

<SecondaryStoryCard
  onPress={() => /* Do something */}
  cdn={cdn}
  story={story}
  imageWidth={getScreenPercentageWidth(40)}
/>
Props
cdn: PropTypes.string.isRequired,
imageStyle: Image.style,
imageWidth: PropTypes.number,
headlineStyle: TextStyle,
dateTextStyle: TextStyle,
story: PropTypes.any.isRequired

CollectionTitle

Component for displaying the title of a collection. Needs a title prop.

import { CollectionTitle } from "@quintype/native-components";

<CollectionTitle
  title={collectionName}
  onPress={() => /* Do something */}
/>
Props
TouchableOpacityProps &
  {
    title: PropTypes.string.isRequired,
    titleStyle: TextStyle,
    indicatorStyle: ViewStyle
  };

CollectionCard

Component which puts together PrimaryStoryCard, SecondaryStoryCard and CollectionTitle to display a collection. It needs prop stories which takes an array of stories in a collection. Has callback onStoryPress which provides the story it was clicked on.

import { CollectionCard } from "@quintype/native-components";

<CollectionCard
  onCollectionPress={() => /* Do something */}
  cdn={cdn}
  collectionName={name}
  stories={stories}
  onStoryPress={story =>  /* console.log(story) */}
/>
Props
cdn: PropTypes.string.isRequired,
collectionName: PropTypes.string.isRequired,
stories: PropTypes.array.isRequired,
onCollectionPress: PropTypes.func,
onStoryPress: PropTypes.func

WebView

Component for displaying static webpages in a WebView. Uses this package. All the props of the package can be used with this component.

import { WebView } from "@quintype/native-components";

<WebView
  source={{ uri: "https://ace-web.qtstage.io/static-pages/about-us" }}
  closeButton={
    <TouchableOpacity>
      <Icon name="close" size={26} color="#FFF" />
    </TouchableOpacity>
  }
/>;
Props
WebViewProps &
  {
    closeButton: PropTypes.element
  };
Setup
npm install react-native-webview
cd ios/ && pod install

If the current react-native version is >60.4,

and building the app should be enough for it to work. For versions <60.4, please run

react-native link react-native-webview

Tabs

Tabs component. Please refer to the docs here.

2.21.0-beta.2

2 days ago

2.21.0-beta.0

3 days ago

2.21.0-beta.1

3 days ago

2.20.26

1 month ago

2.20.25

2 months ago

2.20.24

2 months ago

2.20.23

2 months ago

2.20.22

2 months ago

2.20.21

3 months ago

2.20.20

3 months ago

2.20.19

4 months ago

2.20.18

5 months ago

2.20.10

9 months ago

2.20.13

7 months ago

2.20.14

7 months ago

2.20.11

9 months ago

2.20.12

8 months ago

2.20.17

6 months ago

2.20.15

7 months ago

2.20.16

6 months ago

2.20.8

10 months ago

2.20.9

10 months ago

2.20.6

11 months ago

2.20.7

11 months ago

2.20.5

1 year ago

2.20.3

1 year ago

2.20.4

1 year ago

2.19.28

1 year ago

2.20.2

1 year ago

2.20.0

1 year ago

2.20.1

1 year ago

2.19.26

1 year ago

2.19.27

1 year ago

2.19.20

1 year ago

2.19.21

1 year ago

2.19.19

2 years ago

2.19.17

2 years ago

2.19.18

2 years ago

2.19.16

2 years ago

2.19.14

2 years ago

2.19.15

2 years ago

2.19.8

2 years ago

2.19.9

2 years ago

2.19.6

2 years ago

2.19.7

2 years ago

2.19.11

2 years ago

2.19.12

2 years ago

2.19.5

2 years ago

2.19.3

3 years ago

2.19.2

3 years ago

2.19.0

3 years ago

2.19.1

3 years ago

2.18.3

3 years ago

2.18.4

3 years ago

2.18.2

3 years ago

2.18.1

3 years ago

2.17.4

3 years ago

2.17.3

3 years ago

2.17.2

3 years ago

2.17.0

3 years ago

2.17.1

3 years ago

2.16.14

3 years ago

2.16.11

3 years ago

2.16.13

3 years ago

2.16.12

3 years ago

2.16.10

3 years ago

2.16.9

3 years ago

2.16.8

3 years ago

2.16.6

3 years ago

2.16.4

3 years ago

2.16.3

3 years ago

2.16.2

3 years ago

2.16.1

3 years ago

2.16.0

3 years ago

2.15.5

3 years ago

2.15.4

3 years ago

2.15.3

3 years ago

2.15.2

3 years ago

2.15.1

3 years ago

2.15.0

3 years ago

2.14.19

3 years ago

2.14.18

4 years ago

2.14.17

4 years ago

2.14.16

4 years ago

2.14.13

4 years ago

2.14.9

4 years ago

2.14.8

4 years ago

2.14.7

4 years ago

2.14.5

4 years ago

2.14.3

4 years ago

2.14.1

4 years ago

2.14.2

4 years ago

2.14.0

4 years ago

2.14.0-detox.3

4 years ago

2.13.6-detox.0

4 years ago

2.14.0-detox.2

4 years ago

2.14.0-detox.1

4 years ago

2.14.0-detox.0

4 years ago

2.13.5

4 years ago

2.13.4

4 years ago

2.14.0-paywall.0

4 years ago

2.13.3

4 years ago

2.13.2

4 years ago

2.13.1

4 years ago

2.13.0

4 years ago

2.12.0

4 years ago

2.11.0

4 years ago

2.10.2

4 years ago

2.9.1-yt-fix.0

4 years ago

2.10.1

4 years ago

2.10.0

4 years ago

2.9.0

4 years ago

2.8.5

4 years ago

2.8.3

4 years ago

2.8.4

4 years ago

2.8.2

4 years ago

2.8.1

4 years ago

2.7.24

4 years ago

2.7.23

4 years ago

2.7.22

4 years ago

2.7.21

4 years ago

2.7.20

4 years ago

2.7.19

4 years ago

2.7.18

4 years ago

2.7.17

4 years ago

2.7.16

4 years ago

2.7.15

4 years ago

2.7.14

4 years ago

2.7.13

4 years ago

2.7.12

4 years ago

2.7.11

4 years ago

2.7.10

4 years ago

2.7.9

4 years ago

2.7.8

4 years ago

2.7.7

4 years ago

2.7.6

4 years ago

2.7.5

4 years ago

2.7.4

4 years ago

2.7.3

4 years ago

2.7.2

4 years ago

2.7.1

4 years ago

2.7.0

4 years ago

2.6.1

4 years ago

2.6.0

4 years ago

2.5.1

4 years ago

2.5.0

4 years ago

2.4.0

4 years ago

2.3.2

4 years ago

2.3.1

4 years ago

2.3.0

4 years ago

2.2.5

4 years ago

2.2.4

4 years ago

2.2.3

4 years ago

2.2.2

4 years ago

2.2.1

4 years ago

2.2.0

4 years ago

2.1.0

4 years ago

2.0.1

4 years ago

2.0.2-mediaone.0

4 years ago

1.11.4

4 years ago

1.11.3

4 years ago

1.11.3-wanifra.1

4 years ago

1.11.3-wanifra.2

4 years ago

1.11.3-wanifra.0

4 years ago

1.11.2

4 years ago

1.11.1

4 years ago

1.11.0

4 years ago

1.11.0-jsembed.4

4 years ago

1.11.0-jsembed.3

4 years ago

1.11.0-jsembed.2

4 years ago

1.10.1

4 years ago

1.11.0-jsembed.1

4 years ago

1.11.0-jsembed.0

4 years ago

1.10.0

4 years ago

1.9.3

4 years ago

1.9.2

4 years ago

1.9.1

4 years ago

1.9.0

4 years ago

1.8.17

4 years ago

1.8.18-tabs.0

4 years ago

1.8.16

4 years ago

1.8.15

4 years ago

1.8.10

4 years ago

1.8.9

4 years ago

1.8.8

4 years ago

1.8.7

4 years ago

1.8.6

4 years ago

1.8.5

4 years ago

1.8.4

4 years ago

1.8.3

4 years ago

1.8.2

4 years ago

1.8.1

4 years ago

1.8.0

4 years ago

1.7.3

4 years ago

1.7.2

4 years ago

1.7.1

4 years ago

1.7.0

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.1

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.11

4 years ago

1.2.10

4 years ago

1.2.9

4 years ago

1.2.8

4 years ago

1.2.7

4 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago

1.0.1

5 years ago

0.0.1

5 years ago