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