From a00d5aa44382f0f3fba3d01fea717a1bb1d5fd56 Mon Sep 17 00:00:00 2001 From: Terry Sahaidak Date: Thu, 29 Jun 2017 01:30:50 +0300 Subject: [PATCH] Fix token regex, use scroll view for login by token view --- app/modules/auth.js | 2 +- app/screens/Login/styles.js | 2 +- app/screens/LoginByToken/index.js | 60 ++++++++++++++++--------------- 3 files changed, 33 insertions(+), 31 deletions(-) diff --git a/app/modules/auth.js b/app/modules/auth.js index f3468b6..6735bc7 100644 --- a/app/modules/auth.js +++ b/app/modules/auth.js @@ -8,7 +8,7 @@ import {setItem, removeItem} from '../utils/storage' * Constants */ -const TOKEN_REGEX = /^[a-z][a-z\d]*$/i +const TOKEN_REGEX = /^[a-z\d]*$/i export const LOGINING = 'auth/LOGINING' export const LOGINED_IN_SUCCESS = 'auth/LOGINED_IN_SUCCESS' diff --git a/app/screens/Login/styles.js b/app/screens/Login/styles.js index b812e9c..106cad9 100644 --- a/app/screens/Login/styles.js +++ b/app/screens/Login/styles.js @@ -28,7 +28,7 @@ const styles = StyleSheet.create({ }, buttonStyle: { backgroundColor: 'white', - marginBottom: 20, + marginBottom: 16, height: 35, borderRadius: 2, justifyContent: 'center', diff --git a/app/screens/LoginByToken/index.js b/app/screens/LoginByToken/index.js index 1054138..7db1555 100644 --- a/app/screens/LoginByToken/index.js +++ b/app/screens/LoginByToken/index.js @@ -1,6 +1,6 @@ import PropTypes from 'prop-types' import React, { Component } from 'react' -import {TextInput, Text, View, Linking} from 'react-native'; +import {TextInput, Text, View, Linking, ScrollView} from 'react-native'; import s from './styles' import {connect} from 'react-redux' import {checkToken} from '../../modules/auth' @@ -65,35 +65,37 @@ class LoginByTokenScreen extends Component { const {logining, errors, error} = this.props return ( - - - - {error && {errors}} - - - To get your authentication token press "Get token" button. It will open developer.gitter.im site in your browser.{'\n'}{'\n'}After signing in you will see caption "Personal Access Token". Below that caption will be your access token.{'\n'}{'\n'}Copy it and paste inside text input. Then press check mark. - - - - - + + + + + {logining && this.renderLoading()}