UI Kitten implementation for AWS Amplify authentication UI.
- Install UI Kitten, see documentation
- Install and configure AWS Amplify Authetication for react native, see documentation
yarn add aws-amplify-auth-ui-kitten
import * as eva from '@eva-design/eva';
import { ApplicationProvider, IconRegistry } from '@ui-kitten/components';
import { EvaIconsPack } from '@ui-kitten/eva-icons';
import { SignIn, SignUp, ConfirmSignUp, ConfirmSignIn, ForgotPassword, RequireNewPassword } from 'aws-amplify-auth-ui-kitten';
import { Authenticator } from 'aws-amplify-react-native';
export default () => {
const [authState, setAuthState] = useState<string>()
return (
<>
<IconRegistry icons={EvaIconsPack} />
<ApplicationProvider {...eva} theme={eva.light}>
{authState === 'signedIn' ? (<App />) : (
<Authenticator
onStateChange={setAuthState}
hideDefault={true}
>
<SignIn />
<ConfirmSignIn />
<ConfirmSignUp />
<ForgotPassword />
<RequireNewPassword />
<SignUp />
</Authenticator>
)}
</ApplicationProvider>
</>
)
}
MIT license.
Made with ❤️ by MEOM