MM-40203: permalink modal viewer for mentions (#5999)

* Permalink initial commit

* Fixes: 10 items per page

* MM-40203: permalink modal viewer for mentions

Is triggered by pressing on an item in mentions,
and shows posts around that item, including the item in a modal.

* Adds previously deleted file

* address feedback

* Move showPermalink as a remote action

* address more feedback

* fetchPostsAround to only return PostModel

* Attempt to autoscroll to highlighted item

* Permalink to not highlight saved and pinned posts

* Add bottom margin using insets to permalink screen

* Use lottie loading indicator

* Switch to channel

* Missing translation string

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
This commit is contained in:
Kyriakos Z
2022-03-14 21:41:46 +02:00
committed by GitHub
parent a43dad53e1
commit 5178091ab0
16 changed files with 456 additions and 45 deletions

View File

@@ -0,0 +1,36 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {Keyboard} from 'react-native';
import {dismissAllModals, showModalOverCurrentContext} from '@screens/navigation';
import {changeOpacity} from '@utils/theme';
let showingPermalink = false;
export const displayPermalink = async (teamName: string, postId: string, openAsPermalink = true) => {
Keyboard.dismiss();
if (showingPermalink) {
await dismissAllModals();
}
const screen = 'Permalink';
const passProps = {
isPermalink: openAsPermalink,
teamName,
postId,
};
const options = {
layout: {
componentBackgroundColor: changeOpacity('#000', 0.2),
},
};
showingPermalink = true;
showModalOverCurrentContext(screen, passProps, options);
};
export const closePermalink = () => {
showingPermalink = false;
};