From a722086b9206d177ac624c410b3618ef5f2012fe Mon Sep 17 00:00:00 2001 From: u-e Date: Thu, 27 Dec 2018 10:44:19 +0300 Subject: [PATCH 1/9] handled wordpress image --- src/utils/markdownToHtml.js | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/src/utils/markdownToHtml.js b/src/utils/markdownToHtml.js index 63674d3bd..0ddc7a48b 100644 --- a/src/utils/markdownToHtml.js +++ b/src/utils/markdownToHtml.js @@ -13,12 +13,13 @@ const dTubeRegex = /(https?:\/\/d.tube.#!\/v\/)(\w+)\/(\w+)/g; const authorNameRegex = /(^|[^a-zA-Z0-9_!#$%&*@@\/]|(^|[^a-zA-Z0-9_+~.-\/]))[@@]([a-z][-\.a-z\d]+[a-z\d])/gi; const tagsRegex = /(^|\s|>)(#[-a-z\d]+)/gi; const centerRegex = /(
)/g; -const imgRegex = /(https?:\/\/.*\.(?:tiff?|jpe?g|gif|png|svg|ico))(.*)/gim; +const imgRegex = /(https?:\/\/.*\.(?:tiff?|jpe?g|gif|png|svg|ico|PNG|GIF|JPG))/g; const pullRightLeftRegex = /(
(.*?)(<[/]div>))/g; const linkRegex = /[-a-zA-Z0-9@:%_\+.~#?&//=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?/gi; const markdownImageRegex = /!\[[^\]]*\]\((.*?)\s*("(?:.*[^"])")?\s*\)/g; const urlRegex = /(http|ftp|https):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?/gm; const aTagRegex = /(<\s*a[^>]*>(.*?)<\s*[/]\s*a>)/g; +const imgTagRegex = /()/g; export const markDown2Html = (input) => { if (!input) { @@ -54,6 +55,11 @@ export const markDown2Html = (input) => { // output = handleImage(output); // } + if (imgTagRegex.test(output)) { + output = handleImageTag(output); + } + + //imgTagRegex if (vimeoRegex.test(output)) { output = createVimeoIframe(output); } @@ -131,7 +137,7 @@ const changeMarkdownImage = input => input.replace(markdownImageRegex, (link) => const firstMarkdownMatch = markdownMatch[0]; const _link = firstMarkdownMatch.match(urlRegex)[0]; - return ``; + return imageBody(_link); } return link; }); @@ -163,17 +169,25 @@ const steemitUrlHandle = input => input.replace(postRegex, (link) => { const createImage = input => input.replace( onlyImageLinkRegex, - link => ``, + link => imageBody(link), ); -const handleImage = input => input.replace( - imgRegex, - link => ``, -); +const handleImageTag = input => input.replace(imgTagRegex, (imgTag) => { + const _imgTag = imgTag.trim(); + const match = _imgTag.match(imgRegex); + + if (match && match[0]) { + + return imageBody(match[0]); + } + + return imgTag; +}); const createFromDoubleImageLink = input => input.replace(onlyImageDoubleLinkRegex, (link) => { const _link = link.trim(); - return ``; + + return imageBody(_link); }); const createYoutubeIframe = input => input.replace(youTubeRegex, (link) => { @@ -214,4 +228,4 @@ const createVimeoIframe = input => input.replace(vimeoRegex, (link) => { }); const iframeBody = link => ``; -const imageBody = link => ``; +const imageBody = link => ``; From 3e34774e97ec2a7a101b430f53797b0b4f03b5b8 Mon Sep 17 00:00:00 2001 From: u-e Date: Thu, 27 Dec 2018 18:34:15 +0300 Subject: [PATCH 2/9] fixed mardkown couple bugs --- .../postCard/container/postCardContainer.js | 4 +- src/components/postCard/view/postCardView.js | 2 - src/screens/profile/screen/profileScreen.js | 4 +- src/utils/markdownToHtml.js | 50 +++++++++++-------- 4 files changed, 34 insertions(+), 26 deletions(-) diff --git a/src/components/postCard/container/postCardContainer.js b/src/components/postCard/container/postCardContainer.js index 4d02abdb4..cb30d2a9a 100644 --- a/src/components/postCard/container/postCardContainer.js +++ b/src/components/postCard/container/postCardContainer.js @@ -50,7 +50,9 @@ class PostCardContainer extends PureComponent { navigation.navigate({ routeName: ROUTES.SCREENS.POST, params: { - content, + //content, + permlink: content.permlink, + author: content.author, }, key: content.permlink, }); diff --git a/src/components/postCard/view/postCardView.js b/src/components/postCard/view/postCardView.js index f0d51373e..0a1042e24 100644 --- a/src/components/postCard/view/postCardView.js +++ b/src/components/postCard/view/postCardView.js @@ -63,8 +63,6 @@ class PostCard extends Component { ? { uri: content.image, priority: FastImage.priority.high } : DEFAULT_IMAGE; const reblogedBy = content.reblogged_by && content.reblogged_by[0]; - // repeat icon - // text rebloged by ${reblogedBy} return ( diff --git a/src/screens/profile/screen/profileScreen.js b/src/screens/profile/screen/profileScreen.js index 048aaa1b7..37ffbe35a 100644 --- a/src/screens/profile/screen/profileScreen.js +++ b/src/screens/profile/screen/profileScreen.js @@ -36,7 +36,9 @@ class ProfileScreen extends PureComponent { }; _handleOnSummaryExpanded = () => { - this.setState({ isSummaryOpen: true }); + const { isSummaryOpen } = this.state; + + if (!isSummaryOpen) this.setState({ isSummaryOpen: true }); }; _handleUIChange = (height) => { diff --git a/src/utils/markdownToHtml.js b/src/utils/markdownToHtml.js index 0ddc7a48b..a508fd0a7 100644 --- a/src/utils/markdownToHtml.js +++ b/src/utils/markdownToHtml.js @@ -1,7 +1,7 @@ import Remarkable from 'remarkable'; - +// TODO: Refactoring need! const md = new Remarkable({ html: true, breaks: true, linkify: true }); -const isVideo = false; + const imgCenterRegex = /([
]http(s?):)([/|.|\w|\s|-])*\.(?:jpg|gif|png|PNG|GIF|JPG)[
]/g; const onlyImageLinkRegex = /([\n]http(s?):)([/|.|\w|\s|-])*\.(?:jpg|gif|png|PNG|GIF|JPG)/g; const onlyImageDoubleLinkRegex = /(\nhttps)(.*)(?=jpg|gif|png|PNG|GIF|JPG|)/g; @@ -39,10 +39,6 @@ export const markDown2Html = (input) => { output = createYoutubeIframe(output); } - // if (dTubeRegex.test(output)) { - // output = createDtubeIframe(output); - // } - if (aTagRegex.test(output)) { output = handleATag(output); } @@ -51,15 +47,10 @@ export const markDown2Html = (input) => { output = changePullRightLeft(output); } - // if (imgRegex.test(output)) { - // output = handleImage(output); - // } - if (imgTagRegex.test(output)) { output = handleImageTag(output); } - //imgTagRegex if (vimeoRegex.test(output)) { output = createVimeoIframe(output); } @@ -84,13 +75,18 @@ export const markDown2Html = (input) => { output = steemitUrlHandle(output); } + if (linkRegex.test(output)) { + output = handleLinks(output); + } + + if (markdownImageRegex.test(output)) { output = changeMarkdownImage(output); } - // if (onlyImageDoubleLinkRegex.test(output)) { - // output = createFromDoubleImageLink(output); - // } + if (onlyImageDoubleLinkRegex.test(output)) { + output = createFromDoubleImageLink(output); + } output = md.render(output); @@ -131,6 +127,20 @@ const handleATag = input => input.replace(aTagRegex, (link) => { return link; }); +const handleLinks = input => input.replace(linkRegex, (link) => { + if (link) { + if (link.toLowerCase().trim().indexOf('https://steemitimages.com/0x0/') === 0) { + const imageMatch = link.match(imgRegex); + + if (imageMatch && imageMatch[0]) { + return imageBody(imageMatch[0]); + } + } + } + + return link; +}); + const changeMarkdownImage = input => input.replace(markdownImageRegex, (link) => { const markdownMatch = link.match(markdownImageRegex); if (markdownMatch[0]) { @@ -149,13 +159,13 @@ const createCenterImage = input => input.replace(imgCenterRegex, (link) => { _link = _link.split('>')[1]; _link = _link.split('<')[0]; - return `><`; + return `><`; }); const changePullRightLeft = input => input.replace(pullRightLeftRegex, (item) => { const imageLink = item.match(linkRegex)[0]; - return `

