A bunch more small things

This commit is contained in:
Gregory Schier
2023-02-25 23:04:31 -08:00
parent 83bb18df03
commit d85c021305
25 changed files with 1749 additions and 918 deletions

View File

@@ -7,9 +7,9 @@ import { IconButton } from './IconButton';
interface Props {
sendRequest: () => void;
loading: boolean;
method: { label: string; value: string };
method: string;
url: string;
onMethodChange: (method: { label: string; value: string }) => void;
onMethodChange: (method: string) => void;
onUrlChange: (url: string) => void;
}
@@ -27,12 +27,12 @@ export function UrlBar({ sendRequest, loading, onMethodChange, method, onUrlChan
label="Enter URL"
className="font-mono"
onChange={(e) => onUrlChange(e.currentTarget.value)}
value={url}
defaultValue={url}
placeholder="Enter a URL..."
leftSlot={
<DropdownMenuRadio
onValueChange={onMethodChange}
value={method.value}
onValueChange={(v) => onMethodChange(v.value)}
value={method.toUpperCase()}
items={[
{ label: 'GET', value: 'GET' },
{ label: 'PUT', value: 'PUT' },
@@ -43,8 +43,8 @@ export function UrlBar({ sendRequest, loading, onMethodChange, method, onUrlChan
{ label: 'HEAD', value: 'HEAD' },
]}
>
<Button disabled={loading} size="sm" className="ml-1" justify="start">
{method.label}
<Button type="button" disabled={loading} size="sm" className="ml-1" justify="start">
{method.toUpperCase()}
</Button>
</DropdownMenuRadio>
}