mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* added rel="noopener noreferrer" to link elements using external and noIcon prop * fix: resolve asChild and external prop conflicts in Link components * Revert "fix: resolve asChild and external prop conflicts in Link components" This reverts commit e99580049946b487ce4dc77e7cdab2cd17e5c820. * fix: remove asChild prop conflicts with external links
30 lines
595 B
TypeScript
30 lines
595 B
TypeScript
import React from 'react';
|
|
|
|
import { Link } from 'toolkit/chakra/link';
|
|
import IconSvg from 'ui/shared/IconSvg';
|
|
|
|
interface Props {
|
|
url: string;
|
|
}
|
|
|
|
const SupportLink = ({ url }: Props) => {
|
|
const isEmail = url.includes('@');
|
|
const href = isEmail ? `mailto:${ url }` : url;
|
|
|
|
return (
|
|
<Link
|
|
href={ href }
|
|
external
|
|
noIcon
|
|
display="inline-flex"
|
|
alignItems="center"
|
|
columnGap={ 1 }
|
|
>
|
|
<IconSvg name={ isEmail ? 'email' : 'link' } boxSize={ 6 } color="icon.primary"/>
|
|
<span>{ url }</span>
|
|
</Link>
|
|
);
|
|
};
|
|
|
|
export default SupportLink;
|