1.0.5 • Published 7 years ago

react-native-compassites-commons v1.0.5

Weekly downloads
31
License
-
Repository
-
Last release
7 years ago

react-native-compassites-commons

Getting started

$ npm install react-native-compassites-commons --save

Mostly automatic installation

$ react-native link react-native-compassites-commons

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-compassites-commons and add RNCompassitesCommons.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNCompassitesCommons.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.reactlibrary.RNCompassitesCommonsPackage; to the imports at the top of the file
  • Add new RNCompassitesCommonsPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-compassites-commons'
    project(':react-native-compassites-commons').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-compassites-commons/android')
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-compassites-commons')

Usage

import RNCompassitesCommons from 'react-native-compassites-commons';

// TODO: What to do with the module?
RNCompassitesCommons;

##Loader

NameDescriptionTypeDefault
textText to be displayed below the loaderString
textSizeSize of the text to be displayedNumber24
textColorText colorColor#000
colorColor of the loaderColorteal
loaderSizeLoader siNumber24
backgroundColorLoader and text background colorColortransparent
fullScreenTrue if the loader should mask the entire screen, False if the loader should take only the component sizeBooleanfalse
imageIf you need a gif in place of the default spinner, pass the urlurl

##Textfield ####Supports all props of react-native TextInput, along with that, the following

NameDescriptionTypeDefault
animationDurationLabel animationsNumber225
fontSizeUser input text sizeNumber16
titleFontSizeSize of the titleNumber12
labelFontSizeSize of the labelNumber12
labelHeightFloating height of the labelNumber32
labelPaddingFloating label paddingNumber4
inputContainerPaddingUser input paddingNumber8
labelTextStyleStyles for the label text tagObject
titleTextStyleStyles for the title text tagObject
affixTextStyleStyles for the affixes tagObject
tintColorOn focus the line, label and cursor take this colorColorrgb(0, 145, 234)
textColorUser input text colorColorrgba(0, 0, 0, .87)
baseColorWhen not focused, the line, label and cursor take this colorColorrgba(0, 0, 0, .38)
labelText to be displayed in the labelString
titleText to be displayed in the titleString
errorText to be displayed when there is an errorString
errorColorColor for error textColorrgb(213, 0, 0)
disabledTo be able to edit, disabled should be falseBooleanfalse
disabledLineTypeThe line type should be one of these : solid, dotted, dashed, noneStringdotted
prefixPrefix textString
suffixSuffix textString
containerStyleStyle for the container that consists of input, label, title/errorObject
inputContainerStyleStyle for the container that consists of input and labelObject

##Switch

NameDescriptionTypeDefault
valueTrue if the switch is on and false if it is offBoolean225
onChangeValueFunction whenever the switch is toggledFunction
buttonOnTextON text on the switch, when it is ONString
buttonOffTextOFF text on the switch, when it is OFFString
buttonTextSizeThe size of the text on the selected switchNumber10
buttonOnColorColor when onColorgreen
buttonOFFColorColor when offColorgrey
buttonOnTextColorThe color of the text on the switch, when it is onColorwhite
buttonOffTextColorThe color of the text on the switch, when it is offColorblack
backgroundOnTextON text on the switch background, when it is OFFString
backgroundOffTextOFF text on the switch background, when it is ONString
backgroundTextSizeThe size of the text on the switch that is not selected and is in the backgroundNumber10
backgroundOnTextColorON text color of the switch, when it i s ONColorblack
backgroundOffTextColorOFF text color of the switch, when it is OFFColorblack
backgroundOnColorON text color of the switch, when it i s OFFColorwhite
backgroundOffColorOFF text color of the switch, when it i s ONColorwhite
backgroundWidthWidth of the switch backgroundNumber70
backgroundHeightHeight of the switch backgroundNumber30
backgroundBorderRadiusRadius of the switch background componentNumber15
backgroundBorderColorThe border color of the switch backgroundColorgrey
backgroundBorderWidthThe border width of the switch backgroundNumber0
buttonWidthThe switch button widthNumber25
buttonHeightThe switch button heightNumber25
buttonBorderRadiusRadius of the switch buttonNumber15
buttonBorderColorThe border color of the switch buttonColorgrey
buttonBorderWidthThe border width of the switch buttonNumber0
labelTextLabel for the switchString
labelTextColorColor of the label textColorblack
labelPositionPosition for the label, it can be one of : left, right, top, bottomStringright
labelTextSizeSize of the label textNumber20
labelPaddingPadding for the labelNumber10
animationTimeSwitch on/off animation timeNumber150
paddingPadding between the label and the switchNumber5

