Skip to content

Commit 91a72dd

Browse files
committed
feat: enhance NetworkLogItem with copy to clipboard functionality and adjust scroll indicator
1 parent 0391a52 commit 91a72dd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/NetworkLogItem.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ interface NetworkLogItemProps {
1414
log: NetworkLog;
1515
showRequestHeader?: boolean;
1616
showResponseHeader?: boolean;
17+
useCopyToClipboard?: boolean;
1718
}
1819

1920
const NetworkLogItem: React.FC<NetworkLogItemProps> = ({
2021
log,
22+
useCopyToClipboard,
2123
showResponseHeader = false,
2224
showRequestHeader = false,
2325
}) => {
@@ -117,14 +119,15 @@ const NetworkLogItem: React.FC<NetworkLogItemProps> = ({
117119
<ScrollView
118120
style={styles.detailsScroll}
119121
nestedScrollEnabled={true} // This is the crucial fix
120-
showsVerticalScrollIndicator={true}
122+
showsVerticalScrollIndicator={false}
121123
bounces={false}
122124
>
123125
<View>
124126
<Text style={styles.codeText}>Copy Curl</Text>
125127
<CopyItem
126128
style={styles.copyToClipboard}
127129
textToCopy={generateCurl(log)}
130+
useCopyToClipboard={useCopyToClipboard}
128131
/>
129132
</View>
130133
{showRequestHeader && (
@@ -161,6 +164,7 @@ const NetworkLogItem: React.FC<NetworkLogItemProps> = ({
161164
{formatBody(log.response.body)}
162165
</Text>
163166
<CopyItem
167+
useCopyToClipboard={useCopyToClipboard}
164168
style={[styles.copyToClipboard, { top: '30%' }]}
165169
textToCopy={formatBody(log.response.body)}
166170
/>

0 commit comments

Comments
 (0)