import React from 'react'; import { Image, Linking, Text, View } 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'); }; createWorkspace = async () => { logEvent(events.ONBOARD_CREATE_NEW_WORKSPACE); try { await Linking.openURL('https://cloud.rocket.chat/trial'); } catch { logEvent(events.ONBOARD_CREATE_NEW_WORKSPACE_F); } }; render() { const { theme } = this.props; return ( {I18n.t('Onboarding_title')} {I18n.t('Onboarding_subtitle')} {I18n.t('Onboarding_description')}