`; + return `

`; }); const steemitUrlHandle = input => input.replace(postRegex, (link) => { @@ -167,17 +177,13 @@ const steemitUrlHandle = input => input.replace(postRegex, (link) => { return `/${permlink}`; }); -const createImage = input => input.replace( - onlyImageLinkRegex, - link => imageBody(link), -); +const createImage = input => input.replace(onlyImageLinkRegex, link => imageBody(link)); const handleImageTag = input => input.replace(imgTagRegex, (imgTag) => { const _imgTag = imgTag.trim(); const match = _imgTag.match(imgRegex); if (match && match[0]) { - return imageBody(match[0]); } @@ -228,4 +234,4 @@ const createVimeoIframe = input => input.replace(vimeoRegex, (link) => { }); const iframeBody = link => ``; -const imageBody = link => ``; +const imageBody = link => ``; From 89af2930ba42b8a034e683204475706f0b1fb6b2 Mon Sep 17 00:00:00 2001 From: u-e Date: Thu, 27 Dec 2018 18:35:03 +0300 Subject: [PATCH 3/9] missing line changed --- src/components/postCard/container/postCardContainer.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/postCard/container/postCardContainer.js b/src/components/postCard/container/postCardContainer.js index cb30d2a9a..4d02abdb4 100644 --- a/src/components/postCard/container/postCardContainer.js +++ b/src/components/postCard/container/postCardContainer.js @@ -50,9 +50,7 @@ class PostCardContainer extends PureComponent { navigation.navigate({ routeName: ROUTES.SCREENS.POST, params: { - //content, - permlink: content.permlink, - author: content.author, + content, }, key: content.permlink, }); From 9ed6a21a87465b4486a04abd2c65644d6147acb5 Mon Sep 17 00:00:00 2001 From: u-e Date: Thu, 27 Dec 2018 21:55:31 +0300 Subject: [PATCH 4/9] fixed collapsible bug --- src/components/collapsibleCard/view/collapsibleCardView.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/collapsibleCard/view/collapsibleCardView.js b/src/components/collapsibleCard/view/collapsibleCardView.js index d36ead464..4c1598fc3 100644 --- a/src/components/collapsibleCard/view/collapsibleCardView.js +++ b/src/components/collapsibleCard/view/collapsibleCardView.js @@ -35,8 +35,13 @@ class CollapsibleCardView extends PureComponent { componentWillReceiveProps(nextProps) { const { isExpanded, moreHeight } = this.props; + const { expanded } = this.state; - if (!nextProps.isExpanded && isExpanded !== nextProps.isExpanded) { + if ( + !nextProps.isExpanded + && isExpanded !== nextProps.isExpanded + && expanded !== nextProps.isExpanded + ) { this._toggleOnPress(); } From 0e75b58b01d552f05bb6f659819f5cfc10a14e67 Mon Sep 17 00:00:00 2001 From: u-e Date: Fri, 28 Dec 2018 10:22:42 +0300 Subject: [PATCH 5/9] fixed bugfix #306 --- src/components/upvote/container/upvoteContainer.js | 6 +++--- src/components/upvote/view/upvoteView.js | 6 +++--- src/utils/postParser.js | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/components/upvote/container/upvoteContainer.js b/src/components/upvote/container/upvoteContainer.js index 3951e8c60..51865dc67 100644 --- a/src/components/upvote/container/upvoteContainer.js +++ b/src/components/upvote/container/upvoteContainer.js @@ -47,13 +47,13 @@ class UpvoteContainer extends PureComponent { } = this.props; let author; let isVoted; - let pendingPayoutValue; let permlink; + let totalPayout; if (content) { ({ author } = content); isVoted = content.is_voted; - pendingPayoutValue = content.pending_payout_value; + totalPayout = content.total_payout; ({ permlink } = content); } @@ -66,7 +66,7 @@ class UpvoteContainer extends PureComponent { isLoggedIn={isLoggedIn} isShowPayoutValue={isShowPayoutValue} isVoted={isVoted} - pendingPayoutValue={pendingPayoutValue} + totalPayout={totalPayout} permlink={permlink} upvotePercent={upvotePercent} pinCode={pinCode} diff --git a/src/components/upvote/view/upvoteView.js b/src/components/upvote/view/upvoteView.js index bede95000..2bd9a3c3a 100644 --- a/src/components/upvote/view/upvoteView.js +++ b/src/components/upvote/view/upvoteView.js @@ -120,7 +120,7 @@ class UpvoteView extends Component { }; render() { - const { isLoggedIn, isShowPayoutValue, pendingPayoutValue } = this.props; + const { isLoggedIn, isShowPayoutValue, totalPayout } = this.props; const { isVoting, amount, sliderValue, isVoted, } = this.state; @@ -167,8 +167,8 @@ class UpvoteView extends Component { name={iconName} /> )} - {isShowPayoutValue && pendingPayoutValue && ( - {`$${pendingPayoutValue}`} + {isShowPayoutValue && totalPayout && ( + {`$${totalPayout}`} )} diff --git a/src/utils/postParser.js b/src/utils/postParser.js index b84320456..d04881127 100644 --- a/src/utils/postParser.js +++ b/src/utils/postParser.js @@ -14,7 +14,6 @@ export const parsePost = (post, currentUserName, isSummary = false) => { _post.json_metadata = JSON.parse(post.json_metadata); _post.image = postImage(post.json_metadata, post.body); - _post.pending_payout_value = parseFloat(post.pending_payout_value).toFixed(3); _post.created = getTimeFromNow(post.created); _post.vote_count = post.active_votes.length; _post.author_reputation = getReputation(post.author_reputation); @@ -34,6 +33,8 @@ export const parsePost = (post, currentUserName, isSummary = false) => { + parseFloat(_post.total_payout_value) + parseFloat(_post.curator_payout_value); + _post.total_payout = totalPayout.toFixed(3); + const voteRshares = _post.active_votes.reduce((a, b) => a + parseFloat(b.rshares), 0); const ratio = totalPayout / voteRshares; From b99c53e5d7fd067b67892a6620190bb0c044529d Mon Sep 17 00:00:00 2001 From: u-e Date: Fri, 28 Dec 2018 11:55:53 +0300 Subject: [PATCH 6/9] updated regexs --- .../postCard/container/postCardContainer.js | 4 +- src/utils/markdownToHtml.js | 37 +++++++------------ 2 files changed, 16 insertions(+), 25 deletions(-) diff --git a/src/components/postCard/container/postCardContainer.js b/src/components/postCard/container/postCardContainer.js index 4d02abdb4..f72689168 100644 --- a/src/components/postCard/container/postCardContainer.js +++ b/src/components/postCard/container/postCardContainer.js @@ -50,7 +50,9 @@ class PostCardContainer extends PureComponent { navigation.navigate({ routeName: ROUTES.SCREENS.POST, params: { - content, + // content, + permlink: content.permlink, + author: content.author, }, key: content.permlink, }); diff --git a/src/utils/markdownToHtml.js b/src/utils/markdownToHtml.js index a508fd0a7..f1b57096d 100644 --- a/src/utils/markdownToHtml.js +++ b/src/utils/markdownToHtml.js @@ -19,7 +19,7 @@ const linkRegex = /[-a-zA-Z0-9@:%_\+.~#?&//=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9 const markdownImageRegex = /!\[[^\]]*\]\((.*?)\s*("(?:.*[^"])")?\s*\)/g; const urlRegex = /(http|ftp|https):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?/gm; const aTagRegex = /(<\s*a[^>]*>(.*?)<\s*[/]\s*a>)/g; -const imgTagRegex = /()/g; +const imgTagRegex = /(]*>)/g; export const markDown2Html = (input) => { if (!input) { @@ -43,10 +43,6 @@ export const markDown2Html = (input) => { output = handleATag(output); } - if (pullRightLeftRegex.test(output)) { - output = changePullRightLeft(output); - } - if (imgTagRegex.test(output)) { output = handleImageTag(output); } @@ -59,14 +55,6 @@ export const markDown2Html = (input) => { output = createVimeoIframe(output); } - if (imgCenterRegex.test(output)) { - output = createCenterImage(output); - } - - if (onlyImageLinkRegex.test(output)) { - output = createImage(output); - } - if (centerRegex.test(output)) { output = centerStyling(output); } @@ -75,17 +63,12 @@ export const markDown2Html = (input) => { output = steemitUrlHandle(output); } - if (linkRegex.test(output)) { - output = handleLinks(output); - } - - if (markdownImageRegex.test(output)) { output = changeMarkdownImage(output); } - if (onlyImageDoubleLinkRegex.test(output)) { - output = createFromDoubleImageLink(output); + if (linkRegex.test(output)) { + output = handleLinks(output); } output = md.render(output); @@ -129,7 +112,13 @@ const handleATag = input => input.replace(aTagRegex, (link) => { const handleLinks = input => input.replace(linkRegex, (link) => { if (link) { - if (link.toLowerCase().trim().indexOf('https://steemitimages.com/0x0/') === 0) { + if ( + link + .toLowerCase() + .trim() + .indexOf('https://steemitimages.com/0x0/') === 0 + || imgRegex.test(link) + ) { const imageMatch = link.match(imgRegex); if (imageMatch && imageMatch[0]) { @@ -147,7 +136,7 @@ const changeMarkdownImage = input => input.replace(markdownImageRegex, (link) => const firstMarkdownMatch = markdownMatch[0]; const _link = firstMarkdownMatch.match(urlRegex)[0]; - return imageBody(_link); + return _link; } return link; }); @@ -184,7 +173,7 @@ const handleImageTag = input => input.replace(imgTagRegex, (imgTag) => { const match = _imgTag.match(imgRegex); if (match && match[0]) { - return imageBody(match[0]); + return match[0]; } return imgTag; @@ -234,4 +223,4 @@ const createVimeoIframe = input => input.replace(vimeoRegex, (link) => { }); const iframeBody = link => ``; -const imageBody = link => ``; +const imageBody = link => ``; From 5d8847951f059dfee4520453acd9a792df49cee6 Mon Sep 17 00:00:00 2001 From: u-e Date: Fri, 28 Dec 2018 13:33:27 +0300 Subject: [PATCH 7/9] fixed #3077 --- src/utils/markdownToHtml.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/utils/markdownToHtml.js b/src/utils/markdownToHtml.js index f1b57096d..75b81a125 100644 --- a/src/utils/markdownToHtml.js +++ b/src/utils/markdownToHtml.js @@ -20,6 +20,7 @@ const markdownImageRegex = /!\[[^\]]*\]\((.*?)\s*("(?:.*[^"])")?\s*\)/g; const urlRegex = /(http|ftp|https):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?/gm; const aTagRegex = /(<\s*a[^>]*>(.*?)<\s*[/]\s*a>)/g; const imgTagRegex = /(]*>)/g; +const iframeRegex = /(?:]*)(?:(?:\/>)|(?:>.*?<\/iframe>))/g; export const markDown2Html = (input) => { if (!input) { @@ -67,6 +68,10 @@ export const markDown2Html = (input) => { output = changeMarkdownImage(output); } + if (iframeRegex.test(output)) { + output = handleIframe(output); + } + if (linkRegex.test(output)) { output = handleLinks(output); } @@ -199,6 +204,17 @@ const createYoutubeIframe = input => input.replace(youTubeRegex, (link) => { return link; }); +const handleIframe = input => input.replace(iframeRegex, (link) => { + const match = link.match(linkRegex); + + if (match && match[0]) { + + return iframeBody(match[0]); + } + + return link; +}); + const createDtubeIframe = input => input.replace(dTubeRegex, (link) => { const execLink = dTubeRegex.exec(link); const dTubeMatch = link.match(dTubeRegex)[0]; From 48cca73a6f19c0aa7b4caf3443530661b1e45891 Mon Sep 17 00:00:00 2001 From: u-e Date: Fri, 28 Dec 2018 14:11:27 +0300 Subject: [PATCH 8/9] hanled a tag for img source --- .../postCard/container/postCardContainer.js | 4 +--- src/utils/markdownToHtml.js | 15 ++++++++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/components/postCard/container/postCardContainer.js b/src/components/postCard/container/postCardContainer.js index f72689168..4d02abdb4 100644 --- a/src/components/postCard/container/postCardContainer.js +++ b/src/components/postCard/container/postCardContainer.js @@ -50,9 +50,7 @@ class PostCardContainer extends PureComponent { navigation.navigate({ routeName: ROUTES.SCREENS.POST, params: { - // content, - permlink: content.permlink, - author: content.author, + content, }, key: content.permlink, }); diff --git a/src/utils/markdownToHtml.js b/src/utils/markdownToHtml.js index 75b81a125..41651c050 100644 --- a/src/utils/markdownToHtml.js +++ b/src/utils/markdownToHtml.js @@ -40,10 +40,6 @@ export const markDown2Html = (input) => { output = createYoutubeIframe(output); } - if (aTagRegex.test(output)) { - output = handleATag(output); - } - if (imgTagRegex.test(output)) { output = handleImageTag(output); } @@ -76,6 +72,10 @@ export const markDown2Html = (input) => { output = handleLinks(output); } + if (aTagRegex.test(output)) { + output = handleATag(output); + } + output = md.render(output); return output; @@ -112,6 +112,12 @@ const handleATag = input => input.replace(aTagRegex, (link) => { return link; } + if (imgRegex.test(link)) { + const imgMatch = link.match(imgRegex)[0]; + + if (imgMatch) return `Image`; + } + return link; }); @@ -208,7 +214,6 @@ const handleIframe = input => input.replace(iframeRegex, (link) => { const match = link.match(linkRegex); if (match && match[0]) { - return iframeBody(match[0]); } From 94e9ec1c2d9bc7cd78f9d382122133c037f22e66 Mon Sep 17 00:00:00 2001 From: u-e Date: Fri, 28 Dec 2018 15:20:08 +0300 Subject: [PATCH 9/9] fixed initl issue for android --- src/components/postCard/view/postCardView.js | 7 ++----- src/components/postElements/body/view/postBodyStyles.js | 3 +++ src/utils/formatter.js | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/postCard/view/postCardView.js b/src/components/postCard/view/postCardView.js index 0a1042e24..b51a11041 100644 --- a/src/components/postCard/view/postCardView.js +++ b/src/components/postCard/view/postCardView.js @@ -5,9 +5,6 @@ import { PostHeaderDescription } from '../../postElements'; import { PostDropdown } from '../../postDropdown'; import { Icon } from '../../icon'; -// Utils -import { makeCountFriendly } from '../../../utils/formatter'; - // STEEM import { Upvote } from '../../upvote'; // Styles @@ -108,12 +105,12 @@ class PostCard extends Component { iconType="MaterialIcons" name="people" /> - {makeCountFriendly(content.vote_count)} + {content.vote_count}
- {makeCountFriendly(content.children)} + {content.children} diff --git a/src/components/postElements/body/view/postBodyStyles.js b/src/components/postElements/body/view/postBodyStyles.js index 28d27fd4c..2f3677412 100644 --- a/src/components/postElements/body/view/postBodyStyles.js +++ b/src/components/postElements/body/view/postBodyStyles.js @@ -18,6 +18,9 @@ export default EStyleSheet.create({ left: -16, // height: 50, }, + ul: { + color: 'red', + }, commentContainer: { paddingHorizontal: 0, marginTop: 20, diff --git a/src/utils/formatter.js b/src/utils/formatter.js index 3b1c01835..67d3bce5d 100644 --- a/src/utils/formatter.js +++ b/src/utils/formatter.js @@ -25,4 +25,4 @@ export const makeCountFriendly = (value) => { return intlFormat(value); }; -const intlFormat = num => new Intl.NumberFormat().format(Math.round(num * 10) / 10); +const intlFormat = num => Math.round(num * 10) / 10;