New 'Truncated Link' component for shared styling
This commit is contained in:
parent
75017feada
commit
6c274e5375
27
apps/explorer/src/app/components/truncate/truncated-link.tsx
Normal file
27
apps/explorer/src/app/components/truncate/truncated-link.tsx
Normal file
@ -0,0 +1,27 @@
|
||||
import { TruncateInline } from './truncate';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
interface TruncatedLinkProps {
|
||||
to: string;
|
||||
text: string;
|
||||
startChars: number;
|
||||
endChars: number;
|
||||
}
|
||||
|
||||
export const TruncatedLink = ({
|
||||
to,
|
||||
text,
|
||||
startChars,
|
||||
endChars,
|
||||
}: TruncatedLinkProps) => {
|
||||
return (
|
||||
<Link to={to}>
|
||||
<TruncateInline
|
||||
text={text}
|
||||
startChars={startChars}
|
||||
endChars={endChars}
|
||||
className="font-mono font-bold underline dark:text-vega-yellow dark:font-normal dark:no-underline"
|
||||
/>
|
||||
</Link>
|
||||
);
|
||||
};
|
Loading…
Reference in New Issue
Block a user