refactor: regroup request related components under request pane

This commit is contained in:
Anoop M D 2022-03-19 17:35:51 +05:30
parent 13847437e0
commit 5cbf163e26
16 changed files with 21 additions and 11 deletions

View File

@ -1,8 +1,8 @@
import React from 'react'; import React from 'react';
import { Tab, TabList, TabPanel, Tabs } from 'react-tabs'; import { Tab, TabList, TabPanel, Tabs } from 'react-tabs';
import QueryEditor from 'components/RequestPane/QueryEditor';
import RequestHeaders from 'components/RequestPane/RequestHeaders';
import StyledWrapper from './StyledWrapper'; import StyledWrapper from './StyledWrapper';
import QueryEditor from '../QueryEditor';
import RequestHeaders from '../RequestHeaders';
const GraphQLRequestPane = ({onRunQuery, schema, leftPaneWidth, value, onQueryChange}) => { const GraphQLRequestPane = ({onRunQuery, schema, leftPaneWidth, value, onQueryChange}) => {
return ( return (

View File

@ -1,8 +1,8 @@
import React from 'react'; import React from 'react';
import { Tab, TabList, TabPanel, Tabs } from 'react-tabs'; import { Tab, TabList, TabPanel, Tabs } from 'react-tabs';
import QueryParams from 'components/RequestPane/QueryParams';
import RequestHeaders from 'components/RequestPane/RequestHeaders';
import StyledWrapper from './StyledWrapper'; import StyledWrapper from './StyledWrapper';
import QueryParams from '../QueryParams';
import RequestHeaders from '../RequestHeaders';
const HttpRequestPane = ({leftPaneWidth}) => { const HttpRequestPane = ({leftPaneWidth}) => {
return ( return (
@ -12,14 +12,20 @@ const HttpRequestPane = ({leftPaneWidth}) => {
<Tab tabIndex="-1">Params</Tab> <Tab tabIndex="-1">Params</Tab>
<Tab tabIndex="-1">Body</Tab> <Tab tabIndex="-1">Body</Tab>
<Tab tabIndex="-1">Headers</Tab> <Tab tabIndex="-1">Headers</Tab>
<Tab tabIndex="-1">Authorization</Tab> <Tab tabIndex="-1">Auth</Tab>
</TabList> </TabList>
<TabPanel> <TabPanel>
<QueryParams /> <QueryParams />
</TabPanel> </TabPanel>
<TabPanel>
<div>Body</div>
</TabPanel>
<TabPanel> <TabPanel>
<RequestHeaders /> <RequestHeaders />
</TabPanel> </TabPanel>
<TabPanel>
<div>Auth</div>
</TabPanel>
</Tabs> </Tabs>
</StyledWrapper> </StyledWrapper>
) )

View File

@ -37,6 +37,8 @@ const Wrapper = styled.div`
input[type="checkbox"] { input[type="checkbox"] {
cursor: pointer; cursor: pointer;
position: relative;
top: 1px;
} }
`; `;

View File

@ -1,9 +1,9 @@
import React, { useRef, forwardRef } from 'react'; import React, { useRef, forwardRef } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { IconCaretDown } from '@tabler/icons'; import { IconCaretDown } from '@tabler/icons';
import Dropdown from '../Dropdown'; import Dropdown from 'components/Dropdown';
import SaveRequestButton from 'components/RequestPane/SaveRequest';
import StyledWrapper from './StyledWrapper'; import StyledWrapper from './StyledWrapper';
import SaveRequestButton from '../SaveRequest';
const QueryUrl = ({value, onChange, handleRun, collections}) => { const QueryUrl = ({value, onChange, handleRun, collections}) => {
const dropdownTippyRef = useRef(); const dropdownTippyRef = useRef();

View File

@ -37,6 +37,8 @@ const Wrapper = styled.div`
input[type="checkbox"] { input[type="checkbox"] {
cursor: pointer; cursor: pointer;
position: relative;
top: 1px;
} }
`; `;

View File

@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
import { faFolder } from "@fortawesome/free-solid-svg-icons"; import { faFolder } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import StyledWrapper from './StyledWrapper'; import StyledWrapper from './StyledWrapper';
import Modal from '../Modal'; import Modal from 'components//Modal';
const SaveRequestButton = ({folders}) => { const SaveRequestButton = ({folders}) => {
const [openSaveRequestModal, setOpenSaveRequestModal] = useState(false); const [openSaveRequestModal, setOpenSaveRequestModal] = useState(false);

View File

@ -1,9 +1,9 @@
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import find from 'lodash/find'; import find from 'lodash/find';
import { useSelector, useDispatch } from 'react-redux'; import { useSelector, useDispatch } from 'react-redux';
import QueryUrl from 'components/QueryUrl'; import QueryUrl from 'components/RequestPane/QueryUrl';
import GraphQLRequestPane from 'components/GraphQLRequestPane'; import GraphQLRequestPane from 'components/RequestPane/GraphQLRequestPane';
import HttpRequestPane from 'components/HttpRequestPane'; import HttpRequestPane from 'components/RequestPane/HttpRequestPane';
import ResponsePane from 'components/ResponsePane'; import ResponsePane from 'components/ResponsePane';
import Welcome from 'components/Welcome'; import Welcome from 'components/Welcome';
import { findItemInCollection } from 'utils/collections'; import { findItemInCollection } from 'utils/collections';