11import { FC , PropsWithChildren } from 'react'
22import { Link as RouterLink } from 'react-router-dom'
33import { useScreenSize } from '../../hooks/useScreensize'
4- import MuiLink from '@mui/material/Link'
5- import Typography from '@mui/material/Typography'
6- import { COLORS } from '../../../styles/theme/colors'
4+ import { Link as UilLink } from '@oasisprotocol/ui-library/src/components/link'
75import { trimLongString } from '../../utils/trimLongString'
86import { HighlightedText } from '../HighlightedText'
97import Box from '@mui/material/Box'
@@ -13,6 +11,7 @@ import { WithHoverHighlighting } from '../HoverHighlightingContext/WithHoverHigh
1311import { AdaptiveTrimmer } from '../AdaptiveTrimmer/AdaptiveTrimmer'
1412import { AdaptiveHighlightedText } from '../HighlightedText/AdaptiveHighlightedText'
1513import { HighlightedTrimmedText } from '../HighlightedText/HighlightedTrimmedText'
14+ import { cn } from '@oasisprotocol/ui-library/src/lib/utils'
1615
1716export type TrimMode = 'fixes' | 'adaptive'
1817
@@ -62,11 +61,7 @@ export const Link: FC<LinkProps> = ({
6261 < MaybeWithTooltip title = { tooltipTitle } >
6362 < Box sx = { { display : 'inline-flex' , alignItems : 'center' , gap : 2 } } >
6463 { hasName && withSourceIndicator && < AccountMetadataSourceIndicator source = { 'SelfProfessed' } /> }
65- < Typography
66- variant = "mono"
67- component = "span"
68- sx = { { color : labelOnly ? COLORS . brandExtraDark : COLORS . brandDark , fontWeight : 700 } }
69- >
64+ < span className = { cn ( 'font-medium' , ! labelOnly && 'text-primary' ) } >
7065 { isTablet ? (
7166 < TabletLink address = { address } name = { name } to = { to } labelOnly = { labelOnly } trimMode = { trimMode } />
7267 ) : (
@@ -79,7 +74,7 @@ export const Link: FC<LinkProps> = ({
7974 trimMode = { trimMode }
8075 />
8176 ) }
82- </ Typography >
77+ </ span >
8378 </ Box >
8479 </ MaybeWithTooltip >
8580 )
@@ -93,9 +88,7 @@ type CustomTrimEndLinkLabelProps = {
9388}
9489
9590const LinkLabel : FC < PropsWithChildren > = ( { children } ) => (
96- < Typography component = "span" fontSize = { 'inherit' } fontWeight = { 'inherit' } lineHeight = { 'inherit' } >
97- < span > { children } </ span >
98- </ Typography >
91+ < span className = "text-inherit font-inherit leading-inherit" > { children } </ span >
9992)
10093
10194const CustomTrimEndLinkLabel : FC < CustomTrimEndLinkLabelProps > = ( { name, to, labelOnly, trimMode } ) => {
@@ -108,9 +101,9 @@ const CustomTrimEndLinkLabel: FC<CustomTrimEndLinkLabelProps> = ({ name, to, lab
108101 return labelOnly ? (
109102 < LinkLabel > { label } </ LinkLabel >
110103 ) : (
111- < MuiLink component = { RouterLink } to = { to } >
112- { label }
113- </ MuiLink >
104+ < UilLink asChild >
105+ < RouterLink to = { to } > { label } </ RouterLink >
106+ </ UilLink >
114107 )
115108}
116109
@@ -136,9 +129,9 @@ const TabletLink: FC<TabletLinkProps> = ({ address, name, to, labelOnly, trimMod
136129 return labelOnly ? (
137130 < LinkLabel > { label } </ LinkLabel >
138131 ) : (
139- < MuiLink component = { RouterLink } to = { to } >
140- { label }
141- </ MuiLink >
132+ < UilLink asChild >
133+ < RouterLink to = { to } > { label } </ RouterLink >
134+ </ UilLink >
142135 )
143136}
144137
@@ -156,9 +149,9 @@ const DesktopLink: FC<DesktopLinkProps> = ({ address, name, to, alwaysTrim, trim
156149 ) : labelOnly ? (
157150 < LinkLabel > { trimLongString ( address ) } </ LinkLabel >
158151 ) : (
159- < MuiLink component = { RouterLink } to = { to } >
160- { trimLongString ( address ) }
161- </ MuiLink >
152+ < UilLink asChild >
153+ < RouterLink to = { to } > { trimLongString ( address ) } </ RouterLink >
154+ </ UilLink >
162155 ) }
163156 </ WithHoverHighlighting >
164157 )
@@ -169,9 +162,9 @@ const DesktopLink: FC<DesktopLinkProps> = ({ address, name, to, alwaysTrim, trim
169162 { labelOnly ? (
170163 < LinkLabel > { label } </ LinkLabel >
171164 ) : (
172- < MuiLink component = { RouterLink } to = { to } >
173- { label }
174- </ MuiLink >
165+ < UilLink asChild >
166+ < RouterLink to = { to } > { label } </ RouterLink >
167+ </ UilLink >
175168 ) }
176169 </ WithHoverHighlighting >
177170 )
0 commit comments