* Fix autocomplete showing behind the keyboard on iOS and not working on Android * Unbundle config for Android * Dismiss keyboard on post long press, fix scroll to bottom on new message and update tests * Add a timeout before scrolling to give time to render the last post * Fix crash on Android
70 lines
2 KiB
JavaScript
70 lines
2 KiB
JavaScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import React from 'react';
|
|
|
|
import {THREAD} from 'app/constants/screen';
|
|
|
|
import Loading from 'app/components/loading';
|
|
import KeyboardLayout from 'app/components/layout/keyboard_layout';
|
|
import PostList from 'app/components/post_list';
|
|
import PostTextbox from 'app/components/post_textbox';
|
|
import SafeAreaView from 'app/components/safe_area_view';
|
|
import StatusBar from 'app/components/status_bar';
|
|
|
|
import ThreadBase from './thread_base';
|
|
|
|
export default class ThreadAndroid extends ThreadBase {
|
|
render() {
|
|
const {
|
|
channelId,
|
|
myMember,
|
|
navigator,
|
|
postIds,
|
|
rootId,
|
|
channelIsArchived,
|
|
} = this.props;
|
|
|
|
let content;
|
|
let postTextBox;
|
|
if (this.hasRootPost()) {
|
|
content = (
|
|
<PostList
|
|
renderFooter={this.renderFooter()}
|
|
indicateNewMessages={false}
|
|
postIds={postIds}
|
|
currentUserId={myMember && myMember.user_id}
|
|
lastViewedAt={this.state.lastViewedAt}
|
|
lastPostIndex={-1}
|
|
navigator={navigator}
|
|
onPostPress={this.hideKeyboard}
|
|
location={THREAD}
|
|
/>
|
|
);
|
|
|
|
postTextBox = (
|
|
<PostTextbox
|
|
channelIsArchived={channelIsArchived}
|
|
rootId={rootId}
|
|
channelId={channelId}
|
|
navigator={navigator}
|
|
onCloseChannel={this.onCloseChannel}
|
|
/>
|
|
);
|
|
} else {
|
|
content = (
|
|
<Loading/>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<SafeAreaView>
|
|
<StatusBar/>
|
|
<KeyboardLayout>
|
|
{content}
|
|
{postTextBox}
|
|
</KeyboardLayout>
|
|
</SafeAreaView>
|
|
);
|
|
}
|
|
}
|