0.0.8 • Published 6 years ago

storm-auth v0.0.8

Weekly downloads
30
License
-
Repository
-
Last release
6 years ago

🌩️ Storm Auth 🌩️

A set of react native modules to handle authentication

Screenshot Screenshot

Installation

yarn add storm-auth

Usage

import Auth from 'storm-auth/src/components/Auth'
import SignInForm from 'storm-auth/src/components/SignInForm'
import SignUpForm from 'storm-auth/src/components/SignUpForm'
import graphcoolSignInWithEmail from 'storm-auth/src/hocs/graphcool/sign-in-email'
import graphcoolSignInWithFacebook from 'storm-auth/src/hocs/graphcool/sign-in-facebook'
import graphcoolSignUp from 'storm-auth/src/hocs/graphcool/sign-up'

const SignInFormContainer = compose(
  graphcoolSignInWithEmail(),
  graphcoolSignInWithFacebook(['public_profile', 'email']),
)(SignInForm)
const SignUpFormContainer = compose(
  graphcoolSignUp()
)(SignUpForm)

export default class App extends Component {
  render() {
    return (
      <ApolloProvider client={apolloComponent}>
        <View style={styles.container}>
          <Auth
            backgroundImageSource={{uri: 'https://unsplash.it/600x1200'}}
            logoSource={{uri: 'https://unsplash.it/400x400'}}
            signInContainer={<SignInFormContainer
              onSuccessEmail={() => alert('Success Email')}
              onSuccessFacebook={() => alert('Success Facebook')}/>
            }
            signUpContainer={<SignUpFormContainer
              onSuccess={() => alert('Success Sign Up')} />
            }
          />
        </View>
      </ApolloProvider>
    );
  }
}

Props

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.1

6 years ago