This commit is contained in:
pooja-bruno
2025-05-14 17:45:03 +05:30
parent 0888125899
commit 45b660985e
3 changed files with 29 additions and 28 deletions

View File

@@ -14,6 +14,9 @@ const Wrapper = styled.div`
.inherit-mode-text {
color: ${(props) => props.theme.colors.text.yellow};
}
.auth-mode-label {
color: ${(props) => props.theme.colors.text.yellow};
}
`;
export default Wrapper;

View File

@@ -203,7 +203,6 @@ const Auth = ({ collection, folder }) => {
}
};
console.log('folder', folder);
return (
<StyledWrapper className="w-full">

View File

@@ -5,8 +5,7 @@ import { IconCaretDown } from '@tabler/icons';
import Dropdown from 'components/Dropdown';
import { useTheme } from 'providers/Theme';
import SingleLineEditor from 'components/SingleLineEditor';
import { updateAuth } from 'providers/ReduxStore/slices/collections';
import { sendRequest, saveRequest } from 'providers/ReduxStore/slices/collections/actions';
import { sendRequest } from 'providers/ReduxStore/slices/collections/actions';
import StyledWrapper from './StyledWrapper';
import { humanizeRequestAPIKeyPlacement } from 'utils/collections';
@@ -63,30 +62,6 @@ const ApiKeyAuth = ({ item, collection, updateAuth, request, save }) => {
return (
<StyledWrapper className="mt-2 w-full">
<div className="flex items-center mb-2">
<div className="mr-4 font-medium">Add To</div>
<Dropdown onCreate={onDropdownCreate} icon={<Icon />} placement="bottom-end">
<div
className="dropdown-item"
onClick={() => {
dropdownTippyRef?.current?.hide();
handleAuthChange('placement', 'header');
}}
>
Header
</div>
<div
className="dropdown-item"
onClick={() => {
dropdownTippyRef?.current?.hide();
handleAuthChange('placement', 'queryParam');
}}
>
Query Param
</div>
</Dropdown>
</div>
<label className="block font-medium mb-2">Key</label>
<div className="single-line-editor-wrapper mb-2">
<SingleLineEditor
@@ -101,7 +76,7 @@ const ApiKeyAuth = ({ item, collection, updateAuth, request, save }) => {
</div>
<label className="block font-medium mb-2">Value</label>
<div className="single-line-editor-wrapper">
<div className="single-line-editor-wrapper mb-2">
<SingleLineEditor
value={apikeyAuth.value || ''}
theme={storedTheme}
@@ -113,6 +88,30 @@ const ApiKeyAuth = ({ item, collection, updateAuth, request, save }) => {
isSecret={true}
/>
</div>
<label className="block font-medium mb-2">Add To</label>
<div className="inline-flex items-center cursor-pointer auth-placement-selector w-fit">
<Dropdown onCreate={onDropdownCreate} icon={<Icon />} placement="bottom-end">
<div
className="dropdown-item"
onClick={() => {
dropdownTippyRef?.current?.hide();
handleAuthChange('placement', 'header');
}}
>
Header
</div>
<div
className="dropdown-item"
onClick={() => {
dropdownTippyRef?.current?.hide();
handleAuthChange('placement', 'queryparams');
}}
>
Query Param
</div>
</Dropdown>
</div>
</StyledWrapper>
);
};