diff --git a/packages/bruno-app/src/components/ResponsePane/ResponseClear/StyledWrapper.js b/packages/bruno-app/src/components/ResponsePane/ResponseClear/StyledWrapper.js new file mode 100644 index 000000000..8c32a8bab --- /dev/null +++ b/packages/bruno-app/src/components/ResponsePane/ResponseClear/StyledWrapper.js @@ -0,0 +1,8 @@ +import styled from 'styled-components'; + +const StyledWrapper = styled.div` + font-size: 0.8125rem; + color: ${(props) => props.theme.requestTabPanel.responseStatus}; +`; + +export default StyledWrapper; diff --git a/packages/bruno-app/src/components/ResponsePane/ResponseClear/index.js b/packages/bruno-app/src/components/ResponsePane/ResponseClear/index.js new file mode 100644 index 000000000..7c2d6bbcf --- /dev/null +++ b/packages/bruno-app/src/components/ResponsePane/ResponseClear/index.js @@ -0,0 +1,28 @@ +import React from 'react'; +import { IconEraser } from '@tabler/icons'; +import { useDispatch } from 'react-redux'; +import StyledWrapper from './StyledWrapper'; +import { responseReceived } from 'providers/ReduxStore/slices/collections/index'; + +const ResponseClear = ({ collection, item }) => { + const dispatch = useDispatch(); + const response = item.response || {}; + + const clearResponse = () => + dispatch( + responseReceived({ + itemUid: item.uid, + collectionUid: collection.uid, + response: null + }) + ); + + return ( + + + + ); +}; +export default ResponseClear; diff --git a/packages/bruno-app/src/components/ResponsePane/ResponseSave/index.js b/packages/bruno-app/src/components/ResponsePane/ResponseSave/index.js index e924afa4e..7c183b0a6 100644 --- a/packages/bruno-app/src/components/ResponsePane/ResponseSave/index.js +++ b/packages/bruno-app/src/components/ResponsePane/ResponseSave/index.js @@ -21,7 +21,7 @@ const ResponseSave = ({ item }) => { }; return ( - + diff --git a/packages/bruno-app/src/components/ResponsePane/index.js b/packages/bruno-app/src/components/ResponsePane/index.js index 37419e048..02edc106e 100644 --- a/packages/bruno-app/src/components/ResponsePane/index.js +++ b/packages/bruno-app/src/components/ResponsePane/index.js @@ -15,6 +15,7 @@ import TestResults from './TestResults'; import TestResultsLabel from './TestResultsLabel'; import StyledWrapper from './StyledWrapper'; import ResponseSave from 'src/components/ResponsePane/ResponseSave'; +import ResponseClear from 'src/components/ResponsePane/ResponseClear'; const ResponsePane = ({ rightPaneWidth, item, collection }) => { const dispatch = useDispatch(); @@ -114,6 +115,7 @@ const ResponsePane = ({ rightPaneWidth, item, collection }) => { {!isLoading ? (
+