Skip to content

Commit

Permalink
chore(link): removes TouchableOpacity tag from Link component
Browse files Browse the repository at this point in the history
[DSY-851] we have a bug when we try to use this feature within another text tag. The open issue:
facebook/react-native#27549
  • Loading branch information
yasminnvaz committed Oct 28, 2020
1 parent d677fe2 commit d891345
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions src/components/Link/Link.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import React, { ReactNode } from 'react';
import { withTheme } from 'styled-components/native';
import { Theme } from '@naturacosmeticos/natds-themes/react-native';
import {
NativeSyntheticEvent,
NativeTouchEvent,
Text,
TouchableOpacity,
} from 'react-native';
import { NativeSyntheticEvent, NativeTouchEvent, Text } from 'react-native';
import { getColorLink } from '../../common/themeSelectors';

export type LinkTypes = 'standard' | 'underline';
Expand Down Expand Up @@ -41,17 +36,15 @@ const LinkComponent = ({
theme,
type = 'standard',
}: LinkProps) => (
<TouchableOpacity>
<Text
onPress={onPress}
style={{
color: getColorLink(theme),
textDecorationLine: type === 'underline' ? 'underline' : 'none',
}}
testID={testID}>
{children}
</Text>
</TouchableOpacity>
<Text
onPress={onPress}
style={{
color: getColorLink(theme),
textDecorationLine: type === 'underline' ? 'underline' : 'none',
}}
testID={testID}>
{children}
</Text>
);

export const Link = withTheme(LinkComponent);

0 comments on commit d891345

Please sign in to comment.