minor tweaks

This commit is contained in:
Reinaldo Neto 2021-09-21 17:52:32 -03:00
parent 38b8415c73
commit cd583bb503
4 changed files with 54 additions and 32 deletions

View File

@ -1,9 +1,9 @@
import { APP } from './actionsTypes'; import { APP } from './actionsTypes';
export const ROOT_OUTSIDE = 'outside'; export const ROOT_OUTSIDE = 'outside';
export const ROOT_NEW_SERVER = 'newServer';
export const ROOT_INSIDE = 'inside'; export const ROOT_INSIDE = 'inside';
export const ROOT_LOADING = 'loading'; export const ROOT_LOADING = 'loading';
export const ROOT_NEW_SERVER = 'newServer';
export const ROOT_SET_USERNAME = 'setUsername'; export const ROOT_SET_USERNAME = 'setUsername';
export function appStart({ root, ...args }) { export function appStart({ root, ...args }) {

View File

@ -772,6 +772,5 @@
"Converting_Team_To_Channel": "Converting Team to Channel", "Converting_Team_To_Channel": "Converting Team to Channel",
"Select_Team_Channels_To_Delete": "Select the Teams Channels you would like to delete, the ones you do not select will be moved to the Workspace. \n\nNotice that public Channels will be public and visible to everyone.", "Select_Team_Channels_To_Delete": "Select the Teams Channels you would like to delete, the ones you do not select will be moved to the Workspace. \n\nNotice that public Channels will be public and visible to everyone.",
"You_are_converting_the_team": "You are converting this Team to a Channel", "You_are_converting_the_team": "You are converting this Team to a Channel",
"creating_discussion": "creating discussion", "creating_discussion": "creating discussion"
"Rocket_Chat": "Rocket.Chat"
} }

View File

@ -6,6 +6,7 @@ import { Base64 } from 'js-base64';
import parse from 'url-parse'; import parse from 'url-parse';
import { Q } from '@nozbe/watermelondb'; import { Q } from '@nozbe/watermelondb';
import { TouchableOpacity } from 'react-native-gesture-handler'; import { TouchableOpacity } from 'react-native-gesture-handler';
import Orientation from 'react-native-orientation-locker';
import UserPreferences from '../../lib/userPreferences'; import UserPreferences from '../../lib/userPreferences';
import EventEmitter from '../../utils/events'; import EventEmitter from '../../utils/events';
@ -29,48 +30,37 @@ import { sanitizeLikeString } from '../../lib/database/utils';
import SSLPinning from '../../utils/sslPinning'; import SSLPinning from '../../utils/sslPinning';
import RocketChat from '../../lib/rocketchat'; import RocketChat from '../../lib/rocketchat';
import { isTablet } from '../../utils/deviceInfo'; import { isTablet } from '../../utils/deviceInfo';
import { verticalScale, moderateScale } from '../../utils/scaling';
import ServerInput from './ServerInput'; import ServerInput from './ServerInput';
const styles = StyleSheet.create({ const styles = StyleSheet.create({
onboardingImage: { onboardingImage: {
alignSelf: 'center', alignSelf: 'center',
marginTop: isTablet ? 0 : 70,
marginBottom: 25,
maxHeight: 150,
width: 100, width: 100,
height: 100 height: 100
}, },
title: { title: {
...sharedStyles.textBold, ...sharedStyles.textBold,
letterSpacing: 0, letterSpacing: 0,
fontSize: 22, alignSelf: 'center'
alignSelf: 'center',
marginBottom: 8
}, },
subtitle: { subtitle: {
...sharedStyles.textRegular, ...sharedStyles.textRegular,
fontSize: 16, alignSelf: 'center'
alignSelf: 'center',
marginBottom: 41
}, },
certificatePicker: { certificatePicker: {
marginBottom: 32,
alignItems: 'center', alignItems: 'center',
justifyContent: 'flex-end' justifyContent: 'flex-end'
}, },
chooseCertificateTitle: { chooseCertificateTitle: {
fontSize: 13,
...sharedStyles.textRegular ...sharedStyles.textRegular
}, },
chooseCertificate: { chooseCertificate: {
fontSize: 13,
...sharedStyles.textSemibold ...sharedStyles.textSemibold
}, },
description: { description: {
...sharedStyles.textRegular, ...sharedStyles.textRegular,
fontSize: 14, textAlign: 'center'
textAlign: 'center',
marginBottom: 24
}, },
connectButton: { connectButton: {
marginBottom: 0 marginBottom: 0
@ -92,6 +82,9 @@ class NewServerView extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
if (!isTablet) {
Orientation.lockToPortrait();
}
this.setHeader(); this.setHeader();
this.state = { this.state = {
@ -123,15 +116,15 @@ class NewServerView extends React.Component {
setHeader = () => { setHeader = () => {
const { adding, navigation, root } = this.props; const { adding, navigation, root } = this.props;
if (adding && root === ROOT_NEW_SERVER) { if (adding && root === ROOT_NEW_SERVER) {
navigation.setOptions({ return navigation.setOptions({
headerTitle: I18n.t('Workspaces'), headerTitle: I18n.t('Workspaces'),
headerLeft: () => <HeaderButton.CloseModal navigation={navigation} onPress={this.close} testID='new-server-view-close' /> headerLeft: () => <HeaderButton.CloseModal navigation={navigation} onPress={this.close} testID='new-server-view-close' />
}); });
} else { }
navigation.setOptions({
return navigation.setOptions({
headerShown: false headerShown: false
}); });
}
}; };
handleBackPress = () => { handleBackPress = () => {
@ -296,14 +289,20 @@ class NewServerView extends React.Component {
const { certificate } = this.state; const { certificate } = this.state;
const { theme } = this.props; const { theme } = this.props;
return ( return (
<View style={styles.certificatePicker}> <View
<Text style={[styles.chooseCertificateTitle, { color: themes[theme].auxiliaryText }]}> style={[
styles.certificatePicker,
{
marginBottom: verticalScale(32)
}
]}>
<Text style={[styles.chooseCertificateTitle, { color: themes[theme].auxiliaryText, fontSize: moderateScale(13) }]}>
{certificate ? I18n.t('Your_certificate') : I18n.t('Do_you_have_a_certificate')} {certificate ? I18n.t('Your_certificate') : I18n.t('Do_you_have_a_certificate')}
</Text> </Text>
<TouchableOpacity <TouchableOpacity
onPress={certificate ? this.handleRemove : this.chooseCertificate} onPress={certificate ? this.handleRemove : this.chooseCertificate}
testID='new-server-choose-certificate'> testID='new-server-choose-certificate'>
<Text style={[styles.chooseCertificate, { color: themes[theme].tintColor }]}> <Text style={[styles.chooseCertificate, { color: themes[theme].tintColor, fontSize: moderateScale(13) }]}>
{certificate ?? I18n.t('Apply_Your_Certificate')} {certificate ?? I18n.t('Apply_Your_Certificate')}
</Text> </Text>
</TouchableOpacity> </TouchableOpacity>
@ -312,19 +311,40 @@ class NewServerView extends React.Component {
}; };
render() { render() {
const { connecting, theme } = this.props; const { connecting, theme, adding, root } = this.props;
const { text, connectingOpen, serversHistory } = this.state; const { text, connectingOpen, serversHistory } = this.state;
const marginTopHeader = adding && root === ROOT_NEW_SERVER ? 25 : 70;
return ( return (
<FormContainer theme={theme} testID='new-server-view' keyboardShouldPersistTaps='never'> <FormContainer theme={theme} testID='new-server-view' keyboardShouldPersistTaps='never'>
<FormContainerInner> <FormContainerInner>
<Image <Image
style={styles.onboardingImage} style={[
styles.onboardingImage,
{
marginTop: isTablet ? 0 : verticalScale(marginTopHeader),
marginBottom: verticalScale(25),
maxHeight: verticalScale(150)
}
]}
source={require('../../static/images/logo.png')} source={require('../../static/images/logo.png')}
fadeDuration={0} fadeDuration={0}
resizeMode='stretch' resizeMode='stretch'
/> />
<Text style={[styles.title, { color: themes[theme].titleText }]}>{I18n.t('Rocket_Chat')}</Text> <Text
<Text style={[styles.subtitle, { color: themes[theme].controlText }]}>{I18n.t('Onboarding_subtitle')}</Text> style={[
styles.title,
{ color: themes[theme].titleText, fontSize: moderateScale(22), marginBottom: verticalScale(8) }
]}>
Rocket.Chat
</Text>
<Text
style={[
styles.subtitle,
{ color: themes[theme].controlText, fontSize: moderateScale(16), marginBottom: verticalScale(41) }
]}>
{I18n.t('Onboarding_subtitle')}
</Text>
<ServerInput <ServerInput
text={text} text={text}
theme={theme} theme={theme}
@ -345,7 +365,11 @@ class NewServerView extends React.Component {
testID='new-server-view-button' testID='new-server-view-button'
/> />
<OrSeparator theme={theme} /> <OrSeparator theme={theme} />
<Text style={[styles.description, { color: themes[theme].auxiliaryText }]}> <Text
style={[
styles.description,
{ color: themes[theme].auxiliaryText, fontSize: moderateScale(14), marginBottom: verticalScale(24) }
]}>
{I18n.t('Onboarding_join_open_description')} {I18n.t('Onboarding_join_open_description')}
</Text> </Text>
<Button <Button

View File

@ -103,7 +103,6 @@ class ServerDropdown extends Component {
try { try {
await Linking.openURL('https://cloud.rocket.chat/trial'); await Linking.openURL('https://cloud.rocket.chat/trial');
} catch (e) { } catch (e) {
logEvent(events.RL_CREATE_NEW_WORKSPACE_F);
log(e); log(e);
} }
}; };