@@ -48,7 +48,9 @@ const RequestBody = ({ nodeId, nodeData }) => {
4848 } ;
4949
5050 const handleClose = ( option ) => {
51- if ( option == 'raw-json' ) {
51+ if ( option == 'None' ) {
52+ setRequestNodeBody ( nodeId , option , undefined ) ;
53+ } else if ( option == 'raw-json' ) {
5254 setRequestNodeBody ( nodeId , option , '' ) ;
5355 } else if ( option == 'form-data' ) {
5456 setRequestNodeBody ( nodeId , option , {
@@ -61,12 +63,12 @@ const RequestBody = ({ nodeId, nodeData }) => {
6163
6264 return (
6365 < >
64- < div className = 'border-t border-neutral-300 bg-slate-100 px-2 py-4 ' >
66+ < div className = 'px-2 py-4 border-t border-neutral-300 bg-slate-100' >
6567 < div className = 'flex items-center justify-between font-medium' >
6668 < h3 > Body</ h3 >
6769 < Menu as = 'div' className = 'relative inline-block text-left' >
6870 < Menu . Button data-click-from = 'body-type-menu' className = 'p-2' >
69- < EllipsisVerticalIcon className = 'h -4 w -4' aria-hidden = 'true' data-click-from = 'body-type-menu' />
71+ < EllipsisVerticalIcon className = 'w -4 h -4' aria-hidden = 'true' data-click-from = 'body-type-menu' />
7072 </ Menu . Button >
7173 < Transition
7274 as = { Fragment }
@@ -78,13 +80,13 @@ const RequestBody = ({ nodeId, nodeData }) => {
7880 leaveTo = 'transform opacity-0 scale-95'
7981 >
8082 < Menu . Items
81- className = 'absolute right-0 z-10 mt-2 w-56 origin-top-right divide-y divide-gray-100 rounded-md bg-white px-1 py-1 shadow-lg ring-1 ring-black/5 focus:outline-none'
83+ className = 'absolute right-0 z-10 w-56 px-1 py-1 mt-2 origin-top-right bg-white divide-y divide-gray-100 rounded-md shadow-lg ring-1 ring-black/5 focus:outline-none'
8284 data-click-from = 'body-type-menu'
8385 >
8486 { requestBodyTypeOptions . map ( ( bodyTypeOption , index ) => (
8587 < Menu . Item key = { index } data-click-from = 'body-type-menu' onClick = { ( ) => handleClose ( bodyTypeOption ) } >
8688 < button
87- className = 'group flex w-full items-center rounded-md px-2 py-2 text-sm text-gray-900 hover:bg-slate-100'
89+ className = 'flex items-center w-full px-2 py-2 text-sm text-gray-900 rounded-md group hover:bg-slate-100'
8890 data-click-from = 'body-type-menu'
8991 >
9092 { bodyTypeOption }
@@ -97,10 +99,10 @@ const RequestBody = ({ nodeId, nodeData }) => {
9799 </ div >
98100 </ div >
99101 { nodeData . requestBody && nodeData . requestBody . type === 'raw-json' && (
100- < div className = 'border border-t border-neutral-300 bg-slate-50 p-2 ' >
102+ < div className = 'p-2 border border-t border-neutral-300 bg-slate-50' >
101103 < textarea
102104 placeholder = 'Enter json'
103- className = 'nodrag nowheel w-full p-2'
105+ className = 'w-full p-2 nodrag nowheel '
104106 name = 'username'
105107 onChange = { ( e ) => handleRawJson ( e ) }
106108 rows = { 4 }
@@ -109,25 +111,25 @@ const RequestBody = ({ nodeId, nodeData }) => {
109111 </ div >
110112 ) }
111113 { nodeData . requestBody && nodeData . requestBody . type === 'form-data' && (
112- < div className = 'border-t border-neutral-300 bg-slate-50 p-2 ' >
113- < div className = 'flex items-center justify-between rounded-md border border -neutral-500 text-sm text-neutral-500 outline-0 focus:ring-0' >
114+ < div className = 'p-2 border-t border-neutral-300 bg-slate-50' >
115+ < div className = 'flex items-center justify-between text-sm border rounded-md border-neutral-500 text-neutral-500 outline-0 focus:ring-0' >
114116 < input
115117 placeholder = 'key'
116- className = 'nodrag nowheel bg-slate-50 pl-4 '
118+ className = 'pl-4 nodrag nowheel bg-slate-50'
117119 name = 'variable-value'
118120 onChange = { ( e ) => handleFormDataKey ( e ) }
119121 value = { nodeData . requestBody . body . key }
120122 />
121- < div className = 'rounded-br-md rounded-tr-md border-l border-l- neutral-500 px-4 py-2 ' > File</ div >
123+ < div className = 'px-4 py-2 border-l rounded-br-md rounded-tr-md border-l- neutral-500' > File</ div >
122124 </ div >
123125 < div className = 'py-2' >
124126 < button
125- className = 'flex w-full cursor-pointer items-center justify-center gap-2 rounded-md border border-neutral-500 bg-slate-100 p-2 hover:bg-slate-200'
127+ className = 'flex items-center justify-center w-full gap-2 p-2 border rounded-md cursor-pointer border-neutral-500 bg-slate-100 hover:bg-slate-200'
126128 onClick = { ( ) => {
127129 uploadFileForRequestNode . current . click ( ) ;
128130 } }
129131 >
130- < DocumentArrowUpIcon className = 'h -4 w -4 text-center' />
132+ < DocumentArrowUpIcon className = 'w -4 h -4 text-center' />
131133 Upload File
132134 { /* Ref: https://stackoverflow.com/questions/37457128/react-open-file-browser-on-click-a-div */ }
133135 < div className = 'hidden' >
0 commit comments