From b697d6522dd8c7f32f8f13538a60ceff83ac7f15 Mon Sep 17 00:00:00 2001 From: noumantahir Date: Mon, 3 Jan 2022 22:23:56 +0500 Subject: [PATCH] support for entities using updated render-helper --- src/components/comments/container/commentsContainer.js | 3 ++- src/screens/drafts/screen/draftsScreen.js | 4 ++-- src/utils/postParser.tsx | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/comments/container/commentsContainer.js b/src/components/comments/container/commentsContainer.js index 55aeaa468..1b1ac123f 100644 --- a/src/components/comments/container/commentsContainer.js +++ b/src/components/comments/container/commentsContainer.js @@ -1,4 +1,5 @@ import React, { useState, useEffect, useCallback } from 'react'; +import { Platform } from 'react-native'; import { withNavigation } from 'react-navigation'; import { connect } from 'react-redux'; import { injectIntl } from 'react-intl'; @@ -229,7 +230,7 @@ const CommentsContainer = ({ writeToClipboard(`https://ecency.com${get(selectedComment, 'url')}`).then(_showCopiedToast); } if (index === 1) { - const body = postBodySummary(selectedComment.markdownBody); + const body = postBodySummary(selectedComment.markdownBody, null, Platform.OS); writeToClipboard(body).then(_showCopiedToast); } else if (index === 2) { _openReplyThread(selectedComment); diff --git a/src/screens/drafts/screen/draftsScreen.js b/src/screens/drafts/screen/draftsScreen.js index 1b11284a9..afb6dcc45 100644 --- a/src/screens/drafts/screen/draftsScreen.js +++ b/src/screens/drafts/screen/draftsScreen.js @@ -1,6 +1,6 @@ import React, { useState, useRef } from 'react'; import { injectIntl } from 'react-intl'; -import { View, FlatList, Text } from 'react-native'; +import { View, FlatList, Text, Platform } from 'react-native'; import ScrollableTabView from 'react-native-scrollable-tab-view'; // Utils @@ -49,7 +49,7 @@ const DraftsScreen = ({ item.meta && item.meta.image ? catchImageFromMetadata(item.meta, 'match', true) : catchDraftImage(item.body, 'match', true); - const summary = postBodySummary({ ...item, last_update: item.modified }, 100); + const summary = postBodySummary({ ...item, last_update: item.modified }, 100, Platform.OS); const isSchedules = type === 'schedules'; const _onItemPress = () => { diff --git a/src/utils/postParser.tsx b/src/utils/postParser.tsx index e934d121d..a63b34d39 100644 --- a/src/utils/postParser.tsx +++ b/src/utils/postParser.tsx @@ -52,7 +52,7 @@ export const parsePost = (post, currentUserName, isPromoted, isList = false) => if (!isList) { post.body = renderPostBody(post, true, webp); } - post.summary = postBodySummary(post, 150); + post.summary = postBodySummary(post, 150, Platform.OS); post.max_payout = parseAsset(post.max_accepted_payout).amount || 0; post.is_declined_payout = post.max_payout === 0;