Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"react-addons-shallow-compare": "0.14.8",
"react-addons-test-utils": "^15.6.2",
"react-collapse": "^4.0.3",
"react-copy-to-clipboard": "5.0.1",
"react-debounce-input": "^3.2.0",
"react-dom": "^15.6.2",
"react-height": "^2.0.0",
Expand Down
3 changes: 2 additions & 1 deletion src/core/components/response-body.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from "react"
import PropTypes from "prop-types"
import formatXml from "xml-but-prettier"
import lowerCase from "lodash/lowerCase"
import { CopyToClipboard } from "react-copy-to-clipboard"
import { extractFileNameFromContentDispositionHeader } from "core/utils"
import win from "core/window"

Expand Down Expand Up @@ -150,7 +151,7 @@ export default class ResponseBody extends React.PureComponent {
}

return ( !bodyEl ? null : <div>
<h5>Response body</h5>
<h5>Response body<CopyToClipboard text={ content }><button className="copy-to-clipboard"></button></CopyToClipboard></h5>
{ bodyEl }
</div>
)
Expand Down
8 changes: 8 additions & 0 deletions src/style/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -796,3 +796,11 @@ a.nostyle {
cursor: pointer;
}
}

button.copy-to-clipboard {
float: right;
border: none;
width: 16x;
height: 20px;
background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' aria-hidden='true'><path fill='#0366d6' fill-rule='evenodd' d='M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z'></path></svg>") center center no-repeat;
}