diff --git a/android/app/src/main/res/drawable-hdpi/logo.png b/android/app/src/main/res/drawable-hdpi/logo.png old mode 100644 new mode 100755 index 4a98ac064..6d56e9f5d Binary files a/android/app/src/main/res/drawable-hdpi/logo.png and b/android/app/src/main/res/drawable-hdpi/logo.png differ diff --git a/android/app/src/main/res/drawable-hdpi/logo_onboarding.png b/android/app/src/main/res/drawable-hdpi/logo_onboarding.png deleted file mode 100644 index 069c9ce8d..000000000 Binary files a/android/app/src/main/res/drawable-hdpi/logo_onboarding.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-hdpi/new_server.png b/android/app/src/main/res/drawable-hdpi/new_server.png deleted file mode 100644 index fae62c0e0..000000000 Binary files a/android/app/src/main/res/drawable-hdpi/new_server.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-hdpi/onboarding.png b/android/app/src/main/res/drawable-hdpi/onboarding.png deleted file mode 100644 index f1228b3f1..000000000 Binary files a/android/app/src/main/res/drawable-hdpi/onboarding.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-hdpi/options.png b/android/app/src/main/res/drawable-hdpi/options.png deleted file mode 100644 index 8e3bcc2ca..000000000 Binary files a/android/app/src/main/res/drawable-hdpi/options.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-mdpi/logo.png b/android/app/src/main/res/drawable-mdpi/logo.png old mode 100644 new mode 100755 index 6928d7b88..375dae9cc Binary files a/android/app/src/main/res/drawable-mdpi/logo.png and b/android/app/src/main/res/drawable-mdpi/logo.png differ diff --git a/android/app/src/main/res/drawable-mdpi/logo_onboarding.png b/android/app/src/main/res/drawable-mdpi/logo_onboarding.png deleted file mode 100644 index a5fcdfbca..000000000 Binary files a/android/app/src/main/res/drawable-mdpi/logo_onboarding.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-mdpi/new_server.png b/android/app/src/main/res/drawable-mdpi/new_server.png deleted file mode 100644 index ea8e06f9b..000000000 Binary files a/android/app/src/main/res/drawable-mdpi/new_server.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-mdpi/onboarding.png b/android/app/src/main/res/drawable-mdpi/onboarding.png deleted file mode 100644 index 55656e242..000000000 Binary files a/android/app/src/main/res/drawable-mdpi/onboarding.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-mdpi/options.png b/android/app/src/main/res/drawable-mdpi/options.png deleted file mode 100644 index a2bd9ecdf..000000000 Binary files a/android/app/src/main/res/drawable-mdpi/options.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xhdpi/logo.png b/android/app/src/main/res/drawable-xhdpi/logo.png old mode 100644 new mode 100755 index e4502f69c..3e85a65d2 Binary files a/android/app/src/main/res/drawable-xhdpi/logo.png and b/android/app/src/main/res/drawable-xhdpi/logo.png differ diff --git a/android/app/src/main/res/drawable-xhdpi/logo_onboarding.png b/android/app/src/main/res/drawable-xhdpi/logo_onboarding.png deleted file mode 100644 index bf3e6a526..000000000 Binary files a/android/app/src/main/res/drawable-xhdpi/logo_onboarding.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xhdpi/new_server.png b/android/app/src/main/res/drawable-xhdpi/new_server.png deleted file mode 100644 index 4b1e11cb4..000000000 Binary files a/android/app/src/main/res/drawable-xhdpi/new_server.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xhdpi/onboarding.png b/android/app/src/main/res/drawable-xhdpi/onboarding.png deleted file mode 100644 index 67764cd13..000000000 Binary files a/android/app/src/main/res/drawable-xhdpi/onboarding.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xhdpi/options.png b/android/app/src/main/res/drawable-xhdpi/options.png deleted file mode 100644 index 612d02be8..000000000 Binary files a/android/app/src/main/res/drawable-xhdpi/options.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xxhdpi/logo.png b/android/app/src/main/res/drawable-xxhdpi/logo.png old mode 100644 new mode 100755 index 159d7d4a5..a13087a4e Binary files a/android/app/src/main/res/drawable-xxhdpi/logo.png and b/android/app/src/main/res/drawable-xxhdpi/logo.png differ diff --git a/android/app/src/main/res/drawable-xxhdpi/logo_onboarding.png b/android/app/src/main/res/drawable-xxhdpi/logo_onboarding.png deleted file mode 100644 index a95427d0a..000000000 Binary files a/android/app/src/main/res/drawable-xxhdpi/logo_onboarding.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xxhdpi/new_server.png b/android/app/src/main/res/drawable-xxhdpi/new_server.png deleted file mode 100644 index 5c1b8fb5e..000000000 Binary files a/android/app/src/main/res/drawable-xxhdpi/new_server.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xxhdpi/onboarding.png b/android/app/src/main/res/drawable-xxhdpi/onboarding.png deleted file mode 100644 index fa8a8d2e8..000000000 Binary files a/android/app/src/main/res/drawable-xxhdpi/onboarding.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xxhdpi/options.png b/android/app/src/main/res/drawable-xxhdpi/options.png deleted file mode 100644 index 2622837a8..000000000 Binary files a/android/app/src/main/res/drawable-xxhdpi/options.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xxxhdpi/logo.png b/android/app/src/main/res/drawable-xxxhdpi/logo.png old mode 100644 new mode 100755 index c1bd0fe37..8adfb1674 Binary files a/android/app/src/main/res/drawable-xxxhdpi/logo.png and b/android/app/src/main/res/drawable-xxxhdpi/logo.png differ diff --git a/android/app/src/main/res/drawable-xxxhdpi/logo_onboarding.png b/android/app/src/main/res/drawable-xxxhdpi/logo_onboarding.png deleted file mode 100644 index df1c5467f..000000000 Binary files a/android/app/src/main/res/drawable-xxxhdpi/logo_onboarding.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xxxhdpi/new_server.png b/android/app/src/main/res/drawable-xxxhdpi/new_server.png deleted file mode 100644 index 8a45bca89..000000000 Binary files a/android/app/src/main/res/drawable-xxxhdpi/new_server.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xxxhdpi/onboarding.png b/android/app/src/main/res/drawable-xxxhdpi/onboarding.png deleted file mode 100644 index eaa2a3bcf..000000000 Binary files a/android/app/src/main/res/drawable-xxxhdpi/onboarding.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-xxxhdpi/options.png b/android/app/src/main/res/drawable-xxxhdpi/options.png deleted file mode 100644 index f9a4f0213..000000000 Binary files a/android/app/src/main/res/drawable-xxxhdpi/options.png and /dev/null differ diff --git a/app/constants/tablet.js b/app/constants/tablet.js index 16e62f6d0..93f53d846 100644 --- a/app/constants/tablet.js +++ b/app/constants/tablet.js @@ -1,4 +1,4 @@ export const MAX_SIDEBAR_WIDTH = 321; export const MAX_CONTENT_WIDTH = '90%'; -export const MAX_SCREEN_CONTENT_WIDTH = '45%'; +export const MAX_SCREEN_CONTENT_WIDTH = '50%'; export const MIN_WIDTH_SPLIT_LAYOUT = 700; diff --git a/app/containers/AppVersion.js b/app/containers/AppVersion.js new file mode 100644 index 000000000..2e679d968 --- /dev/null +++ b/app/containers/AppVersion.js @@ -0,0 +1,34 @@ +import React from 'react'; +import { StyleSheet, View, Text } from 'react-native'; +import PropTypes from 'prop-types'; + +import { themes } from '../constants/colors'; +import sharedStyles from '../views/Styles'; +import { getReadableVersion } from '../utils/deviceInfo'; +import I18n from '../i18n'; + +const styles = StyleSheet.create({ + container: { + alignItems: 'center', + justifyContent: 'flex-end' + }, + text: { + ...sharedStyles.textRegular, + fontSize: 13 + }, + bold: { + ...sharedStyles.textSemibold + } +}); + +const AppVersion = React.memo(({ theme }) => ( + + {I18n.t('Version_no', { version: '' })}{getReadableVersion} + +)); + +AppVersion.propTypes = { + theme: PropTypes.string +}; + +export default AppVersion; diff --git a/app/containers/Button/index.js b/app/containers/Button/index.js index 95ccdb576..0f573f876 100644 --- a/app/containers/Button/index.js +++ b/app/containers/Button/index.js @@ -9,15 +9,19 @@ import ActivityIndicator from '../ActivityIndicator'; const styles = StyleSheet.create({ container: { - paddingHorizontal: 15, + paddingHorizontal: 14, justifyContent: 'center', height: 48, borderRadius: 2, - marginBottom: 10 + marginBottom: 12 }, text: { - fontSize: 18, - textAlign: 'center' + fontSize: 16, + textAlign: 'center', + ...sharedStyles.textMedium + }, + disabled: { + opacity: 0.3 } }); @@ -30,6 +34,8 @@ export default class Button extends React.PureComponent { backgroundColor: PropTypes.string, loading: PropTypes.bool, theme: PropTypes.string, + color: PropTypes.string, + fontSize: PropTypes.string, style: PropTypes.any } @@ -43,9 +49,15 @@ export default class Button extends React.PureComponent { render() { const { - title, type, onPress, disabled, backgroundColor, loading, style, theme, ...otherProps + title, type, onPress, disabled, backgroundColor, color, loading, style, theme, fontSize, ...otherProps } = this.props; const isPrimary = type === 'primary'; + + let textColor = isPrimary ? themes[theme].buttonText : themes[theme].bodyText; + if (color) { + textColor = color; + } + return ( { loading - ? + ? : ( {title} diff --git a/app/containers/FormContainer.js b/app/containers/FormContainer.js new file mode 100644 index 000000000..fda039765 --- /dev/null +++ b/app/containers/FormContainer.js @@ -0,0 +1,51 @@ +import React from 'react'; +import { ScrollView, StyleSheet, View } from 'react-native'; +import PropTypes from 'prop-types'; +import { SafeAreaView } from 'react-navigation'; + +import { themes } from '../constants/colors'; +import sharedStyles from '../views/Styles'; +import scrollPersistTaps from '../utils/scrollPersistTaps'; +import KeyboardView from '../presentation/KeyboardView'; +import StatusBar from './StatusBar'; +import AppVersion from './AppVersion'; +import { isTablet } from '../utils/deviceInfo'; + +const styles = StyleSheet.create({ + scrollView: { + minHeight: '100%' + } +}); + +export const FormContainerInner = ({ children }) => ( + + {children} + +); + +const FormContainer = ({ children, theme }) => ( + + + + + {children} + + + + +); + +FormContainer.propTypes = { + theme: PropTypes.string, + children: PropTypes.element +}; + +FormContainerInner.propTypes = { + children: PropTypes.element +}; + +export default FormContainer; diff --git a/app/containers/HeaderButton.js b/app/containers/HeaderButton.js index e13ca4398..f696f2afd 100644 --- a/app/containers/HeaderButton.js +++ b/app/containers/HeaderButton.js @@ -36,9 +36,9 @@ export const DrawerButton = React.memo(({ navigation, testID, ...otherProps }) = )); -export const CloseModalButton = React.memo(({ navigation, testID }) => ( +export const CloseModalButton = React.memo(({ navigation, testID, onPress = () => navigation.pop() }) => ( - navigation.pop()} testID={testID} /> + )); @@ -76,7 +76,8 @@ DrawerButton.propTypes = { }; CloseModalButton.propTypes = { navigation: PropTypes.object.isRequired, - testID: PropTypes.string.isRequired + testID: PropTypes.string.isRequired, + onPress: PropTypes.func }; CloseShareExtensionButton.propTypes = { onPress: PropTypes.func.isRequired, diff --git a/app/views/LoginSignupView.js b/app/containers/LoginServices.js similarity index 58% rename from app/views/LoginSignupView.js rename to app/containers/LoginServices.js index eee3060bd..e6e685b34 100644 --- a/app/views/LoginSignupView.js +++ b/app/containers/LoginServices.js @@ -1,42 +1,32 @@ import React from 'react'; -import PropTypes from 'prop-types'; import { - Text, View, ScrollView, Image, StyleSheet, Animated, Easing + View, StyleSheet, Text, Animated, Easing, Image } from 'react-native'; +import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { Base64 } from 'js-base64'; -import { SafeAreaView } from 'react-navigation'; -import { BorderlessButton } from 'react-native-gesture-handler'; -import equal from 'deep-equal'; +import { withNavigation } from 'react-navigation'; -import Touch from '../utils/touch'; -import sharedStyles from './Styles'; -import scrollPersistTaps from '../utils/scrollPersistTaps'; -import random from '../utils/random'; -import Button from '../containers/Button'; -import I18n from '../i18n'; -import { LegalButton } from '../containers/HeaderButton'; -import StatusBar from '../containers/StatusBar'; -import { themes } from '../constants/colors'; import { withTheme } from '../theme'; -import { themedHeader } from '../utils/navigation'; -import { isTablet } from '../utils/deviceInfo'; +import sharedStyles from '../views/Styles'; +import { themes } from '../constants/colors'; +import { loginRequest as loginRequestAction } from '../actions/login'; +import Button from './Button'; +import OnboardingSeparator from './OnboardingSeparator'; +import Touch from '../utils/touch'; +import I18n from '../i18n'; +import random from '../utils/random'; + +const SERVICE_HEIGHT = 58; +const SERVICES_COLLAPSED_HEIGHT = 174; const styles = StyleSheet.create({ - container: { - paddingVertical: 30 - }, - safeArea: { - paddingBottom: 30, - flex: 1 - }, serviceButton: { borderRadius: 2, marginBottom: 10 }, serviceButtonContainer: { borderRadius: 2, - borderWidth: 1, width: '100%', height: 48, flexDirection: 'row', @@ -56,124 +46,32 @@ const styles = StyleSheet.create({ fontSize: 16 }, serviceName: { - ...sharedStyles.textBold + ...sharedStyles.textSemibold }, - registerDisabled: { - ...sharedStyles.textRegular, - ...sharedStyles.textAlignCenter, - fontSize: 16 - }, - servicesTogglerContainer: { - flexDirection: 'row', - alignItems: 'center', - marginTop: 5, - marginBottom: 30 - }, - servicesToggler: { - width: 32, - height: 31 - }, - separatorContainer: { - marginTop: 5, - marginBottom: 15 - }, - separatorLine: { - flex: 1, - height: 1 - }, - separatorLineLeft: { - marginRight: 15 - }, - separatorLineRight: { - marginLeft: 15 - }, - inverted: { - transform: [{ scaleY: -1 }] + options: { + marginBottom: 0 } }); -const SERVICE_HEIGHT = 58; -const SERVICES_COLLAPSED_HEIGHT = 174; - -class LoginSignupView extends React.Component { - static navigationOptions = ({ navigation, screenProps }) => { - const title = navigation.getParam('title', 'Rocket.Chat'); - return { - ...themedHeader(screenProps.theme), - title, - headerRight: - }; - } - +class LoginServices extends React.PureComponent { static propTypes = { navigation: PropTypes.object, server: PropTypes.string, services: PropTypes.object, - Site_Name: PropTypes.string, Gitlab_URL: PropTypes.string, CAS_enabled: PropTypes.bool, CAS_login_url: PropTypes.string, - Accounts_ShowFormLogin: PropTypes.bool, - Accounts_RegistrationForm: PropTypes.string, - Accounts_RegistrationForm_LinkReplacementText: PropTypes.string, + separator: PropTypes.bool, theme: PropTypes.string } - constructor(props) { - super(props); - this.state = { - collapsed: true, - servicesHeight: new Animated.Value(SERVICES_COLLAPSED_HEIGHT) - }; - const { Site_Name } = this.props; - this.setTitle(Site_Name); + static defaultProps = { + separator: true } - shouldComponentUpdate(nextProps, nextState) { - const { collapsed, servicesHeight } = this.state; - const { - server, Site_Name, services, Accounts_ShowFormLogin, Accounts_RegistrationForm, Accounts_RegistrationForm_LinkReplacementText, theme - } = this.props; - if (nextState.collapsed !== collapsed) { - return true; - } - if (nextState.servicesHeight !== servicesHeight) { - return true; - } - if (nextProps.server !== server) { - return true; - } - if (nextProps.Site_Name !== Site_Name) { - return true; - } - if (nextProps.theme !== theme) { - return true; - } - if (nextProps.Accounts_ShowFormLogin !== Accounts_ShowFormLogin) { - return true; - } - if (nextProps.Accounts_RegistrationForm !== Accounts_RegistrationForm) { - return true; - } - if (nextProps.Accounts_RegistrationForm_LinkReplacementText !== Accounts_RegistrationForm_LinkReplacementText) { - return true; - } - if (!equal(nextProps.services, services)) { - return true; - } - return false; - } - - componentDidUpdate(prevProps) { - const { Site_Name } = this.props; - if (Site_Name && prevProps.Site_Name !== Site_Name) { - this.setTitle(Site_Name); - } - } - - setTitle = (title) => { - const { navigation } = this.props; - navigation.setParams({ title }); + state = { + collapsed: true, + servicesHeight: new Animated.Value(SERVICES_COLLAPSED_HEIGHT) } onPressFacebook = () => { @@ -300,16 +198,6 @@ class LoginSignupView extends React.Component { navigation.navigate('AuthenticationWebView', { url, authType, ssoToken }); } - login = () => { - const { navigation, Site_Name } = this.props; - navigation.navigate('LoginView', { title: Site_Name }); - } - - register = () => { - const { navigation, Site_Name } = this.props; - navigation.navigate('RegisterView', { title: Site_Name }); - } - transitionServicesTo = (height) => { const { servicesHeight } = this.state; if (this._animation) { @@ -350,27 +238,28 @@ class LoginSignupView extends React.Component { renderServicesSeparator = () => { const { collapsed } = this.state; - const { - services, theme, Accounts_ShowFormLogin, Accounts_RegistrationForm - } = this.props; + const { services, separator, theme } = this.props; const { length } = Object.values(services); - if (length > 3 && Accounts_ShowFormLogin && Accounts_RegistrationForm) { + if (length > 3 && separator) { return ( - - - - - - - + <> +