Enhance UrlDisplay component with improved styling for responsive text and link handling
This commit is contained in:
parent
c075599044
commit
594c9a99ce
@ -10,19 +10,30 @@ const UrlDisplay = ({ url, showCopy = true, showLink = false }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Flex>
|
<Flex style={{ minWidth: 0 }}>
|
||||||
{showLink ? (
|
{showLink ? (
|
||||||
<Link
|
<Link
|
||||||
href={url}
|
href={url}
|
||||||
target='_blank'
|
target='_blank'
|
||||||
rel='noopener noreferrer'
|
rel='noopener noreferrer'
|
||||||
style={{ marginRight: 8 }}
|
style={{
|
||||||
|
marginRight: 8,
|
||||||
|
minWidth: 0,
|
||||||
|
flex: 1,
|
||||||
|
overflow: 'hidden',
|
||||||
|
width: 0
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<Text ellipsis>{url}</Text>
|
<Text ellipsis style={{ display: 'block' }}>
|
||||||
|
{url}
|
||||||
|
</Text>
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<Text style={{ marginRight: 8 }} ellipsis>
|
<Text
|
||||||
|
style={{ marginRight: 8, minWidth: 0, flex: 1, width: 0 }}
|
||||||
|
ellipsis
|
||||||
|
>
|
||||||
{url}
|
{url}
|
||||||
</Text>
|
</Text>
|
||||||
<Tooltip title='Open URL' arrow={false}>
|
<Tooltip title='Open URL' arrow={false}>
|
||||||
@ -30,7 +41,7 @@ const UrlDisplay = ({ url, showCopy = true, showLink = false }) => {
|
|||||||
icon={<LinkIcon />}
|
icon={<LinkIcon />}
|
||||||
type='text'
|
type='text'
|
||||||
size='small'
|
size='small'
|
||||||
style={{ minWidth: 25 }}
|
style={{ minWidth: 25, flexShrink: 0 }}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
window.open(url, '_blank', 'noopener,noreferrer')
|
window.open(url, '_blank', 'noopener,noreferrer')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user