0.0.2 • Published 6 years ago

react-native-solinor-components v0.0.2

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

react-native-solinor-components

Common Components to be used in Solinor React Native projects. Instead of reinventing the wheel all the time, here are some components that can be reused freely.

Usage

Components are in a private repo, so you need to have access to Solinor org and Mobile dev group and have your ssh setup for github. Ask Juha Linnanen for access to Mobile dev group if necessary.

  • To install:
yarn add git+ssh://git@github.com:solinor/react-native-solinor-components.git#master
  • To use in a project:
import { SwipeConfirm } from 'react-native-solinor-components'

<SwipeConfirm
  bgColor={'#eeeeee'}
  buttonColor={'#333333'}
  text={'PAY 11,00 €'}
  onSwipeCompleted={ () => { window.alert('payment received!')} }
  />

Contributions

You may add new components, but need to make sure that they are:

  • Reusable
  • Flow-typed
  • Tested (if they include logic)
  • Document how-to use the component

Available Components

SwipeConfirm

Swipe Confirm

Swipeable button to confirm for example, payments. After user swipes over 55% away, it is considered a full swipe and will be animated to the end.

AttributeTypeDefaultDescription
heightnumber60Height of the whole component
widthnumber280Width of the whole component
bgColorcolor'#999999'Background color for the component
buttonColorcolor'#111111'Color of the swipeable round button
textstring''Text displayed in the center of the component
textColorcolor'#000000'Color of the text
iconSizenumber25> Icon size inside the button
iconColorcolor'#666666'> Icon color
disabledboolean'false'Makes swipe enable/disabled
onSwipeCompletedfunction() => {}Callback function, which gets called when swipe is completed.

ProgressiveImage

          <ProgressiveImage
            thumbnailSource={{uri: url}}
            imageSource={{uri: url}}
            placeHolderSource={require('../Images/placeholder-image.jpg')}
            style={imageStyle} />