Skip to content

Commit

Permalink
AccountLink: support using a custom label
Browse files Browse the repository at this point in the history
  • Loading branch information
csillag committed Feb 1, 2024
1 parent d7b50d1 commit bee23db
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/app/components/Account/AccountLink.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC } from 'react'
import { FC, ReactNode } from 'react'
import { Link as RouterLink } from 'react-router-dom'
import { useScreenSize } from '../../hooks/useScreensize'
import Link from '@mui/material/Link'
Expand All @@ -11,12 +11,18 @@ import { SearchScope } from '../../../types/searchScope'
export const AccountLink: FC<{
scope: SearchScope
address: string
title?: ReactNode
alwaysTrim?: boolean
plain?: boolean
}> = ({ scope, address, alwaysTrim, plain }) => {
}> = ({ scope, address, title, alwaysTrim, plain }) => {
const { isTablet } = useScreenSize()
const to = RouteUtils.getAccountRoute(scope, address)
return (

return title ? (
<Link component={RouterLink} to={to}>
{title}
</Link>
) : (
<Typography
variant="mono"
component="span"
Expand Down

0 comments on commit bee23db

Please sign in to comment.