From 3551658ff7d5d7703288c9e14b85eb655f941497 Mon Sep 17 00:00:00 2001 From: Eric Han Date: Tue, 27 Jun 2023 23:15:09 +0800 Subject: [PATCH 1/4] fix clicking title of url preview don't open site --- src/pages/home/report/LinkPreviewer.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pages/home/report/LinkPreviewer.js b/src/pages/home/report/LinkPreviewer.js index 1da48efe91d1..dfa1d1ba1d99 100644 --- a/src/pages/home/report/LinkPreviewer.js +++ b/src/pages/home/report/LinkPreviewer.js @@ -5,6 +5,7 @@ import _ from 'underscore'; import {uniqBy} from 'lodash'; import useWindowDimensions from '../../../hooks/useWindowDimensions'; import Text from '../../../components/Text'; +import TextLink from '../../../components/TextLink'; import styles from '../../../styles/styles'; import variables from '../../../styles/variables'; import colors from '../../../styles/colors'; @@ -103,13 +104,14 @@ function LinkPreviewer(props) { )} {!_.isEmpty(title) && ( - {title} - + )} {!_.isEmpty(description) && {description}} {!_.isEmpty(image) && IMAGE_TYPES.includes(image.type) && ( From 43597b87e2ec7c2690ad5f6693360cfaee6a2a99 Mon Sep 17 00:00:00 2001 From: Eric Han Date: Thu, 29 Jun 2023 00:00:58 +0800 Subject: [PATCH 2/4] add color in style --- src/pages/home/report/LinkPreviewer.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/home/report/LinkPreviewer.js b/src/pages/home/report/LinkPreviewer.js index dfa1d1ba1d99..0ad3535abdca 100644 --- a/src/pages/home/report/LinkPreviewer.js +++ b/src/pages/home/report/LinkPreviewer.js @@ -106,8 +106,7 @@ function LinkPreviewer(props) { {!_.isEmpty(title) && ( {title} From de3fe35947ec76ed897b92e6283f9521124e053f Mon Sep 17 00:00:00 2001 From: Eric Han Date: Thu, 29 Jun 2023 16:52:27 +0800 Subject: [PATCH 3/4] add function getTextColorStyle --- src/pages/home/report/LinkPreviewer.js | 3 ++- src/styles/StyleUtils.js | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/pages/home/report/LinkPreviewer.js b/src/pages/home/report/LinkPreviewer.js index 0ad3535abdca..ca5614fe2208 100644 --- a/src/pages/home/report/LinkPreviewer.js +++ b/src/pages/home/report/LinkPreviewer.js @@ -6,6 +6,7 @@ import {uniqBy} from 'lodash'; import useWindowDimensions from '../../../hooks/useWindowDimensions'; import Text from '../../../components/Text'; import TextLink from '../../../components/TextLink'; +import * as StyleUtils from '../../../styles/StyleUtils'; import styles from '../../../styles/styles'; import variables from '../../../styles/variables'; import colors from '../../../styles/colors'; @@ -106,7 +107,7 @@ function LinkPreviewer(props) { {!_.isEmpty(title) && ( {title} diff --git a/src/styles/StyleUtils.js b/src/styles/StyleUtils.js index b7cbdaa20ee2..66b10ef54219 100644 --- a/src/styles/StyleUtils.js +++ b/src/styles/StyleUtils.js @@ -355,6 +355,18 @@ function getBackgroundColorStyle(backgroundColor) { }; } +/** + * Returns a style for text color + * + * @param {String} linkPreviewColor + * @returns {Object} + */ +function getTextColorStyle(textColor) { + return { + color: textColor, + }; +} + /** * Returns a style with the specified borderColor * @@ -1230,6 +1242,7 @@ export { getAutoGrowHeightInputStyle, getBackgroundAndBorderStyle, getBackgroundColorStyle, + getTextColorStyle, getBorderColorStyle, getBackgroundColorWithOpacityStyle, getBadgeColorStyle, From 0a39078c39dc2b63ea36176bb061a7683d3d60f9 Mon Sep 17 00:00:00 2001 From: Eric Han Date: Thu, 29 Jun 2023 16:57:03 +0800 Subject: [PATCH 4/4] fix lint --- src/styles/StyleUtils.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/styles/StyleUtils.js b/src/styles/StyleUtils.js index 66b10ef54219..e38ef7bc0c3c 100644 --- a/src/styles/StyleUtils.js +++ b/src/styles/StyleUtils.js @@ -358,12 +358,12 @@ function getBackgroundColorStyle(backgroundColor) { /** * Returns a style for text color * - * @param {String} linkPreviewColor + * @param {String} color * @returns {Object} */ -function getTextColorStyle(textColor) { +function getTextColorStyle(color) { return { - color: textColor, + color, }; }