Socket
Socket
Sign inDemoInstall

volkeno-react-native-login

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    volkeno-react-native-login

a custum login component


Version published
Weekly downloads
2
Maintainers
1
Install size
112 kB
Created
Weekly downloads
 

Readme

Source

This project is a login page with built-in buttons

This package is currently only maintained for Expo managed React Native projects, support for bare React Native projects is coming soon

Installation

Add the dependency:

npm i volkeno-react-native-login

or

yarn add volkeno-react-native-login

Peer Dependencies

IMPORTANT! You need install them.
 "react": "^16.0.0-beta.5",
 "react-native": "^0.49.1"

Basic Usage

First step: import the component:

import Login from "volkeno-react-native-login";

Second step: Use the login

export default function App() {
  const [showPassword, setShowPassword] = React.useState(false);
  const [email, setEmail] = React.useState("");
  const [password, setPassword] = React.useState("");
  const [errors, setErrors] = React.useState({});

  const submit = async () => {
    Alert.alert("Félicitation", "Connexion réussie");
  };

  return (
    <View style={styles.container}>
      <LoginVolkeno
        showPassword={showPassword}
        setShowPassword={setShowPassword}
        email={email}
        setEmail={setEmail}
        password={password}
        setPassword={setPassword}
        errors={errors}
        setErrors={setErrors}
        title={"Login"}
        forgotPasswordText={"Mot de passe oublié ?"}
        OnSubmit={submit}
        textRedirectRegisterStyle={{ color: "red" }}
      />
    </View>
  );
}

plot

Here we have a function which reacts when the connect button is clicked. showPassword and setShowPassword allows you to activate or deactivate the visibility of the password.

email and setEmail allows you to enter and modify the email variable when typing it.

password and setPassword are used to enter and modify the password variable when typed.

the variables errors and setErrors are mandatory. They allow you to display errors when validating the email and password

Configuration - Props

Props require

PropertyTypeDefaultDescription
showPasswordbooleanfalseActivate to see the password
setShowPasswordfunctionvoidCalled for allows you to activate or deactivate the visibility of the password.
emailstring-Enter email address
setEmailfunctionvoidCalled for allows you to enter and modify the email variable when typing it.
passwordstring-Enter email address
setPasswordfunctionvoidUsed to enter and modify the password variable when typed.
errorsobjectvoidObject used to store email and password validation errors
setErrorsfunctionvoidThey allow you to display errors when validating the email and password
OnSubmitfunctionvoidFonction qui réagit lorsque le bouton de connexion est cliqué.

Other props

PropertyTypeDefaultDescription
titlestring"Connexion"change connection text
forgotPasswordTextstring-Put a forgotten password text
pressForgotPasswordfunctionvoidhandle forgotPasswordText button is pressed
colorIconPasswordcolor"#2FCA74"eye color
textConnexionstring"SE CONNECTER"change text on login button
leftIconPasswordfunctionvoidput a key icon 🔑 for the password
leftIconEmailfunctionvoidput a mail icon 📧 for the email address
textRedirectRegisterstring-Allow to put a text which will make it possible to make a redirection towards the page of registration
pressRedirectRegisterfunctionvoidhandle textRedirectRegister button is pressed

Styles props

PropertyTypeDefaultDescription
stylesstyle{flex: 1, paddingHorizontal: 20}modify or replace the default style of the entire page
textRedirectRegisterStylestyle{ color: "#2FCA74",textAlign: "center",fontSize: 14 }change or override the default styling for textRedirectRegister
connexionButtonStylestyle{backgroundColor: "#2FCA74",height: 50,minWidth: "100%",paddingHorizontal: 25}modify or replace the default style of the connexion button
connexionTitleStylestyle{color: "white",fontWeight: "bold",letterSpacing: 1,ontSize: 14}change or override the default styling for login text
titleStylestyle{marginVertical: 30,fontWeight: "bold",color: "#454545",fontSize: 36,textAlign: "center",change or override the default styling for connexion text
forgotPasswordTextStylestyle{ color: "#454545" }hange or override the default styling forgotPasswordText
export default function App() {
  const [showPassword, setShowPassword] = React.useState(false);
  const [email, setEmail] = React.useState("");
  const [password, setPassword] = React.useState("");
  const [errors, setErrors] = React.useState({});

  const submit = async () => {
    Alert.alert("Félicitation", "Connexion réussie");
  };

  return (
    <View style={styles.container}>
      <Login
        OnSubmit={submit}
        pressForgotPassword={() => {
          Alert.alert("change passWord");
        }}
        pressRedirectRegister={() => {
          Alert.alert("redirect regidter");
        }}
        showPassword={showPassword}
        setShowPassword={setShowPassword}
        email={email}
        setEmail={setEmail}
        password={password}
        setPassword={setPassword}
        errors={errors}
        setErrors={setErrors}
        title={"Login"}
        forgotPasswordText={"Mot de passe oublié ?"}
        forgotPasswordTextStyle={{
          color: "red",
          textAlign: "center",
        }}
        titleStyle={{
          color: "red",
          marginVertical: 30,
          fontWeight: "bold",
          fontSize: 36,
          textAlign: "center",
        }}
        textConnexion={"Je me connect"}
        leftIconPassword={
          <Icon name="ios-lock-open-outline" size={20} color={Colors.bgApp2} />
        }
        leftIconEmail={
          <Icon name="mail-outline" size={20} color={Colors.bgApp2} />
        }
        textRedirectRegisterStyle={{ color: "red" }}
        textRedirectRegister="Je n'ai pas encore de compte"
        styles={{}}
      />
    </View>
  );
}

plot

Keywords

FAQs

Last updated on 18 Mar 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc