Skip to content

Commit

Permalink
make copy all button sticky (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi-sl authored Aug 27, 2024
1 parent ee26a96 commit f58bd07
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
14 changes: 11 additions & 3 deletions src/Components/ReqDetail/ReqDetail.styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

.section-title {
display: flex;
align-content: center;
align-items: center;

.caret-icon {
fill: $brand-primary-gray;
Expand All @@ -45,6 +45,7 @@

.section-detail {
padding: $size-xs-s $size-s;
width: 100%;

.info-row {
margin: 0;
Expand Down Expand Up @@ -75,14 +76,21 @@
color: $brand-primary-dark-gray;
}

.response-content {
.payload-content {
font-size: $font-size-small;
width: 100%;
display: flex;
flex-direction: column;

.copy-button {
align-self: end;
display: flex;
justify-content: end;
width: 100%;
margin-top: -$size-xs-s;
background: $white-100;
position: -webkit-sticky;
position: sticky;
top: 0;
}

.payload-body {
Expand Down
2 changes: 1 addition & 1 deletion src/Components/ReqDetail/Response.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const Response = ({ data }) => {

return (
<div className={Styles['section-detail']}>
<div className={Styles['response-content']}>
<div className={Styles['payload-content']}>
<div className={Styles['copy-button']}>
<CopyAllButton text={content} />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/Components/ReqDetail/request/RequestPayload.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const RequestPayload = ({ data, isPayloadTransformed }) => {

return (
<div className={Styles['section-detail']}>
<div className={Styles['response-content']}>
<div className={Styles['payload-content']}>
<div className={Styles['copy-button']}>
<CopyAllButton text={payload} />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/Containers/ReqDetailContainer.styles.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import "./../styles/variables";

$close-button-width: 35px;
$tab-height: 32px;
$tab-height: 35px;

.req-detail-container {
width: 70%;
Expand Down

0 comments on commit f58bd07

Please sign in to comment.