##Button

NameDescriptionTypeDefault
onButtonClickFunction that should be executed when there is a button clickFunctionnull
backgroundStyleObject to style the button backgroundObjectbackgroundStyle:{borderColor:'black',borderWidth:1,backgroundColor:'white'}
textStyleObject to style the textObjecttextStyle:{fontSize:14,color:'black'}
textText to be displayed on the ButtonString'Button'
iconImageImage Source which is required to render ImageImage.propTypes.sourcenull Example: require ('../../');
iconURLImage URL which is required to render Image.Stringnull
iconVectorNameVector Image Name of the Icon from react-native-vector icon libStringnull
iconVectorSizeSize of the vector iconNumber30
iconVectorColorVector Icon colorString'black'
iconPositionIcon PostionString'left'

##Drawer

NameDescriptionTypeDefault
disabledDisable the component or not.Booleanfalse
leftDisabledDisable left drawer or notBooleanfalse
rightDisabledDisable right drawer or not.Booleanfalse
typeType of the drawer. default overlay You can also use static value Drawer.types.Default Drawer.types.Overlay.String‘default'
DrawerPositionDetermine where does the drawer come out. left right both You can also use static value Drawer.positions.Left Drawer.positions.Right Drawer.positions.Both.String‘left'
drawerWidthThe width of drawer, it’s disabled when use replace type.Number200
drawerContentThe content of the drawer menu, default is left content.React Component (A complete View)null
leftDrawerContentThe content of the left drawer menu.React Component (A complete View)null
rightDrawerContentThe content of the right drawer menu.React Component (A complete View)null
durationThe duration of animation to open or close drawer.Number160
maskAlphaMaximum value is 0.5, the opactiy value of the mask over the main board when drawer is open. Mask can be disabled with showMask property.Number0.4
ShowMaskWhether show the mask when drawer is open.Booleantrue
customStylesCustomize drawer styles. You can customize main / mask / drawer / leftDrawer / rightDrawer.Object{}
onDrawerOpenTriggers when drawer is totally opened.functionnull
onLeftDrawerOpenTriggers when the left drawer is totally opened.functionnull
onRightDrawerOpenTriggers when the left drawer is totally opened.functionnull
onDrawerCloseTriggers when drawer is totally closed.functionnull
onLeftDrawerCloseTriggers when the left drawer is totally closed.functionnull
onRightDrawerCloseTriggers when the right drawer is totally closed.functionnull
startCaptureWhether to capture touch events while clicking on screen.Booleanfalse
moveCaptureWhether to capture touch events while clicking on screen.Booleanfalse
easingFuncEasing function of drawer animation, default is Easing.linear. You can pass function like Easing.ease/Easing.bezier(x1, y1, x2, y2)/Easing.sin/Easing.elastic(times)/Easing.bounce etc.functionnull
responderNegotiateCustomize conditions to set pan responder, evt & gestureState will be passed as arguments. Default condition is left 20% area on screen in left Drawer, or right 20% area on screen in right Drawer.functionnull

##OTP

NameDescriptionTypeDefault
labelThe text above the otp inputString'ONE TIME PASSWORD'
minutesTotal time to enter the otp receivedNumber3
resendFunction to send the otp againFunctionnull
labelTextStyleStyle for text to be displayed above the otp inputObject{}
borderColorColor of the otp input viewsString'#dedede'
borderColorOnFocusColor of the otp input view currently in focusString'#1989e8'
errorError message to be displayed if anyString'Wrong OTP'
onExpiryFunction to be called when the time is overFunctionnull
onBlurFunction to be called to get the otp enteredFunctionexample: onBlur={(otp) =>{this.setState({ otp })}}
errorStyleStyle for text to be displayed when error occursObject{}
valuethe otp that is received via call or smsNumbernull

##MobileTextView

NameDescriptionTypeDefault
numberThe phone number valueString0000000000
numberTextStyleThe style of the number text viewText.proptype.stylenumberTextStyle: {fontFamily: "WorkSans",fontSize: 24,fontWeight: "500",letterSpacing: 4.62,textAlign: "center",color: "#000000"},
hideNumberhide numberbooleantrue
replaceSymboltext character to be replace when hiding the numberString'x'
1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago