Used goToScreen instead of shoModal

This commit is contained in:
harshil Sharma 2023-10-17 10:15:42 +05:30
parent a5039fccc8
commit 65dc65df47
4 changed files with 56 additions and 1 deletions

View file

@ -0,0 +1,31 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react';
import OptionItem from '@app/components/option_item';
import {Screens} from '@app/constants';
import {useTheme} from '@app/context/theme';
import {dismissBottomSheet, goToScreen} from '@app/screens/navigation';
import {preventDoubleTap} from '@app/utils/tap';
const ConvertToChannelLabel = () => {
const goToConvertToPrivateChannl = preventDoubleTap(async () => {
await dismissBottomSheet();
const title = 'Convert to Private Channel';
goToScreen(Screens.CONVERT_GM_TO_CHANNEL, title, {});
});
// LOL: localize this
return (
<OptionItem
action={goToConvertToPrivateChannl}
icon='lock-outline'
label='Convert to a Private Channel'
type='default'
/>
);
};
export default ConvertToChannelLabel;

View file

@ -0,0 +1,17 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react';
import { Text, View } from 'react-native';
type Props = {
}
const ConvertGMToChannel = (props: Props) => {
return (
<Text>{'ConvertGMToChannel component'}</Text>
);
};
export default ConvertGMToChannel;

View file

@ -0,0 +1,8 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {withDatabase} from '@nozbe/watermelondb/DatabaseProvider';
import ConvertGMToChannel from './convert_gm_to_channel';
export default ConvertGMToChannel;

View file

@ -245,7 +245,6 @@ export function getThemeFromState(): Theme {
function isScreenRegistered(screen: AvailableScreens) {
const notImplemented = NOT_READY.includes(screen) || !Object.values(Screens).includes(screen);
if (notImplemented) {
console.log('AAAA');
Alert.alert(
'Temporary error ' + screen,
'The functionality you are trying to use has not been implemented yet',