Skip to content

Commit

Permalink
lint: reformat service list render
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlougheed committed Jun 1, 2023
1 parent 3aa401d commit 12ccae9
Showing 1 changed file with 40 additions and 36 deletions.
76 changes: 40 additions & 36 deletions src/components/ServiceList.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,42 +166,46 @@ const ServiceRequestModal = ({service, onCancel}) => {
}
}, [hasAttempted, performRequestModalGet]);

return <Modal visible={service !== null}
title={`${service}: make a request`}
footer={null}
width={960}
onCancel={onCancel}>
<Form layout="inline" style={{display: "flex"}}>
<Form.Item style={{flex: 1}} wrapperCol={{span: 24}}>
<Input
addonBefore={(serviceUrl ?? "ERROR") + "/"}
value={requestPath}
disabled={!hasAttempted || requestLoading}
onChange={e => setRequestPath(e.target.value)}
/>
</Form.Item>
<Form.Item>
<Button type="primary" htmlFor="submit" onClick={e => {
performRequestModalGet();
e.preventDefault();
}}>GET</Button>
</Form.Item>
</Form>
<Divider />
{requestLoading ? <Skeleton loading={true} /> : (
requestIsJSON
? <JsonDisplay jsonSrc={requestData} />
: (
<div style={{maxWidth: "100%", overflowX: "auto"}}>
<pre>
{((typeof requestData) === "string" || requestData === null)
? requestData
: JSON.stringify(requestData)}
</pre>
</div>
)
)}
</Modal>;
return (
<Modal
visible={service !== null}
title={`${service}: make a request`}
footer={null}
width={960}
onCancel={onCancel}
>
<Form layout="inline" style={{display: "flex"}}>
<Form.Item style={{flex: 1}} wrapperCol={{span: 24}}>
<Input
addonBefore={(serviceUrl ?? "ERROR") + "/"}
value={requestPath}
disabled={!hasAttempted || requestLoading}
onChange={e => setRequestPath(e.target.value)}
/>
</Form.Item>
<Form.Item>
<Button type="primary" htmlFor="submit" onClick={e => {
performRequestModalGet();
e.preventDefault();
}}>GET</Button>
</Form.Item>
</Form>
<Divider />
{requestLoading ? <Skeleton loading={true} /> : (
requestIsJSON
? <JsonDisplay jsonSrc={requestData} />
: (
<div style={{maxWidth: "100%", overflowX: "auto"}}>
<pre>
{((typeof requestData) === "string" || requestData === null)
? requestData
: JSON.stringify(requestData)}
</pre>
</div>
)
)}
</Modal>
);
};
ServiceRequestModal.propTypes = {
service: PropTypes.string,
Expand Down

0 comments on commit 12ccae9

Please sign in to comment.