0.2.3 • Published 3 years ago

react-native-social-login-screen v0.2.3

Weekly downloads
8
License
MIT
Repository
github
Last release
3 years ago

Easy Login Screen with beautiful design and fully customizable options for React Native

npm version npm Platform - Android and iOS License: MIT styled with prettier

Installation

Add the dependency:

npm i react-native-social-login-screen

Peer Dependencies

"react-native-androw": ">= 0.0.34"
"react-native-spinkit": "^1.5.1"

Usage

Import

import SocialLoginScreen from "react-native-social-login-screen";

Fundamental Usage

<SocialLoginScreen
  onSignUpPress={() => {}}
  onLoginPress={() => {}}
  onForgotPasswordPress={() => {}}
  onUserNameChangeText={(username) => console.log("Username: ", username)}
  onPasswordChangeText={(password) => console.log("Password: ", password)}
  rightTopAssetImageSource={require("./assets/ramen.png")}
  leftBottomAssetImageSource={require("./assets/chef.png")}
/>

Advanced Usage

<SocialLoginScreen
  onUserNameChangeText={(username) => console.log("Username: ", username)}
  onPasswordChangeText={(password) => console.log("Password: ", password)}
  onSignUpPress={() => {}}
  onLoginPress={() => {}}
  onForgotPasswordPress={() => {}}
  enableFacebookLogin
  onFacebookLoginPress={() => {}}
  enableDiscordLogin
  onDiscordLoginPress={() => {}}
  enableTwitterLogin
  onTwitterLoginPress={() => {}}
  enableGoogleLogin
  onGoogleLoginPress={() => {}}
  rightTopAssetImageSource={require("./assets/ramen.png")}
  leftBottomAssetImageSource={require("./assets/chef.png")}
  signUpTextStyle={{
    fontFamily: "Sansita-Regular",
  }}
  loginTextStyle={{
    fontFamily: "Athelas-Bold",
  }}
  forgotPasswordTextStyle={{
    fontFamily: "Sansita-Bold",
  }}
/>

Configuration - Props

Fundamentals

PropertyTypeDefaultDescription
onLoginPressfunctionundefinedfundamental onLoginPress functionality for your own logic
onSignUpPressfunctionundefinedhandle sign-up button is pressed
onForgotPasswordPressfunctionundefinedhandle forgot password button is pressed
onRepasswordChangeTextfunctionundefinedhandle re-password button is pressed
rightTopAssetImageSourceimage-sourceundefinedset the right top aligned asset with your own image source
leftBottomAssetImageSourceimage-sourceundefinedset the left bottom aligned asset with your own image source
backArrowImageSourceimage-sourcedefaultset the sign-up button's back button asset with your own image source
usernamePlaceholderstring"john_doe@example.com"change the username TextField's placeholder
passwordPlaceholderstring"• • • • • • • •"change the password TextField's placeholder
onUserNameChangeTextfunctionundefinedhandle username TextField's onChangeText
onPasswordChangeTextfunctionundefinedhandle password TextField's onChangeText

Social Buttons

PropertyTypeDefaultDescription
loginTextstring"Let's cook!"change the login button's text
signUpTextstring"Sign Up"change the sign up button's text
loginTitleTextstring"Log In"change the login title's text
forgotPasswordTextstring"Forgot Password?"change the forgot password button's text
enableFacebookLoginbooleanfalseenable the Facebook login button
enableTwitterLoginbooleanfalseenable the Twitter login button
enableGoogleLoginbooleanfalseenable the Google login button
enableDiscordLoginbooleanfalseenable the Discord login button
enableAppleLoginbooleanfalseenable the Apple login button
onFacebookLoginPressfunctionundefinedhandle Facebook login button is pressed
onTwitterLoginPressfunctionundefinedhandle Twitter login button is pressed
onGoogleLoginPressfunctionundefinedhandle Google login button is pressed
onDiscordLoginPressfunctionundefinedhandle Discord login button is pressed
onAppleLoginPressfunctionundefinedhandle Apple login button is pressed
appleSpinnerColorcolor#fffhandle Apple login button's spinner color
appleSpinnerVisibilitybooleanfalsehandle Apple login button's spinner visibility

Customization

PropertyTypeDefaultDescription
loginTextStylestyledefaultchange or override the default styling for login text
signUpTextStylestyledefaultchange or override the default styling for sign-up text
forgotPasswordTextStylestyledefaultchange or override the default styling for forgot password text
loginButtonShadowColorstyledefaultchange the default shadow color for login button
loginButtonBackgroundColorstyle#69bc4cchange the default background color for login button
usernameTextFieldStylestyledefaultchange or override the default styling for username TextField
passwordTextFieldStylestyledefaultchange or override the default styling for password TextField
disableSignUpbooleanfalsedisable the sign up header if you only want to login screen
disableForgotButtonbooleanfalsedisable the forgot button

More customization is in coming...

Future Plans

  • LICENSE
  • More Customization Options
  • Add custom SocialButton instead of default ones
  • Built-in Sign-Up Logic is Integrated
  • Write an article about the lib on Medium

Author

FreakyCoder, kurayogun@gmail.com

License

React Native Social Login Screen is available under the MIT license. See the LICENSE file for more info.