diff --git a/app/containers/markdown/Table.tsx b/app/containers/markdown/Table.tsx
index 7123d80d9..d45de1683 100644
--- a/app/containers/markdown/Table.tsx
+++ b/app/containers/markdown/Table.tsx
@@ -2,11 +2,12 @@ import React from 'react';
import { ScrollView, Text, TouchableOpacity, View, ViewStyle } from 'react-native';
import { CELL_WIDTH } from './TableCell';
-import styles from './styles';
import Navigation from '../../lib/navigation/appNavigation';
+import styles from './styles';
import I18n from '../../i18n';
import { TSupportedThemes } from '../../theme';
import { themes } from '../../lib/constants';
+import { useAppSelector } from '../../lib/hooks';
interface ITable {
children: React.ReactElement | null;
@@ -18,6 +19,7 @@ const MAX_HEIGHT = 300;
const Table = React.memo(({ children, numColumns, theme }: ITable) => {
const getTableWidth = () => numColumns * CELL_WIDTH;
+ const isMasterDetail = useAppSelector(state => state.app.isMasterDetail);
const renderRows = (drawExtraBorders = true) => {
const tableStyle: ViewStyle[] = [styles.table, { borderColor: themes[theme].borderColor }];
@@ -33,7 +35,16 @@ const Table = React.memo(({ children, numColumns, theme }: ITable) => {
return {rows};
};
- const onPress = () => Navigation.navigate('MarkdownTableView', { renderRows, tableWidth: getTableWidth() });
+ const onPress = () => {
+ if (isMasterDetail) {
+ Navigation.navigate('ModalStackNavigator', {
+ screen: 'MarkdownTableView',
+ params: { renderRows, tableWidth: getTableWidth() }
+ });
+ } else {
+ Navigation.navigate('MarkdownTableView', { renderRows, tableWidth: getTableWidth() });
+ }
+ };
return (
diff --git a/storybook/stories/Markdown.tsx b/storybook/stories/Markdown.tsx
index e4902cddb..f6cb6c30f 100644
--- a/storybook/stories/Markdown.tsx
+++ b/storybook/stories/Markdown.tsx
@@ -1,10 +1,12 @@
import React from 'react';
import { ScrollView, StyleSheet, View } from 'react-native';
import { storiesOf } from '@storybook/react-native';
+import { Provider } from 'react-redux';
import Markdown, { MarkdownPreview } from '../../app/containers/markdown';
import { themes } from '../../app/lib/constants';
import { TGetCustomEmoji, IEmoji } from '../../app/definitions/IEmoji';
+import { store } from '.';
const theme = 'light';
@@ -42,7 +44,7 @@ const getCustomEmoji: TGetCustomEmoji = content => {
return customEmoji;
};
-const stories = storiesOf('Markdown', module);
+const stories = storiesOf('Markdown', module).addDecorator(story => {story()});
stories.add('Text', () => (
diff --git a/storybook/stories/index.js b/storybook/stories/index.js
index 55a1468e6..0c3a1a0e9 100644
--- a/storybook/stories/index.js
+++ b/storybook/stories/index.js
@@ -42,6 +42,7 @@ const reducers = combineReducers({
settings: {}
}),
meteor: () => ({ connected: true }),
- activeUsers: () => ({ abc: { status: 'online', statusText: 'dog' } })
+ activeUsers: () => ({ abc: { status: 'online', statusText: 'dog' } }),
+ app: () => ({ isMasterDetail: false })
});
export const store = createStore(reducers);