Files
mattermost-mobile/app/utils/permalink/index.ts
Elias Nahum 2f07b7afc8 [Gekidou] user profile (#6353)
* User profile

* Access User Profile from reaction list

* Fix threads participants list & open user profile on tap

* Extra bottom padding

* Profile long press tutorial

* Adjust heights

* Reduce label margin from 12 to 8
2022-06-06 11:27:25 -04:00

42 lines
1.2 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {Keyboard, Platform} 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: Platform.select({
ios: OptionsModalPresentationStyle.overFullScreen,
default: OptionsModalPresentationStyle.overCurrentContext,
}),
layout: {
componentBackgroundColor: changeOpacity('#000', 0.2),
},
};
showingPermalink = true;
showModalOverCurrentContext(screen, passProps, options);
};
export const closePermalink = () => {
showingPermalink = false;
};