Used goToScreen instead of shoModal
This commit is contained in:
parent
a5039fccc8
commit
65dc65df47
4 changed files with 56 additions and 1 deletions
|
|
@ -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;
|
||||
17
app/screens/convert_gm_to_channel/convert_gm_to_channel.tsx
Normal file
17
app/screens/convert_gm_to_channel/convert_gm_to_channel.tsx
Normal 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;
|
||||
8
app/screens/convert_gm_to_channel/index.tsx
Normal file
8
app/screens/convert_gm_to_channel/index.tsx
Normal 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;
|
||||
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Reference in a new issue