From e097e7863980652c5ca359a095902d9031cbe22b Mon Sep 17 00:00:00 2001 From: tienifr Date: Thu, 8 Jun 2023 17:59:50 +0700 Subject: [PATCH 1/2] fix tooltip --- .../HTMLRenderers/MentionUserRenderer.js | 14 ++++++++------ src/components/TextLink.js | 3 +++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js b/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js index 81f723e66aef..17285249c856 100644 --- a/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js +++ b/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js @@ -9,6 +9,7 @@ import htmlRendererPropTypes from './htmlRendererPropTypes'; import withCurrentUserPersonalDetails from '../../withCurrentUserPersonalDetails'; import personalDetailsPropType from '../../../pages/personalDetailsPropType'; import * as StyleUtils from '../../../styles/StyleUtils'; +import TextLink from "../../TextLink"; const propTypes = { ...htmlRendererPropTypes, @@ -30,22 +31,23 @@ const MentionUserRenderer = (props) => { const defaultRendererProps = _.omit(props, ['TDefaultRenderer', 'style']); // We need to remove the leading @ from data as it is not part of the login - const loginWhithoutLeadingAt = props.tnode.data.slice(1); + const loginWithoutLeadingAt = props.tnode.data.slice(1); - const isOurMention = loginWhithoutLeadingAt === props.currentUserPersonalDetails.login; + const isOurMention = loginWithoutLeadingAt === props.currentUserPersonalDetails.login; return ( - - + showUserDetails(loginWhithoutLeadingAt)} + onPress={() => showUserDetails(loginWithoutLeadingAt)} > - + ); diff --git a/src/components/TextLink.js b/src/components/TextLink.js index f075002058ab..fcc37d0e9499 100644 --- a/src/components/TextLink.js +++ b/src/components/TextLink.js @@ -31,6 +31,7 @@ const defaultProps = { }; const TextLink = (props) => { + const rest = _.omit(props, _.keys(propTypes)); const additionalStyles = _.isArray(props.style) ? props.style : [props.style]; /** @@ -64,6 +65,8 @@ const TextLink = (props) => { onPress={openLink} onMouseDown={props.onMouseDown} onKeyDown={openLinkIfEnterKeyPressed} + // eslint-disable-next-line react/jsx-props-no-spreading + {...rest} > {props.children} From 7b640764933078fa8bc28df8c4a5d71c7118554c Mon Sep 17 00:00:00 2001 From: tienifr Date: Mon, 12 Jun 2023 11:15:42 +0700 Subject: [PATCH 2/2] fix lint --- .../HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js b/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js index 17285249c856..9feb77f88c82 100644 --- a/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js +++ b/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js @@ -9,7 +9,7 @@ import htmlRendererPropTypes from './htmlRendererPropTypes'; import withCurrentUserPersonalDetails from '../../withCurrentUserPersonalDetails'; import personalDetailsPropType from '../../../pages/personalDetailsPropType'; import * as StyleUtils from '../../../styles/StyleUtils'; -import TextLink from "../../TextLink"; +import TextLink from '../../TextLink'; const propTypes = { ...htmlRendererPropTypes,