Skip to content

Commit

Permalink
fix: hide "intercept response" checkbox in response view (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Francoise authored Mar 1, 2022
1 parent 0c0f90c commit 1a52cd5
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/panel/RequestBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const RequestBody = ({ requestId, className = '' }: Props) => {
}, [contentType, onChangeBody, request.id, request.postData])

return (
<div className={`mt-8 flex flex-col justify-items-stretch ${className}`}>
<div className={`flex flex-col justify-items-stretch ${className}`}>
{bodyView}
</div>
)
Expand Down
22 changes: 12 additions & 10 deletions src/panel/RequestView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ const RequestView = ({ requestId }: Props) => {
() => (
<>
<RequestDetails
className={tab === 'headers' ? '' : 'hidden'}
className={`mt-8 ${tab === 'headers' ? '' : 'hidden'}`}
requestId={requestId}
/>
<RequestBody
className={tab === 'body' ? '' : 'hidden'}
className={`mt-8 ${tab === 'body' ? '' : 'hidden'}`}
requestId={requestId}
/>
</>
Expand Down Expand Up @@ -73,14 +73,16 @@ const RequestView = ({ requestId }: Props) => {
return (
<div className="max-w-5xl mx-24 my-8 px-8 pt-2">
<div className="flex space-x-4 mb-4">{buttons}</div>
<label className="mt-1 inline-flex items-center">
<input
type="checkbox"
checked={request.interceptResponse}
onChange={onToggleInterceptResponse}
/>
<span className="ml-1 text-sm text-gray-700">Intercept response</span>
</label>
{request.stage !== 'Response' ? (
<label className="mt-1 inline-flex items-center">
<input
type="checkbox"
checked={request.interceptResponse}
onChange={onToggleInterceptResponse}
/>
<span className="ml-1 text-sm text-gray-700">Intercept response</span>
</label>
) : null}
{content}
</div>
)
Expand Down
4 changes: 2 additions & 2 deletions src/panel/__tests__/__snapshots__/Main.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ exports[`[Main] should match request selection snapshot 1`] = `
</span>
</label>
<div
class=""
class="mt-8 "
>
<span
class="text-3xl font-bold"
Expand Down Expand Up @@ -429,7 +429,7 @@ exports[`[Main] should match request selection snapshot 1`] = `
</div>
</div>
<div
class="mt-8 flex flex-col justify-items-stretch hidden"
class="flex flex-col justify-items-stretch mt-8 hidden"
>
<div
class="relative -ml-4"
Expand Down
2 changes: 1 addition & 1 deletion src/panel/__tests__/__snapshots__/RequestBody.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`[RequestBody] should match initial snapshot 1`] = `
<div>
<div
class="mt-8 flex flex-col justify-items-stretch "
class="flex flex-col justify-items-stretch "
>
<div
class="relative -ml-4"
Expand Down
12 changes: 6 additions & 6 deletions src/panel/__tests__/__snapshots__/RequestView.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ exports[`[RequestView] should match body snapshot 1`] = `
</span>
</label>
<div
class="hidden"
class="mt-8 hidden"
>
<span
class="text-3xl font-bold"
Expand Down Expand Up @@ -313,7 +313,7 @@ exports[`[RequestView] should match body snapshot 1`] = `
</div>
</div>
<div
class="mt-8 flex flex-col justify-items-stretch "
class="flex flex-col justify-items-stretch mt-8 "
>
<div
class="relative -ml-4"
Expand Down Expand Up @@ -1080,7 +1080,7 @@ exports[`[RequestView] should match headers snapshot 1`] = `
</span>
</label>
<div
class=""
class="mt-8 "
>
<span
class="text-3xl font-bold"
Expand Down Expand Up @@ -1360,7 +1360,7 @@ exports[`[RequestView] should match headers snapshot 1`] = `
</div>
</div>
<div
class="mt-8 flex flex-col justify-items-stretch hidden"
class="flex flex-col justify-items-stretch mt-8 hidden"
>
<div
class="relative -ml-4"
Expand Down Expand Up @@ -2127,7 +2127,7 @@ exports[`[RequestView] should match initial snapshot 1`] = `
</span>
</label>
<div
class=""
class="mt-8 "
>
<span
class="text-3xl font-bold"
Expand Down Expand Up @@ -2407,7 +2407,7 @@ exports[`[RequestView] should match initial snapshot 1`] = `
</div>
</div>
<div
class="mt-8 flex flex-col justify-items-stretch hidden"
class="flex flex-col justify-items-stretch mt-8 hidden"
>
<div
class="relative -ml-4"
Expand Down

0 comments on commit 1a52cd5

Please sign in to comment.