mattermost-mobile-upstream/app/screens/thread_options/thread_options.tsx
Carlos Garcia f2857a97d1
Mm 67525 bump min version (#9640)
* bumps minSdkVersion to 30

Older versions are past end-of-life for security patches. voximplant service patch is also updated with minSdkVersion set to 30.

* removes manifest attributes no longer needed when minSdk is 30

* removes guard to for version lower than O

* removes permission check for versions lower than 28

* remove tests related to unsupported android sdk versions

* bumps iOS minSdkVersion to 18

* removes iOS 13/15 guards in hardware-keyboard

* removes iOS 15 guards in NotificationService

* removes iOS 15 guard in Gekidou network delegate

since gekidou is iOS only other platform guards are not needed

* removes version guard no longer needed in voximplant patch

* removes hasWriteStoragePermission dead stub and its call site

* removes unused setSoftKeyboardToAdjustResize from rnutils

The function had no call sites in JS/TS code and the iOS implementation
was a no-op.

* removes version guards and updates config after min version bump

* updates stale iOS 17 simulator references in CI to iOS 18.1

Co-Authored-By: Carlos Garcia <carlos.garcia@mattermost.com>

* fixes malformed patch file headers

- voximplant patch: restore missing diff --git header and index line
  for VIForegroundServiceModule.java, fix stale hunk counter (+11 -> +7)
- notifications patch: fix stale hunk line count (+91 -> +89) after
  KITKAT branch removal

Co-Authored-By: Carlos Garcia <carlos.garcia@mattermost.com>

* remove code below the supported OS versions

* Bump IntuneMAM SDK to 21.8.0 and MSAL to 2.15.0

---------

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2026-09-16 10:53:06 +00:00

123 lines
3.5 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {useManagedConfig} from '@mattermost/react-native-emm';
import React, {useMemo} from 'react';
import {View} from 'react-native';
import {useSafeAreaInsets} from 'react-native-safe-area-context';
import {CopyPermalinkOption, FollowThreadOption, ReplyOption, SaveOption} from '@components/common_post_options';
import FormattedText from '@components/formatted_text';
import {ITEM_HEIGHT} from '@components/option_item';
import {Screens} from '@constants';
import {useTheme} from '@context/theme';
import BottomSheet from '@screens/bottom_sheet';
import {bottomSheetSnapPoint} from '@utils/helpers';
import {makeStyleSheetFromTheme} from '@utils/theme';
import {typography} from '@utils/typography';
import {TITLE_HEIGHT} from '../bottom_sheet/content';
import MarkAsUnreadOption from './options/mark_as_unread_option';
import OpenInChannelOption from './options/open_in_channel_option';
import type PostModel from '@typings/database/models/servers/post';
import type TeamModel from '@typings/database/models/servers/team';
import type ThreadModel from '@typings/database/models/servers/thread';
type ThreadOptionsProps = {
isSaved: boolean;
post: PostModel;
team: TeamModel;
thread: ThreadModel;
};
const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => {
return {
listHeader: {
marginBottom: 8,
},
listHeaderText: {
color: theme.centerChannelColor,
...typography('Heading', 600, 'SemiBold'),
},
};
});
const ThreadOptions = ({
isSaved,
post,
team,
thread,
}: ThreadOptionsProps) => {
const theme = useTheme();
const style = getStyleSheet(theme);
const {bottom} = useSafeAreaInsets();
const options = [
<ReplyOption
key='reply'
post={post}
/>,
<FollowThreadOption
key='unfollow'
thread={thread}
/>,
<OpenInChannelOption
key='open-in-channel'
threadId={thread.id}
/>,
<MarkAsUnreadOption
key='mark-as-unread'
teamId={team.id}
thread={thread}
/>,
<SaveOption
key='save'
isSaved={isSaved}
postId={thread.id}
/>,
];
const managedConfig = useManagedConfig<ManagedConfig>();
const canCopyLink = managedConfig?.copyAndPasteProtection !== 'true';
if (canCopyLink) {
options.push(
<CopyPermalinkOption
key='copy-link'
post={post}
sourceScreen={Screens.THREAD_OPTIONS}
/>,
);
}
const snapPoint = useMemo(() => (
bottom + TITLE_HEIGHT + bottomSheetSnapPoint(options.length, ITEM_HEIGHT)
), [options.length, bottom]);
const renderContent = () => (
<>
<View style={style.listHeader}>
<FormattedText
id='global_threads.options.title'
defaultMessage={'Thread Actions'}
style={style.listHeaderText}
/>
</View>
{options}
</>
);
return (
<BottomSheet
renderContent={renderContent}
screen={Screens.THREAD_OPTIONS}
initialSnapIndex={1}
snapPoints={[1, snapPoint]}
testID='thread_options'
/>
);
};
export default ThreadOptions;