diff --git a/app/containers/AppVersion.js b/app/containers/AppVersion.js new file mode 100644 index 000000000..c751c3385 --- /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'; + +const styles = StyleSheet.create({ + container: { + alignItems: 'center', + justifyContent: 'flex-end', + backgroundColor: '#ccc' + }, + text: { + ...sharedStyles.textRegular, + fontSize: 13 + }, + bold: { + ...sharedStyles.textSemibold + } +}); + +const Check = React.memo(({ theme }) => ( + + App Version: {getReadableVersion} + +)); + +Check.propTypes = { + theme: PropTypes.string +}; + +export default Check; diff --git a/app/containers/FormContainer.js b/app/containers/FormContainer.js new file mode 100644 index 000000000..dbcfb6725 --- /dev/null +++ b/app/containers/FormContainer.js @@ -0,0 +1,66 @@ +import React from 'react'; +import { Text, ScrollView, Keyboard, Image, StyleSheet, TouchableOpacity, View, Alert } 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'; + +const styles = StyleSheet.create({ + title: { + ...sharedStyles.textBold, + fontSize: 22, + letterSpacing: 0, + textAlign: 'auto' + }, + inputContainer: { + marginTop: 24, + marginBottom: 32 + }, + backButton: { + position: 'absolute', + paddingHorizontal: 9, + left: 15 + }, + certificatePicker: { + flex: 1, + marginTop: 40, + alignItems: 'center', + justifyContent: 'center' + }, + chooseCertificateTitle: { + fontSize: 15, + ...sharedStyles.textRegular + }, + chooseCertificate: { + fontSize: 15, + ...sharedStyles.textSemibold + } +}); + +const FormContainer = ({ children, theme }) => ( + + + + + {children} + + + + +); + +FormContainer.propTypes = { + theme: PropTypes.string +}; + +export default FormContainer; diff --git a/app/i18n/locales/en.js b/app/i18n/locales/en.js index 190831156..c83f2075a 100644 --- a/app/i18n/locales/en.js +++ b/app/i18n/locales/en.js @@ -238,6 +238,7 @@ export default { Invite_users: 'Invite users', Join_the_community: 'Join the community', Join: 'Join', + Join_your_workspace: 'Join your workspace', Just_invited_people_can_access_this_channel: 'Just invited people can access this channel', Language: 'Language', last_message: 'last message', @@ -486,6 +487,7 @@ export default { Welcome: 'Welcome', Whats_your_2fa: 'What\'s your 2FA code?', Without_Servers: 'Without Servers', + Workspaces: 'Workspaces', Write_External_Permission_Message: 'Rocket Chat needs access to your gallery so you can save images.', Write_External_Permission: 'Gallery Permission', Yes_action_it: 'Yes, {{action}} it!', diff --git a/app/views/NewServerView.js b/app/views/NewServerView.js index 9e7d1642c..3f712b176 100644 --- a/app/views/NewServerView.js +++ b/app/views/NewServerView.js @@ -18,34 +18,30 @@ import sharedStyles from './Styles'; import scrollPersistTaps from '../utils/scrollPersistTaps'; import Button from '../containers/Button'; import TextInput from '../containers/TextInput'; +import FormContainer from '../containers/FormContainer'; import I18n from '../i18n'; -import { verticalScale, moderateScale } from '../utils/scaling'; import KeyboardView from '../presentation/KeyboardView'; import { isIOS, isNotch, isTablet } from '../utils/deviceInfo'; import { CustomIcon } from '../lib/Icons'; import StatusBar from '../containers/StatusBar'; +import AppVersion from '../containers/AppVersion'; import { themes } from '../constants/colors'; import log from '../utils/log'; import { animateNextTransition } from '../utils/layoutAnimation'; import { withTheme } from '../theme'; import { setBasicAuth, BASIC_AUTH_KEY } from '../utils/fetch'; +import { themedHeader } from '../utils/navigation'; const styles = StyleSheet.create({ - image: { - alignSelf: 'center', - marginVertical: verticalScale(20), - width: 210, - height: 171 - }, title: { ...sharedStyles.textBold, - fontSize: moderateScale(22), + fontSize: 22, letterSpacing: 0, - alignSelf: 'center' + textAlign: 'auto' }, inputContainer: { - marginTop: 25, - marginBottom: 15 + marginTop: 24, + marginBottom: 32 }, backButton: { position: 'absolute', @@ -68,11 +64,10 @@ const styles = StyleSheet.create({ } }); -const defaultServer = 'https://open.rocket.chat'; - class NewServerView extends React.Component { - static navigationOptions = () => ({ - header: null + static navigationOptions = ({ screenProps }) => ({ + title: I18n.t('Workspaces'), + ...themedHeader(screenProps.theme) }) static propTypes = { @@ -97,7 +92,6 @@ class NewServerView extends React.Component { this.state = { text: server || '', - autoFocus: !server, certificate: null }; } @@ -292,49 +286,38 @@ class NewServerView extends React.Component { render() { const { connecting, theme } = this.props; - const { text, autoFocus } = this.state; + const { text } = this.state; return ( - - - - - - {I18n.t('Sign_in_your_server')} - - -