Merge branch 'develop' of https://github.com/RocketChat/Rocket.Chat.ReactNative into detoxRunner
This commit is contained in:
commit
af1de5711b
|
@ -26,4 +26,14 @@
|
||||||
<item name="colorPrimaryDark">@color/splashBackground</item>
|
<item name="colorPrimaryDark">@color/splashBackground</item>
|
||||||
<item name="android:navigationBarColor">@color/splashBackground</item>
|
<item name="android:navigationBarColor">@color/splashBackground</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<!-- https://github.com/facebook/react-native/blob/d1ab03235cb4b93304150878d2b9057ab45bba77/ReactAndroid/src/main/res/views/modal/values/themes.xml#L5 -->
|
||||||
|
<style name="Theme.FullScreenDialog">
|
||||||
|
<item name="android:windowNoTitle">true</item>
|
||||||
|
<item name="android:windowIsFloating">false</item>
|
||||||
|
<item name="android:windowBackground">@android:color/transparent</item>
|
||||||
|
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
|
||||||
|
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||||
|
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||||
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -25,6 +25,7 @@ import Navigation from '../lib/Navigation';
|
||||||
import { createChannelRequest } from '../actions/createChannel';
|
import { createChannelRequest } from '../actions/createChannel';
|
||||||
import { goRoom } from '../utils/goRoom';
|
import { goRoom } from '../utils/goRoom';
|
||||||
import SafeAreaView from '../containers/SafeAreaView';
|
import SafeAreaView from '../containers/SafeAreaView';
|
||||||
|
import { compareServerVersion, methods } from '../lib/utils';
|
||||||
|
|
||||||
const QUERY_SIZE = 50;
|
const QUERY_SIZE = 50;
|
||||||
|
|
||||||
|
@ -63,7 +64,8 @@ class NewMessageView extends React.Component {
|
||||||
create: PropTypes.func,
|
create: PropTypes.func,
|
||||||
maxUsers: PropTypes.number,
|
maxUsers: PropTypes.number,
|
||||||
theme: PropTypes.string,
|
theme: PropTypes.string,
|
||||||
isMasterDetail: PropTypes.bool
|
isMasterDetail: PropTypes.bool,
|
||||||
|
serverVersion: PropTypes.string
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
@ -166,7 +168,7 @@ class NewMessageView extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
renderHeader = () => {
|
renderHeader = () => {
|
||||||
const { maxUsers, theme } = this.props;
|
const { maxUsers, theme, serverVersion } = this.props;
|
||||||
return (
|
return (
|
||||||
<View style={{ backgroundColor: themes[theme].auxiliaryBackground }}>
|
<View style={{ backgroundColor: themes[theme].auxiliaryBackground }}>
|
||||||
<SearchBox onChangeText={text => this.onSearchChangeText(text)} testID='new-message-view-search' />
|
<SearchBox onChangeText={text => this.onSearchChangeText(text)} testID='new-message-view-search' />
|
||||||
|
@ -178,12 +180,13 @@ class NewMessageView extends React.Component {
|
||||||
testID: 'new-message-view-create-channel',
|
testID: 'new-message-view-create-channel',
|
||||||
first: true
|
first: true
|
||||||
})}
|
})}
|
||||||
{this.renderButton({
|
{compareServerVersion(serverVersion, '3.13.0', methods.greaterThanOrEqualTo)
|
||||||
|
? (this.renderButton({
|
||||||
onPress: this.createTeam,
|
onPress: this.createTeam,
|
||||||
title: I18n.t('Create_Team'),
|
title: I18n.t('Create_Team'),
|
||||||
icon: 'teams',
|
icon: 'teams',
|
||||||
testID: 'new-message-view-create-team'
|
testID: 'new-message-view-create-team'
|
||||||
})}
|
})) : null}
|
||||||
{maxUsers > 2 ? this.renderButton({
|
{maxUsers > 2 ? this.renderButton({
|
||||||
onPress: this.createGroupChat,
|
onPress: this.createGroupChat,
|
||||||
title: I18n.t('Create_Direct_Messages'),
|
title: I18n.t('Create_Direct_Messages'),
|
||||||
|
@ -258,6 +261,7 @@ class NewMessageView extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
const mapStateToProps = state => ({
|
const mapStateToProps = state => ({
|
||||||
|
serverVersion: state.server.version,
|
||||||
isMasterDetail: state.app.isMasterDetail,
|
isMasterDetail: state.app.isMasterDetail,
|
||||||
baseUrl: state.server.server,
|
baseUrl: state.server.server,
|
||||||
maxUsers: state.settings.DirectMesssage_maxUsers || 1,
|
maxUsers: state.settings.DirectMesssage_maxUsers || 1,
|
||||||
|
|
Loading…
Reference in New Issue