1
1
import { Fragment , useEffect , useRef } from 'react' ;
2
+ import { useTheme } from '@emotion/react' ;
2
3
import styled from '@emotion/styled' ;
3
4
4
5
import { openNavigateToExternalLinkModal } from 'sentry/actionCreators/modal' ;
@@ -10,9 +11,9 @@ import Section from 'sentry/components/feedback/feedbackItem/feedbackItemSection
10
11
import FeedbackReplay from 'sentry/components/feedback/feedbackItem/feedbackReplay' ;
11
12
import MessageSection from 'sentry/components/feedback/feedbackItem/messageSection' ;
12
13
import TagsSection from 'sentry/components/feedback/feedbackItem/tagsSection' ;
13
- import ExternalLink from 'sentry/components/links/externalLink' ;
14
14
import PanelItem from 'sentry/components/panels/panelItem' ;
15
15
import QuestionTooltip from 'sentry/components/questionTooltip' ;
16
+ import TextCopyInput from 'sentry/components/textCopyInput' ;
16
17
import { IconChat , IconFire , IconLink , IconTag } from 'sentry/icons' ;
17
18
import { t } from 'sentry/locale' ;
18
19
import { space } from 'sentry/styles/space' ;
@@ -32,6 +33,7 @@ export default function FeedbackItem({feedbackItem, eventData, tags}: Props) {
32
33
eventData ?. contexts . feedback ?. url ??
33
34
eventData ?. tags . find ( tag => tag . key === 'url' ) ?. value ;
34
35
const crashReportId = eventData ?. contexts ?. feedback ?. associated_event_id ;
36
+ const theme = useTheme ( ) ;
35
37
36
38
const overflowRef = useRef < HTMLDivElement > ( null ) ;
37
39
useEffect ( ( ) => {
@@ -53,24 +55,17 @@ export default function FeedbackItem({feedbackItem, eventData, tags}: Props) {
53
55
54
56
{ ! crashReportId || ( crashReportId && url ) ? (
55
57
< Section icon = { < IconLink size = "xs" /> } title = { t ( 'URL' ) } >
56
- < UrlWrapper >
57
- { eventData ?. contexts . feedback || eventData ?. tags ? (
58
- url ? (
59
- < ExternalLink
60
- onClick = { e => {
61
- e . preventDefault ( ) ;
62
- openNavigateToExternalLinkModal ( { linkText : url } ) ;
63
- } }
64
- >
65
- { url }
66
- </ ExternalLink >
67
- ) : (
68
- t ( 'URL not found' )
69
- )
70
- ) : (
71
- ''
72
- ) }
73
- </ UrlWrapper >
58
+ < TextCopyInput
59
+ style = { { color : `${ theme . blue400 } ` } }
60
+ onClick = { e => {
61
+ e . preventDefault ( ) ;
62
+ openNavigateToExternalLinkModal ( { linkText : url } ) ;
63
+ } }
64
+ >
65
+ { eventData ?. contexts . feedback || eventData ?. tags
66
+ ? url ?? t ( 'URL not found' )
67
+ : '' }
68
+ </ TextCopyInput >
74
69
</ Section >
75
70
) : null }
76
71
@@ -126,10 +121,3 @@ const OverflowPanelItem = styled(PanelItem)`
126
121
gap: ${ space ( 2 ) } ;
127
122
padding: ${ space ( 2 ) } ${ space ( 2 ) } 0 ${ space ( 2 ) } ;
128
123
` ;
129
-
130
- const UrlWrapper = styled ( 'div' ) `
131
- border-radius: ${ p => p . theme . borderRadius } ;
132
- border: 1px solid ${ p => p . theme . border } ;
133
- padding: ${ space ( 0.75 ) } ${ space ( 1.5 ) } ;
134
- line-height: 1.3em;
135
- ` ;
0 commit comments