Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
react-login-modal-sm
Advanced tools
Customizable React Social Media login modal
A lightweight, customizable react component log-in modal including social media buttons. No functionality is applied. Functions for click events can be passed via props. As can varies options for text and behavior.
https://silind.github.io/react-login-modal-sm/
npm i react-login-modal-sm
# Start development server using create-react-app
npm run example
<!-- Google Icons -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- Bootstrap -->
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
import LoginModal from "react-login-modal-sm";
<LoginModal showModal={true} />
Prop name | Description |
---|---|
showModal | Boolean that determines whether the modal is visible or hidden |
Prop name | Description |
---|---|
toggleModal | Show / hide the modal. When user clicks the 'x' button or clicks the overlay-background |
onLoginFacebook | When user clicks on 'log in with Facebook' button |
onLoginGoogle | When user clicks on 'log in with Google' button |
onLoginEmail | When user clicks on 'log in with email' button. Passes (email, password) as parameters |
onSignupFacebook | When user clicks on 'sign up with Facebook' button |
onSignupGoogle | When user clicks on 'sign up with Google' button |
onSignupEmail | When user clicks on 'sign up with email' button. Passes (email, username, password) as parameters |
onForgotPassword | When user clicks on 'send new password' button. Passes (email) as parameter |
Prop name | Description | Default value |
---|---|---|
emailRegex | Regex that defines correct email format | https://stackoverflow.com/questions/46155/how-to-validate-an-email-address-in-javascript |
usernameRegex | Regex that defines correct username format | /^[a-zA-Z0-9_-]{5,}/ |
passwordRegex | Regex that defines correct password format | /^[a-zA-Z0-9_@!#()]{8,}/ |
Prop name | Description |
---|---|
labels | Optional labels. Must be passed as an entire object |
{
loginTitle: "Log in",
signupTitle: "Create new user",
forgotTitle: "Reset password",
loginFacebookButton: "Log in with Facebook",
loginGoogleButton: "Log in with Google",
loginEmailButton: "Log in with email",
signupFacebookButton: "Sign up with Facebook",
signupGoogleButton: "Sign up with Google",
signupEmailButton: "Sign up with email",
forgotButton: "Send new password",
loginEmailPlaceholder: "Type email",
loginPasswordPlaceholder: "Type password",
signupUsernamePlaceholder: "Type username",
signupLink: "Create new user?",
loginLink: "Already a user?",
forgotLink: "Forgot password?",
orLabel: "or"
}
import React, { Component } from "react";
import LoginModal from "react-login-modal-sm";
export default class App extends Component {
state = {
showModal: false
};
toggleModal = () => {
this.setState({ showModal: !this.state.showModal });
};
handleLoginWithFacebook = () => {
// Do something when 'Login with Facebook' is clicked
console.log("Login with Facebook...");
};
handleSignupByEmail = (email, username, password) => {
// Do something when 'Signup by email' is clicked
console.log("Sign up by email...");
};
render() {
const customUsernameRegex = /^[a-zA-Z0-9_]{5,}/;
return (
<div className="App">
<h1>react-login-modal-sm example</h1>
<LoginModal
showModal={this.state.showModal}
toggleModal={this.toggleModal}
onLoginFacebook={this.handleLoginWithFacebook}
onSignupEmail={this.handleSignupByEmail}
usernameRegex={customUsernameRegex}
/>
<button
className="test-btn btn btn-primary btn-lg"
onClick={this.toggleModal}
>
Log in
</button>
</div>
);
}
}
FAQs
Customizable React Social Media login modal
The npm package react-login-modal-sm receives a total of 0 weekly downloads. As such, react-login-modal-sm popularity was classified as not popular.
We found that react-login-modal-sm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.