Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: clicking title of url preview don't open site #21717

Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/pages/home/report/LinkPreviewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -103,13 +104,13 @@ function LinkPreviewer(props) {
)}
</View>
{!_.isEmpty(title) && (
<Text
<TextLink
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We replaced the Text component to TextLink to make it clickable, but we didn't check the clickable area for the pv2 padding and full width area. This caused a regression here.

fontSize={variables.fontSizeNormal}
style={styles.pv2}
color={colors.blueLinkPreview}
style={[styles.pv2, {color: colors.blueLinkPreview}]}
eh2077 marked this conversation as resolved.
Show resolved Hide resolved
href={url}
>
{title}
</Text>
</TextLink>
)}
{!_.isEmpty(description) && <Text fontSize={variables.fontSizeNormal}>{description}</Text>}
{!_.isEmpty(image) && IMAGE_TYPES.includes(image.type) && (
Expand Down