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
34 lines
725 B
TypeScript
34 lines
725 B
TypeScript
import React from 'react';
|
|
|
|
import type { TokenVerifiedInfo } from 'types/api/token';
|
|
|
|
import { Link } from 'toolkit/chakra/link';
|
|
import type { IconName } from 'ui/shared/IconSvg';
|
|
import IconSvg from 'ui/shared/IconSvg';
|
|
|
|
export interface Props {
|
|
field: keyof TokenVerifiedInfo;
|
|
icon: IconName;
|
|
title: string;
|
|
href?: string;
|
|
}
|
|
|
|
const ServiceLink = ({ href, title, icon }: Props) => {
|
|
return (
|
|
<Link
|
|
href={ href }
|
|
aria-label={ title }
|
|
title={ title }
|
|
external
|
|
noIcon
|
|
display="inline-flex"
|
|
alignItems="center"
|
|
>
|
|
<IconSvg name={ icon } boxSize={ 5 } mr={ 2 } color="icon.primary"/>
|
|
<span>{ title }</span>
|
|
</Link>
|
|
);
|
|
};
|
|
|
|
export default ServiceLink;
|