move create workspace button to dropdown
This commit is contained in:
parent
9c526b753e
commit
6008b9cacb
|
@ -1,6 +1,6 @@
|
|||
import React from 'react';
|
||||
import {
|
||||
View, Text, Image, Linking
|
||||
View, Text, Image
|
||||
} from 'react-native';
|
||||
import PropTypes from 'prop-types';
|
||||
import Orientation from 'react-native-orientation-locker';
|
||||
|
@ -45,15 +45,6 @@ class OnboardingView extends React.Component {
|
|||
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 (
|
||||
|
@ -71,14 +62,6 @@ class OnboardingView extends React.Component {
|
|||
theme={theme}
|
||||
testID='join-workspace'
|
||||
/>
|
||||
<Button
|
||||
title={I18n.t('Create_a_new_workspace')}
|
||||
type='secondary'
|
||||
backgroundColor={themes[theme].chatComponentBackground}
|
||||
onPress={this.createWorkspace}
|
||||
theme={theme}
|
||||
testID='create-workspace-button'
|
||||
/>
|
||||
</View>
|
||||
</FormContainerInner>
|
||||
</FormContainer>
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
import React, { Component } from 'react';
|
||||
import {
|
||||
View, Text, Animated, Easing, TouchableWithoutFeedback, TouchableOpacity, FlatList
|
||||
View, Text, Animated, Easing, TouchableWithoutFeedback, TouchableOpacity, FlatList, Linking
|
||||
} from 'react-native';
|
||||
import PropTypes from 'prop-types';
|
||||
import { connect, batch } from 'react-redux';
|
||||
import { withSafeAreaInsets } from 'react-native-safe-area-context';
|
||||
import * as List from '../../containers/List';
|
||||
import Button from '../../containers/Button';
|
||||
|
||||
import { toggleServerDropdown as toggleServerDropdownAction } from '../../actions/rooms';
|
||||
import { selectServerRequest as selectServerRequestAction, serverInitAdd as serverInitAddAction } from '../../actions/server';
|
||||
|
@ -108,6 +109,15 @@ class ServerDropdown extends Component {
|
|||
).start(() => toggleServerDropdown());
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
navToNewServer = (previousServer) => {
|
||||
const { appStart, initAdd } = this.props;
|
||||
batch(() => {
|
||||
|
@ -246,6 +256,16 @@ class ServerDropdown extends Component {
|
|||
ItemSeparatorComponent={List.Separator}
|
||||
keyboardShouldPersistTaps='always'
|
||||
/>
|
||||
<List.Separator />
|
||||
<Button
|
||||
title={I18n.t('Create_a_new_workspace')}
|
||||
type='secondary'
|
||||
onPress={this.createWorkspace}
|
||||
theme={theme}
|
||||
testID='rooms-list-header-create-workspace-button'
|
||||
style={styles.buttonCreateWorkspace}
|
||||
color={themes[theme].tintColor}
|
||||
/>
|
||||
</Animated.View>
|
||||
</>
|
||||
);
|
||||
|
|
|
@ -56,5 +56,10 @@ export default StyleSheet.create({
|
|||
marginRight: 12,
|
||||
paddingVertical: 10,
|
||||
...sharedStyles.textRegular
|
||||
},
|
||||
buttonCreateWorkspace: {
|
||||
height: 56,
|
||||
justifyContent: 'center',
|
||||
marginBottom: 0
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue