NewServerView
This commit is contained in:
parent
c796df22c8
commit
abf1c0fbac
|
@ -0,0 +1,43 @@
|
||||||
|
import React from 'react';
|
||||||
|
import { View, StyleSheet, Text } from 'react-native';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
|
import I18n from '../i18n';
|
||||||
|
import sharedStyles from '../views/Styles';
|
||||||
|
import { themes } from '../constants/colors';
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
container: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
alignItems: 'center',
|
||||||
|
marginVertical: 24
|
||||||
|
},
|
||||||
|
line: {
|
||||||
|
height: 1,
|
||||||
|
flex: 1
|
||||||
|
},
|
||||||
|
text: {
|
||||||
|
fontSize: 14,
|
||||||
|
marginLeft: 14,
|
||||||
|
marginRight: 14,
|
||||||
|
...sharedStyles.textMedium
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const DateSeparator = React.memo(({ theme }) => {
|
||||||
|
const line = { backgroundColor: themes[theme].borderColor };
|
||||||
|
const text = { color: themes[theme].auxiliaryText };
|
||||||
|
return (
|
||||||
|
<View style={styles.container}>
|
||||||
|
<View style={[styles.line, line]} />
|
||||||
|
<Text style={[styles.text, styles.marginRight, styles.marginLeft, text]}>{I18n.t('OR')}</Text>
|
||||||
|
<View style={[styles.line, line]} />
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
DateSeparator.propTypes = {
|
||||||
|
theme: PropTypes.string
|
||||||
|
};
|
||||||
|
|
||||||
|
export default DateSeparator;
|
|
@ -236,8 +236,8 @@ export default {
|
||||||
Invalid_server_version: 'The server you\'re trying to connect is using a version that\'s not supported by the app anymore: {{currentVersion}}.\n\nWe require version {{minVersion}}',
|
Invalid_server_version: 'The server you\'re trying to connect is using a version that\'s not supported by the app anymore: {{currentVersion}}.\n\nWe require version {{minVersion}}',
|
||||||
Invite_Link: 'Invite Link',
|
Invite_Link: 'Invite Link',
|
||||||
Invite_users: 'Invite users',
|
Invite_users: 'Invite users',
|
||||||
Join_the_community: 'Join the community',
|
|
||||||
Join: 'Join',
|
Join: 'Join',
|
||||||
|
Join_our_open_workspace: 'Join our open workspace',
|
||||||
Join_your_workspace: 'Join your workspace',
|
Join_your_workspace: 'Join your workspace',
|
||||||
Just_invited_people_can_access_this_channel: 'Just invited people can access this channel',
|
Just_invited_people_can_access_this_channel: 'Just invited people can access this channel',
|
||||||
Language: 'Language',
|
Language: 'Language',
|
||||||
|
@ -312,10 +312,12 @@ export default {
|
||||||
Onboarding_join_workspace: 'Join a workspace',
|
Onboarding_join_workspace: 'Join a workspace',
|
||||||
Onboarding_subtitle: 'Beyond Team Collaboration',
|
Onboarding_subtitle: 'Beyond Team Collaboration',
|
||||||
Onboarding_title: 'Welcome to Rocket.Chat',
|
Onboarding_title: 'Welcome to Rocket.Chat',
|
||||||
|
Onboarding_join_open_description: 'Join our open workspace to chat with the Rocket.Chat team and community.',
|
||||||
Online: 'Online',
|
Online: 'Online',
|
||||||
Only_authorized_users_can_write_new_messages: 'Only authorized users can write new messages',
|
Only_authorized_users_can_write_new_messages: 'Only authorized users can write new messages',
|
||||||
Open_emoji_selector: 'Open emoji selector',
|
Open_emoji_selector: 'Open emoji selector',
|
||||||
Open_Source_Communication: 'Open Source Communication',
|
Open_Source_Communication: 'Open Source Communication',
|
||||||
|
OR: 'OR',
|
||||||
Overwrites_the_server_configuration_and_use_room_config: 'Overwrites the server configuration and use room config',
|
Overwrites_the_server_configuration_and_use_room_config: 'Overwrites the server configuration and use room config',
|
||||||
Password: 'Password',
|
Password: 'Password',
|
||||||
Permalink_copied_to_clipboard: 'Permalink copied to clipboard!',
|
Permalink_copied_to_clipboard: 'Permalink copied to clipboard!',
|
||||||
|
|
|
@ -15,16 +15,12 @@ import parse from 'url-parse';
|
||||||
|
|
||||||
import { serverRequest } from '../actions/server';
|
import { serverRequest } from '../actions/server';
|
||||||
import sharedStyles from './Styles';
|
import sharedStyles from './Styles';
|
||||||
import scrollPersistTaps from '../utils/scrollPersistTaps';
|
|
||||||
import Button from '../containers/Button';
|
import Button from '../containers/Button';
|
||||||
import TextInput from '../containers/TextInput';
|
import TextInput from '../containers/TextInput';
|
||||||
|
import OnboardingSeparator from '../containers/OnboardingSeparator';
|
||||||
import FormContainer from '../containers/FormContainer';
|
import FormContainer from '../containers/FormContainer';
|
||||||
import I18n from '../i18n';
|
import I18n from '../i18n';
|
||||||
import KeyboardView from '../presentation/KeyboardView';
|
import { isIOS, isTablet } from '../utils/deviceInfo';
|
||||||
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 { themes } from '../constants/colors';
|
||||||
import log from '../utils/log';
|
import log from '../utils/log';
|
||||||
import { animateNextTransition } from '../utils/layoutAnimation';
|
import { animateNextTransition } from '../utils/layoutAnimation';
|
||||||
|
@ -43,11 +39,6 @@ const styles = StyleSheet.create({
|
||||||
marginTop: 24,
|
marginTop: 24,
|
||||||
marginBottom: 32
|
marginBottom: 32
|
||||||
},
|
},
|
||||||
backButton: {
|
|
||||||
position: 'absolute',
|
|
||||||
paddingHorizontal: 9,
|
|
||||||
left: 15
|
|
||||||
},
|
|
||||||
certificatePicker: {
|
certificatePicker: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
marginTop: 40,
|
marginTop: 40,
|
||||||
|
@ -61,6 +52,12 @@ const styles = StyleSheet.create({
|
||||||
chooseCertificate: {
|
chooseCertificate: {
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
...sharedStyles.textSemibold
|
...sharedStyles.textSemibold
|
||||||
|
},
|
||||||
|
description: {
|
||||||
|
...sharedStyles.textRegular,
|
||||||
|
fontSize: 14,
|
||||||
|
textAlign: 'left',
|
||||||
|
marginBottom: 24
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -232,28 +229,6 @@ class NewServerView extends React.Component {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
renderBack = () => {
|
|
||||||
const { navigation, theme } = this.props;
|
|
||||||
|
|
||||||
let top = 15;
|
|
||||||
if (isIOS) {
|
|
||||||
top = isNotch ? 45 : 30;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<TouchableOpacity
|
|
||||||
style={[styles.backButton, { top }]}
|
|
||||||
onPress={() => navigation.pop()}
|
|
||||||
>
|
|
||||||
<CustomIcon
|
|
||||||
name='back'
|
|
||||||
size={30}
|
|
||||||
color={themes[theme].tintColor}
|
|
||||||
/>
|
|
||||||
</TouchableOpacity>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
renderCertificatePicker = () => {
|
renderCertificatePicker = () => {
|
||||||
const { certificate } = this.state;
|
const { certificate } = this.state;
|
||||||
const { theme } = this.props;
|
const { theme } = this.props;
|
||||||
|
@ -311,12 +286,22 @@ class NewServerView extends React.Component {
|
||||||
onPress={this.submit}
|
onPress={this.submit}
|
||||||
disabled={!text}
|
disabled={!text}
|
||||||
loading={connecting}
|
loading={connecting}
|
||||||
|
style={{ marginBottom: 0 }}
|
||||||
testID='new-server-view-button'
|
testID='new-server-view-button'
|
||||||
theme={theme}
|
theme={theme}
|
||||||
/>
|
/>
|
||||||
|
<OnboardingSeparator theme={theme} />
|
||||||
|
<Text style={[styles.description, { color: themes[theme].auxiliaryText }]}>{I18n.t('Onboarding_join_open_description')}</Text>
|
||||||
|
<Button
|
||||||
|
title={I18n.t('Join_our_open_workspace')}
|
||||||
|
type='secondary'
|
||||||
|
backgroundColor={themes[theme].chatComponentBackground}
|
||||||
|
onPress={this.submit}
|
||||||
|
// loading={connecting} TODO: connecting to open
|
||||||
|
theme={theme}
|
||||||
|
/>
|
||||||
</View>
|
</View>
|
||||||
{ isIOS ? this.renderCertificatePicker() : null }
|
{ isIOS ? this.renderCertificatePicker() : null }
|
||||||
{/* <AppVersion theme={theme} /> */}
|
|
||||||
</FormContainer>
|
</FormContainer>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,10 +99,6 @@ class OnboardingView extends React.Component {
|
||||||
this.newServer();
|
this.newServer();
|
||||||
}
|
}
|
||||||
|
|
||||||
joinCommunity = () => {
|
|
||||||
this.newServer('https://open.rocket.chat');
|
|
||||||
}
|
|
||||||
|
|
||||||
createWorkspace = async() => {
|
createWorkspace = async() => {
|
||||||
try {
|
try {
|
||||||
await Linking.openURL('https://cloud.rocket.chat/trial');
|
await Linking.openURL('https://cloud.rocket.chat/trial');
|
||||||
|
|
Loading…
Reference in New Issue