Introduce button to copy request / response body to clipboard
Summary: Changelog: [Network] Introduce a copy button for request / response bodies Reviewed By: passy Differential Revision: D28222152 fbshipit-source-id: db33c8e91cbbe733502b32df75de14290e6f3d95
This commit is contained in:
committed by
Facebook GitHub Bot
parent
72e34bbd0d
commit
9c5967caf9
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
import React, {createRef} from 'react';
|
||||
import {Button, Menu, Modal, Typography} from 'antd';
|
||||
import {Button, Menu, message, Modal, Typography} from 'antd';
|
||||
|
||||
import {
|
||||
Layout,
|
||||
@@ -308,6 +308,10 @@ export function plugin(client: PluginClient<Events, Methods>) {
|
||||
</Menu.Item>
|
||||
);
|
||||
},
|
||||
onCopyText(text: string) {
|
||||
client.writeTextToClipboard(text);
|
||||
message.success('Text copied to clipboard');
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -418,6 +422,7 @@ function Sidebar() {
|
||||
request={request}
|
||||
bodyFormat={detailBodyFormat}
|
||||
onSelectFormat={instance.onSelectFormat}
|
||||
onCopyText={instance.onCopyText}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user