npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-common-function1

v1.0.3

Published

provide common function

Downloads

17

Readme

react-native-common-function1

This project will check that app needs an update or not. It will do calculation based on version of App and will show a popup based on below 3 condition.

  • App needs a force update
  • App needs a update but with remind me later option
  • App is updated

Installation

$ npm install react-native-common-function1 --save

Usage

import { checkForVersion } from 'react-native-common-function1';

let options = {
    "current_version": "2",
    "release_note": "Today We have big app update, Please update app.",
    "last_force_update_version": "1",
    "release_date": "2019-12-31",
    "app_url": appUrl,
    "dateFormat":'DD-MM-YYYY',
}
checkForVersion(options);

Options

| Options | Usage | Required | Default Values | | ------ | ------ | ------ | ------ | | current_version | Current version of App | Yes | - | | release_note | Message that you want to show on dialog | Yes |- | | last_force_update_version | Last force update version | Yes |- | | release_date | Latest release date of App | Yes |- | | app_url | Platform specific app url | Yes |- | | style | Custom styles for dialog and its components | Optional |- | | dateFormat | Format of release date which will diaplay at top | Optional |DD-MM-YYYY hh:mm:ss | | update_btn_name | Text for update button | Optional |Update App | | remindMeLater_btn_name | Text for remind me later button | Optional |Remind Me Later | | closeBtnCallback | callback function for close button | Optional |- | | updateBtnCallback | callback function for update button | Optional |- | | remindMeBtnCallback | callback function for remind me later button | Optional |- |

How to redesign style ?

We can pass the styles prop to cover default style. See Example below.

import { checkForVersion } from 'react-native-app-version-force-update';

const styleobj = {
  titleText:{
    color: 'rgba(255,255,255,0.8)',
  },
  closeIcon:{
    tintColor:'white'
  }
};
let options = {
    "current_version": "2",
    "release_note": "Today We have big app update, Please update app.",
    "last_force_update_version": "1",
    "release_date": "2019-12-31",
    "app_url": Platform.OS === 'ios' ? iosUrl : androidUrl,
    "dateFormat":'DD-MM-YYYY',
    "style":styleobj,
}

checkForVersion(options);
Options for override style

| Style | Usage | | ------ | ------ | | modalContainer | Main container style | | mainContainer | Content of dialog style| | headerContainer | Header container style| | titleContainer | Title container style inside header | | titleText | Title text style | | descText | Description text style | | btnContainer | close button container style | | closeIcon | close icon style | | linkContainer | bottom button container style | | updateBt | update button style | | linkBtnUpdate | update button text style | | linkBtnRemindMeLater | remind me button text style |

Example check version popup