New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@fnzc/react-native-pages

Package Overview
Dependencies
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fnzc/react-native-pages

A component to handle transition between pages based on a list of ordered statuses

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
2
Weekly downloads
 
Created
Source

react-native-pages

npm

A component to handle transition between pages based on a list of ordered statuses

Using:

  • react-move for animations

Installation

npm install --save @fnzc/react-native-pages

or

yarn add @fnzc/react-native-pages

Demo

Here is how it can look like with a login/register flow example:

pages

Usage

Basic usage requires you to provide:

  • a currentStatus representing the current page
  • pages, an array of page
  • an array of statuses ordered

The pages will use the statuses ordered in the provided array to transition from left to right or right to left

NOTE: A page contains:

{
  associatedStatus: string,
  component: JSX.Element,
  style?: StypeProp<ViewStyle>
}

Example usage:

import Pages from '@fnzc/react-native-pages'

const orderedStatuses = ['email', 'login', 'password', 'finished', 'confirmed', 'loading']

createPages = (): Page[] => {
  return [
    {
      component: this.createPage(...),
      associatedStatus: 'email'
    },
    {
      component: this.createPage(...),
      associatedStatus: 'password' 
    },
    ...
  ]
}

<PagesComponent
  currentStatus={this.props.status}
  orderedStatuses={orderedStatuses}
  pages={this.createPages()}/>

Options

KeyDescriptionDefaultRequiredType
currentStatusName of the status associated to the current pageNonetruestring
pagesThe array of pages that have to be displayedPageNonetruePage[]
orderedStatusesThe array of ordered statuses use to transition the pagesNonetrueany[]
translateEnterDurationThe duration of the enter transition400falsenumber
translateEnterFunctionThe easing function of the enter transitioneaseQuadInOutfalse(normalizedTime: number) => number
translateEnterPositionThe position of the page on the enter transition0falsenumber
translateEndForwardPositionThe position of the page at the end of a forward transition-Dimensions.get('window').widthfalsenumber
translateEndBackwardPositionThe position of the page at the end of a backward transitionDimensions.get('window').widthfalsenumber
translateLeaveDurationThe duration of the enter transition400falsenumber
translateLeaveFunctionThe easing function of the enter transitioneaseQuadInOutfalse(normalizedTime: number) => number
translateStartForwardPositionThe position of the page at the start of a forward transitionDimensions.get('window').widthfalsenumber
translateStartBackwardPositionThe position of the page at the start of a backward transition-Dimensions.get('window').widthfalsenumber

Contributing

Pull requests are welcome.

Keywords

FAQs

Package last updated on 01 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc