minor tweaks and removed onboardingview
This commit is contained in:
parent
c57caafaf8
commit
9449949ac3
|
@ -1,9 +1,4 @@
|
|||
export default {
|
||||
// ONBOARDING VIEW
|
||||
ONBOARD_JOIN_A_WORKSPACE: 'onboard_join_a_workspace',
|
||||
ONBOARD_CREATE_NEW_WORKSPACE: 'onboard_create_new_workspace',
|
||||
ONBOARD_CREATE_NEW_WORKSPACE_F: 'onboard_create_new_workspace_f',
|
||||
|
||||
// NEW SERVER VIEW
|
||||
NS_CONNECT_TO_WORKSPACE: 'ns_connect_to_workspace',
|
||||
NS_JOIN_OPEN_WORKSPACE: 'ns_join_open_workspace',
|
||||
|
@ -78,6 +73,8 @@ export default {
|
|||
RL_GROUP_CHANNELS_BY_TYPE: 'rl_group_channels_by_type',
|
||||
RL_GROUP_CHANNELS_BY_FAVORITE: 'rl_group_channels_by_favorite',
|
||||
RL_GROUP_CHANNELS_BY_UNREAD: 'rl_group_channels_by_unread',
|
||||
RL_CREATE_NEW_WORKSPACE: 'rl_create_new_workspace',
|
||||
RL_CREATE_NEW_WORKSPACE_F: 'rl_create_new_workspace_f',
|
||||
|
||||
// QUEUE LIST VIEW
|
||||
QL_GO_ROOM: 'ql_go_room',
|
||||
|
|
|
@ -44,8 +44,7 @@ const styles = StyleSheet.create({
|
|||
letterSpacing: 0,
|
||||
fontSize: 22,
|
||||
alignSelf: 'center',
|
||||
marginBottom: 8,
|
||||
lineHeight: 32
|
||||
marginBottom: 8
|
||||
},
|
||||
subtitle: {
|
||||
...sharedStyles.textRegular,
|
||||
|
|
|
@ -1,70 +0,0 @@
|
|||
import React from 'react';
|
||||
import { View, Text, Image } from 'react-native';
|
||||
import PropTypes from 'prop-types';
|
||||
import Orientation from 'react-native-orientation-locker';
|
||||
|
||||
import I18n from '../../i18n';
|
||||
import Button from '../../containers/Button';
|
||||
import { isTablet } from '../../utils/deviceInfo';
|
||||
import { themes } from '../../constants/colors';
|
||||
import { withTheme } from '../../theme';
|
||||
import FormContainer, { FormContainerInner } from '../../containers/FormContainer';
|
||||
import { events, logEvent } from '../../utils/log';
|
||||
import styles from './styles';
|
||||
|
||||
class OnboardingView extends React.Component {
|
||||
static navigationOptions = {
|
||||
headerShown: false
|
||||
};
|
||||
|
||||
static propTypes = {
|
||||
navigation: PropTypes.object,
|
||||
theme: PropTypes.string
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
if (!isTablet) {
|
||||
Orientation.lockToPortrait();
|
||||
}
|
||||
}
|
||||
|
||||
shouldComponentUpdate(nextProps) {
|
||||
const { theme } = this.props;
|
||||
if (theme !== nextProps.theme) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
connectServer = () => {
|
||||
logEvent(events.ONBOARD_JOIN_A_WORKSPACE);
|
||||
const { navigation } = this.props;
|
||||
navigation.navigate('NewServerView');
|
||||
};
|
||||
|
||||
render() {
|
||||
const { theme } = this.props;
|
||||
return (
|
||||
<FormContainer theme={theme} testID='onboarding-view'>
|
||||
<FormContainerInner>
|
||||
<Image style={styles.onboarding} source={require('../../static/images/logo.png')} fadeDuration={0} />
|
||||
<Text style={[styles.title, { color: themes[theme].titleText }]}>{I18n.t('Onboarding_title')}</Text>
|
||||
<Text style={[styles.subtitle, { color: themes[theme].controlText }]}>{I18n.t('Onboarding_subtitle')}</Text>
|
||||
<Text style={[styles.description, { color: themes[theme].auxiliaryText }]}>{I18n.t('Onboarding_description')}</Text>
|
||||
<View style={styles.buttonsContainer}>
|
||||
<Button
|
||||
title={I18n.t('Onboarding_join_workspace')}
|
||||
type='primary'
|
||||
onPress={this.connectServer}
|
||||
theme={theme}
|
||||
testID='join-workspace'
|
||||
/>
|
||||
</View>
|
||||
</FormContainerInner>
|
||||
</FormContainer>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default withTheme(OnboardingView);
|
|
@ -1,41 +0,0 @@
|
|||
import { StyleSheet } from 'react-native';
|
||||
|
||||
import { moderateScale, verticalScale } from '../../utils/scaling';
|
||||
import { isTablet } from '../../utils/deviceInfo';
|
||||
import sharedStyles from '../Styles';
|
||||
|
||||
export default StyleSheet.create({
|
||||
onboarding: {
|
||||
alignSelf: 'center',
|
||||
marginTop: isTablet ? 0 : verticalScale(116),
|
||||
marginBottom: verticalScale(50),
|
||||
maxHeight: verticalScale(150),
|
||||
resizeMode: 'contain',
|
||||
width: 100,
|
||||
height: 100
|
||||
},
|
||||
title: {
|
||||
...sharedStyles.textBold,
|
||||
letterSpacing: 0,
|
||||
fontSize: moderateScale(24),
|
||||
alignSelf: 'center',
|
||||
marginBottom: verticalScale(8)
|
||||
},
|
||||
subtitle: {
|
||||
...sharedStyles.textRegular,
|
||||
fontSize: moderateScale(16),
|
||||
alignSelf: 'center',
|
||||
marginBottom: verticalScale(24)
|
||||
},
|
||||
description: {
|
||||
...sharedStyles.textRegular,
|
||||
...sharedStyles.textAlignCenter,
|
||||
fontSize: moderateScale(14),
|
||||
alignSelf: 'center',
|
||||
marginHorizontal: 20
|
||||
},
|
||||
buttonsContainer: {
|
||||
marginBottom: verticalScale(10),
|
||||
marginTop: verticalScale(30)
|
||||
}
|
||||
});
|
|
@ -99,11 +99,11 @@ class ServerDropdown extends Component {
|
|||
};
|
||||
|
||||
createWorkspace = async () => {
|
||||
logEvent(events.ONBOARD_CREATE_NEW_WORKSPACE);
|
||||
logEvent(events.RL_CREATE_NEW_WORKSPACE);
|
||||
try {
|
||||
await Linking.openURL('https://cloud.rocket.chat/trial');
|
||||
} catch {
|
||||
logEvent(events.ONBOARD_CREATE_NEW_WORKSPACE_F);
|
||||
logEvent(events.RL_CREATE_NEW_WORKSPACE_F);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue