From e4a5ebca403c58a73cee14956cd1fb233468e269 Mon Sep 17 00:00:00 2001 From: enahum Date: Mon, 5 Jun 2017 16:40:37 -0400 Subject: [PATCH] Fix android channel drawer (#597) --- app/components/channel_drawer/channel_drawer.js | 5 +---- app/screens/channel/channel.js | 11 ++++++++--- .../channel/channel_post_list/channel_post_list.js | 11 +++++++++-- package.json | 2 +- yarn.lock | 8 ++++---- 5 files changed, 23 insertions(+), 14 deletions(-) diff --git a/app/components/channel_drawer/channel_drawer.js b/app/components/channel_drawer/channel_drawer.js index 3138eb2dc..2b892427a 100644 --- a/app/components/channel_drawer/channel_drawer.js +++ b/app/components/channel_drawer/channel_drawer.js @@ -154,10 +154,7 @@ export default class ChannelDrawer extends PureComponent { }; resetDrawer = () => { - const teamsCount = Object.keys(this.props.myTeamMembers).length; - if (this.swiperIndex === 0 && teamsCount > 1) { - this.refs.swiper.resetPage(); - } + this.refs.swiper.resetPage(); }; renderContent = () => { diff --git a/app/screens/channel/channel.js b/app/screens/channel/channel.js index fd882a190..33019377d 100644 --- a/app/screens/channel/channel.js +++ b/app/screens/channel/channel.js @@ -102,8 +102,7 @@ class Channel extends PureComponent { goToChannelInfo = () => { const {intl, navigator, theme} = this.props; - - navigator.push({ + const options = { screen: 'ChannelInfo', title: intl.formatMessage({id: 'mobile.routes.channelInfo', defaultMessage: 'Info'}), animated: true, @@ -114,7 +113,13 @@ class Channel extends PureComponent { navBarButtonColor: theme.sidebarHeaderTextColor, screenBackgroundColor: theme.centerChannelBg } - }); + }; + + if (Platform.OS === 'android') { + navigator.showModal(options); + } else { + navigator.push(options); + } }; handleConnectionChange = (isConnected) => { diff --git a/app/screens/channel/channel_post_list/channel_post_list.js b/app/screens/channel/channel_post_list/channel_post_list.js index 2e856ec06..a65b10d08 100644 --- a/app/screens/channel/channel_post_list/channel_post_list.js +++ b/app/screens/channel/channel_post_list/channel_post_list.js @@ -7,6 +7,7 @@ import {injectIntl, intlShape} from 'react-intl'; import { Animated, Dimensions, + Platform, View } from 'react-native'; @@ -124,7 +125,7 @@ class ChannelPostList extends PureComponent { title = intl.formatMessage({id: 'mobile.routes.thread', defaultMessage: '{channelName} Thread'}, {channelName}); } - navigator.push({ + const options = { screen: 'Thread', title, animated: true, @@ -139,7 +140,13 @@ class ChannelPostList extends PureComponent { channelId, rootId } - }); + }; + + if (Platform.OS === 'android') { + navigator.showModal(options); + } else { + navigator.push(options); + } }; render() { diff --git a/package.json b/package.json index 03724600c..6a99753d2 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "react-native-invertible-scroll-view": "1.0.0", "react-native-keyboard-aware-scroll-view": "0.2.8", "react-native-linear-gradient": "2.0.0", - "react-native-navigation": "1.1.72", + "react-native-navigation": "1.1.88", "react-native-notifications": "enahum/react-native-notifications.git", "react-native-orientation": "enahum/react-native-orientation.git", "react-native-search-bar": "enahum/react-native-search-bar.git", diff --git a/yarn.lock b/yarn.lock index e9b3c2492..ca3a297d9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3645,7 +3645,7 @@ makeerror@1.0.x: mattermost-redux@mattermost/mattermost-redux#master: version "0.0.1" - resolved "https://codeload.github.com/mattermost/mattermost-redux/tar.gz/67a40ea6c89a5065b751f434094183956817b1d3" + resolved "https://codeload.github.com/mattermost/mattermost-redux/tar.gz/969e3ef432a077025ae13d3ad917bf5aaf054086" dependencies: deep-equal "1.0.1" harmony-reflect "1.5.1" @@ -4531,9 +4531,9 @@ react-native-mock@^0.2.7: react-timer-mixin "^0.13.3" warning "^2.1.0" -react-native-navigation@1.1.72: - version "1.1.72" - resolved "https://registry.yarnpkg.com/react-native-navigation/-/react-native-navigation-1.1.72.tgz#18e5067e74d5690b7bfddd100b06d5a7126ba2a8" +react-native-navigation@1.1.88: + version "1.1.88" + resolved "https://registry.yarnpkg.com/react-native-navigation/-/react-native-navigation-1.1.88.tgz#22239c8c722b13a8750a5b99debd45bded13c2f5" dependencies: lodash "4.x.x"