2021-07-01 18:21:40 +00:00
|
|
|
import React from "react";
|
|
|
|
import { NavLink } from "react-router-dom";
|
|
|
|
|
|
|
|
type AddressLinkProps = {
|
|
|
|
address: string;
|
|
|
|
text?: string;
|
2021-07-19 03:50:32 +00:00
|
|
|
dontOverrideColors?: boolean;
|
2021-07-01 18:21:40 +00:00
|
|
|
};
|
|
|
|
|
2021-07-19 03:50:32 +00:00
|
|
|
const AddressLink: React.FC<AddressLinkProps> = ({
|
|
|
|
address,
|
|
|
|
text,
|
|
|
|
dontOverrideColors,
|
|
|
|
}) => (
|
2021-07-01 18:21:40 +00:00
|
|
|
<NavLink
|
2021-07-19 03:50:32 +00:00
|
|
|
className={`${
|
|
|
|
dontOverrideColors ? "" : "text-link-blue hover:text-link-blue-hover"
|
|
|
|
} font-address truncate`}
|
2021-07-01 18:21:40 +00:00
|
|
|
to={`/address/${address}`}
|
|
|
|
>
|
2021-07-19 04:03:32 +00:00
|
|
|
<span className="truncate" title={text ?? address}>
|
2021-07-01 18:21:40 +00:00
|
|
|
{text ?? address}
|
2021-07-19 04:03:32 +00:00
|
|
|
</span>
|
2021-07-01 18:21:40 +00:00
|
|
|
</NavLink>
|
|
|
|
);
|
|
|
|
|
|
|
|
export default React.memo(AddressLink);
|