Chore: evaluate `MarkdownTableView` (#4104)
This commit is contained in:
parent
81c6ffce40
commit
4d4a5cffd9
|
@ -131,7 +131,7 @@ const ChatsStackNavigator = () => {
|
|||
component={AddExistingChannelView}
|
||||
options={AddExistingChannelView.navigationOptions}
|
||||
/>
|
||||
<ChatsStack.Screen name='MarkdownTableView' component={MarkdownTableView} options={MarkdownTableView.navigationOptions} />
|
||||
<ChatsStack.Screen name='MarkdownTableView' component={MarkdownTableView} />
|
||||
<ChatsStack.Screen name='ReadReceiptsView' component={ReadReceiptsView} options={ReadReceiptsView.navigationOptions} />
|
||||
<ChatsStack.Screen name='QueueListView' component={QueueListView} options={QueueListView.navigationOptions} />
|
||||
<ChatsStack.Screen name='CannedResponsesListView' component={CannedResponsesListView} />
|
||||
|
|
|
@ -166,7 +166,7 @@ const ModalStackNavigator = React.memo(({ navigation }: INavigation) => {
|
|||
<ModalStack.Screen name='ThreadMessagesView' component={ThreadMessagesView} />
|
||||
<ModalStack.Screen name='DiscussionsView' component={DiscussionsView} />
|
||||
<ModalStack.Screen name='TeamChannelsView' component={TeamChannelsView} options={TeamChannelsView.navigationOptions} />
|
||||
<ModalStack.Screen name='MarkdownTableView' component={MarkdownTableView} options={MarkdownTableView.navigationOptions} />
|
||||
<ModalStack.Screen name='MarkdownTableView' component={MarkdownTableView} />
|
||||
<ModalStack.Screen
|
||||
name='ReadReceiptsView'
|
||||
component={ReadReceiptsView}
|
||||
|
|
|
@ -1,43 +1,38 @@
|
|||
import React from 'react';
|
||||
import React, { useEffect } from 'react';
|
||||
import { ScrollView } from 'react-native';
|
||||
import { StackNavigationOptions } from '@react-navigation/stack';
|
||||
import { RouteProp } from '@react-navigation/native';
|
||||
|
||||
import I18n from '../i18n';
|
||||
import { isIOS } from '../utils/deviceInfo';
|
||||
import { themes } from '../lib/constants';
|
||||
import { TSupportedThemes, withTheme } from '../theme';
|
||||
import { useTheme } from '../theme';
|
||||
import { ChatsStackParamList } from '../stacks/types';
|
||||
import { IBaseScreen } from '../definitions';
|
||||
|
||||
interface IMarkdownTableViewProps {
|
||||
route: RouteProp<ChatsStackParamList, 'MarkdownTableView'>;
|
||||
theme: TSupportedThemes;
|
||||
}
|
||||
type IMarkdownTableViewProps = IBaseScreen<ChatsStackParamList, 'MarkdownTableView'>;
|
||||
|
||||
class MarkdownTableView extends React.Component<IMarkdownTableViewProps> {
|
||||
static navigationOptions = (): StackNavigationOptions => ({
|
||||
title: I18n.t('Table')
|
||||
});
|
||||
|
||||
render() {
|
||||
const { route, theme } = this.props;
|
||||
const MarkdownTableView = ({ navigation, route }: IMarkdownTableViewProps): React.ReactElement => {
|
||||
const renderRows = route.params?.renderRows;
|
||||
const tableWidth = route.params?.tableWidth;
|
||||
const { colors } = useTheme();
|
||||
|
||||
useEffect(() => {
|
||||
navigation.setOptions({
|
||||
title: I18n.t('Table')
|
||||
});
|
||||
}, []);
|
||||
|
||||
if (isIOS) {
|
||||
return (
|
||||
<ScrollView style={{ backgroundColor: themes[theme].backgroundColor }} contentContainerStyle={{ width: tableWidth }}>
|
||||
<ScrollView style={{ backgroundColor: colors.backgroundColor }} contentContainerStyle={{ width: tableWidth }}>
|
||||
{renderRows()}
|
||||
</ScrollView>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<ScrollView style={{ backgroundColor: themes[theme].backgroundColor }}>
|
||||
<ScrollView style={{ backgroundColor: colors.backgroundColor }}>
|
||||
<ScrollView horizontal>{renderRows()}</ScrollView>
|
||||
</ScrollView>
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default withTheme(MarkdownTableView);
|
||||
export default MarkdownTableView;
|
||||
|
|
Loading…
Reference in New Issue