diff --git a/frontend/src/_ui/HttpHeaders/SourceEditor.jsx b/frontend/src/_ui/HttpHeaders/SourceEditor.jsx index 2e0bcb1a31..eb75bc9b6c 100644 --- a/frontend/src/_ui/HttpHeaders/SourceEditor.jsx +++ b/frontend/src/_ui/HttpHeaders/SourceEditor.jsx @@ -1,67 +1,102 @@ import React from 'react'; import Input from '../Input'; +import Trash from '@/_ui/Icon/solidIcons/Trash'; +import { ButtonSolid } from '@/_ui/AppButton/AppButton'; +import AddRectangle from '@/_ui/Icon/bulkIcons/AddRectangle'; +import '@/_ui/HttpHeaders/sourceEditorStyles.scss'; +import InfoIcon from '@assets/images/icons/info.svg'; export default ({ options, addNewKeyValuePair, removeKeyValuePair, keyValuePairValueChanged, workspaceConstants }) => { + const darkMode = localStorage.getItem('darkMode') === 'true'; + return ( -
- - - - - - - - - - {options.map((option, index) => { - return ( - - - - {index > 0 && ( - - )} - {index === 0 && ( - - )} - - ); - })} - -
KeyValue
- keyValuePairValueChanged(e.target.value, 0, index)} - value={option[0]} - workspaceConstants={workspaceConstants} - placeholder="key" - autoComplete="off" - /> - - keyValuePairValueChanged(e.target.value, 1, index)} - workspaceConstants={workspaceConstants} - /> - - { - removeKeyValuePair(index); - }} - > - x - - - -
+
+ {options.length === 0 && ( +
+ + There are no key value pairs added +
+ )} + + {options?.length > 0 && ( +
+
+
KEY
+
VALUE
+
+
+ )} + + {options.map((option, index) => ( +
+ keyValuePairValueChanged(e.target.value, 0, index)} + value={option[0]} + workspaceConstants={workspaceConstants} + placeholder="key" + autoComplete="off" + style={{ + flex: 1, + width: '250px', + borderTopRightRadius: '0', + borderBottomRightRadius: '0', + borderRight: 'none', + }} + /> + + keyValuePairValueChanged(e.target.value, 1, index)} + workspaceConstants={workspaceConstants} + style={{ + flex: 2, + borderTopLeftRadius: '0', + borderBottomLeftRadius: '0', + borderTopRightRadius: '0', + borderBottomRightRadius: '0', + }} + /> + + +
+ ))} + +
+ addNewKeyValuePair(options)} style={{ gap: '0px' }}> + +   Add more + +
); }; diff --git a/frontend/src/_ui/HttpHeaders/sourceEditorStyles.scss b/frontend/src/_ui/HttpHeaders/sourceEditorStyles.scss new file mode 100644 index 0000000000..edcd0c3caf --- /dev/null +++ b/frontend/src/_ui/HttpHeaders/sourceEditorStyles.scss @@ -0,0 +1,54 @@ +input.form-control, + textarea, + .input-control { + gap: 16px !important; + background: var(--base) !important; + border: 1px solid var(--slate7) !important; + border-radius: 6px; + margin-bottom: 4px !important; + color: var(--slate12) !important; + transition: none; + height: 35px; + width: 350px; + padding-left: 0.4375rem; + padding-right: 0.4375rem; + padding-top: 0.75rem; + padding-bottom: 0.75rem; + overflow-x: 'auto'; + white-space: 'nowrap'; + + + &:hover { + background: var(--slate1) !important; + border: 1px solid var(--slate8) !important; + -webkit-box-shadow: none !important; + box-shadow: none !important; + outline: none; + } + + &:focus-visible { + background: var(--indigo2) !important; + border: 1px solid var(--indigo9) !important; + box-shadow: none !important; + } + + &.input-error-border { + border-color: #DB4324 !important; + } + + &:-webkit-autofill { + box-shadow: 0 0 0 1000px var(--base) inset !important; + -webkit-text-fill-color: var(--slate12) !important; + + &:hover { + box-shadow: 0 0 0 1000px var(--slate1) inset !important; + -webkit-text-fill-color: var(--slate12) !important; + } + + &:focus-visible { + box-shadow: 0 0 0 1000px var(--indigo2) inset !important; + -webkit-text-fill-color: var(--slate12) !important; + } + } + + }