Fix MM57562 (#7920)

* Fix MM57562

* fix: Add proper java version for android build

---------

Co-authored-by: Antonis Stamatiou <stamatiou.antonis@gmail.com>
This commit is contained in:
Daniel Espino García 2024-05-06 12:02:12 +02:00 committed by GitHub
parent b43cdd6fea
commit b4a3d7ff4d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 35 additions and 5 deletions

View file

@ -6,11 +6,11 @@ import Clipboard from '@react-native-clipboard/clipboard';
import React, {useCallback, useMemo} from 'react';
import {useIntl} from 'react-intl';
import {Keyboard, View, Text, StyleSheet, Platform} from 'react-native';
import MathView from 'react-native-math-view';
import {useSafeAreaInsets} from 'react-native-safe-area-context';
import FormattedText from '@components/formatted_text';
import ErrorBoundary from '@components/markdown/error_boundary';
import MathView from '@components/math_view';
import SlideUpPanelItem, {ITEM_HEIGHT} from '@components/slide_up_panel_item';
import TouchableWithFeedback from '@components/touchable_with_feedback';
import {Screens} from '@constants';

View file

@ -3,16 +3,16 @@
import React from 'react';
import {useIntl} from 'react-intl';
import {Text, View} from 'react-native';
import MathView from 'react-native-math-view';
import {Text, View, type DimensionValue} from 'react-native';
import ErrorBoundary from '@components/markdown/error_boundary';
import MathView from '@components/math_view';
import {makeStyleSheetFromTheme} from '@utils/theme';
import {typography} from '@utils/typography';
type Props = {
content: string;
maxMathWidth: number | string;
maxMathWidth: DimensionValue;
theme: Theme;
}

View file

@ -0,0 +1,30 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React, {useId, useMemo} from 'react';
import RNMathView from 'react-native-math-view';
import type {StyleProp, TextStyle, ViewStyle} from 'react-native';
// From node_modules/react-native-math-view/src/common.tsx
type Props = {
math: string;
onError?: (error: Error) => any;
renderError: ({error}: {error: Error}) => JSX.Element;
resizeMode: 'cover' | 'contain';
style: StyleProp<ViewStyle & Pick<TextStyle, 'color'>>;
}
const MathView = (props: Props) => {
const id = useId();
const config = useMemo(() => ({id}), []);
return (
<RNMathView
{...props}
config={config}
/>
);
};
export default MathView;

View file

@ -3,9 +3,9 @@
import React, {useCallback} from 'react';
import {Platform, ScrollView, Text, View} from 'react-native';
import MathView from 'react-native-math-view';
import {SafeAreaView, type Edge} from 'react-native-safe-area-context';
import MathView from '@components/math_view';
import {useTheme} from '@context/theme';
import useAndroidHardwareBackHandler from '@hooks/android_back_handler';
import {popTopScreen} from '@screens/navigation';