import React from 'react'; import { TouchableWithoutFeedback } from 'react-native'; import styled from 'styled-components/native'; import type { ILinkProps } from './types'; import Box from '../Box'; import { useThemeProps } from '../../../hooks'; import { useLink } from './useLink'; const StyledLink = styled(Box)({}); const Link = ( { style, href, isUnderlined = true, onClick, isExternal, children, m, mt, mr, ml, mb, p, pt, pl, pr, pb, w, width, h, height, _text, ...props }: ILinkProps, ref: any ) => { const layoutProps = { m, mt, mr, ml, mb, p, pt, pr, pl, pb, w, width, h, height, }; let newProps = useThemeProps('Link', props); const linkTextProps = { textDecorationLine: isUnderlined ? 'underline' : 'none', ..._text, }; const { linkProps } = useLink({ href, onClick, isExternal }); return ( {children} ); }; export default React.memo(React.forwardRef(Link)); export type { ILinkProps };