From 4d4a5cffd9307d4329c8a79e4d86c4d7ea7eca56 Mon Sep 17 00:00:00 2001 From: Gerzon Z Date: Fri, 13 May 2022 08:57:19 -0400 Subject: [PATCH] Chore: evaluate `MarkdownTableView` (#4104) --- app/stacks/InsideStack.tsx | 2 +- app/stacks/MasterDetailStack/index.tsx | 2 +- app/views/MarkdownTableView.tsx | 53 ++++++++++++-------------- 3 files changed, 26 insertions(+), 31 deletions(-) diff --git a/app/stacks/InsideStack.tsx b/app/stacks/InsideStack.tsx index 756fd5f2b..f2f8c8d4f 100644 --- a/app/stacks/InsideStack.tsx +++ b/app/stacks/InsideStack.tsx @@ -131,7 +131,7 @@ const ChatsStackNavigator = () => { component={AddExistingChannelView} options={AddExistingChannelView.navigationOptions} /> - + diff --git a/app/stacks/MasterDetailStack/index.tsx b/app/stacks/MasterDetailStack/index.tsx index 3b85d9e39..99f3914f4 100644 --- a/app/stacks/MasterDetailStack/index.tsx +++ b/app/stacks/MasterDetailStack/index.tsx @@ -166,7 +166,7 @@ const ModalStackNavigator = React.memo(({ navigation }: INavigation) => { - + ; - theme: TSupportedThemes; -} +type IMarkdownTableViewProps = IBaseScreen; -class MarkdownTableView extends React.Component { - static navigationOptions = (): StackNavigationOptions => ({ - title: I18n.t('Table') - }); +const MarkdownTableView = ({ navigation, route }: IMarkdownTableViewProps): React.ReactElement => { + const renderRows = route.params?.renderRows; + const tableWidth = route.params?.tableWidth; + const { colors } = useTheme(); - render() { - const { route, theme } = this.props; - const renderRows = route.params?.renderRows; - const tableWidth = route.params?.tableWidth; - - if (isIOS) { - return ( - - {renderRows()} - - ); - } + useEffect(() => { + navigation.setOptions({ + title: I18n.t('Table') + }); + }, []); + if (isIOS) { return ( - - {renderRows()} + + {renderRows()} ); } -} -export default withTheme(MarkdownTableView); + return ( + + {renderRows()} + + ); +}; + +export default MarkdownTableView;