forked from Ivasoft/mattermost-mobile
* Fix navigation stack tracking * Fix hardwareBackPress handlers * Use user locale for formattedTime * Show in-app notifications when in a thread but hide when in the same thread * Fix post draft archived & read only safe area * Do not show reply post option in thread screen * Open permalink as full screen modal * Fix crash when using chinese locale * Fix team list and call handle team change
39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {Keyboard} from 'react-native';
|
|
import {OptionsModalPresentationStyle} from 'react-native-navigation';
|
|
|
|
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 = {
|
|
modalPresentationStyle: OptionsModalPresentationStyle.fullScreen,
|
|
layout: {
|
|
componentBackgroundColor: changeOpacity('#000', 0.2),
|
|
},
|
|
};
|
|
|
|
showingPermalink = true;
|
|
showModalOverCurrentContext(screen, passProps, options);
|
|
};
|
|
|
|
export const closePermalink = () => {
|
|
showingPermalink = false;
|
|
};
|