forked from Ivasoft/mattermost-mobile
* Fix permalink to not joined channels and to not fetched posts. * i18n-extract * Implement as designed * Revert unintended change * Minor fix and fix svgs * updated svg to fix masking problems and colors * Fix lint * Address feedback * Update join_public_channel.tsx fixed public channel svg * Update join_public_channel.tsx * Update join_private_channel.tsx * Address feedback Co-authored-by: Matthew Birtch <mattbirtch@gmail.com>
43 lines
1.2 KiB
TypeScript
43 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 {Screens} from '@constants';
|
|
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 = Screens.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;
|
|
};
|