Fix URLBar expanded state inner buttons

This commit is contained in:
Gregory Schier
2024-01-18 20:40:56 -08:00
parent 56d4212f68
commit 18ea9dda3d
5 changed files with 8 additions and 8 deletions

View File

@@ -71,7 +71,7 @@ export const UrlBar = memo(function UrlBar({ id: requestId, url, method, classNa
<RequestMethodDropdown <RequestMethodDropdown
method={method} method={method}
onChange={handleMethodChange} onChange={handleMethodChange}
className="!h-auto mx-0.5 my-0.5" className="mx-0.5 my-0.5"
/> />
} }
rightSlot={ rightSlot={
@@ -80,7 +80,7 @@ export const UrlBar = memo(function UrlBar({ id: requestId, url, method, classNa
iconSize="md" iconSize="md"
title="Send Request" title="Send Request"
type="submit" type="submit"
className="!h-auto w-8 mr-0.5 my-0.5" className="w-8 mr-0.5 my-0.5"
icon={loading ? 'update' : 'sendHorizontal'} icon={loading ? 'update' : 'sendHorizontal'}
spin={loading} spin={loading}
hotkeyAction="request.send" hotkeyAction="request.send"

View File

@@ -5,7 +5,7 @@ import { forwardRef, useCallback, useMemo, useRef, useState } from 'react';
import type { EditorProps } from './Editor'; import type { EditorProps } from './Editor';
import { Editor } from './Editor'; import { Editor } from './Editor';
import { IconButton } from './IconButton'; import { IconButton } from './IconButton';
import { HStack, VStack } from './Stacks'; import { HStack } from './Stacks';
export type InputProps = Omit< export type InputProps = Omit<
HTMLAttributes<HTMLInputElement>, HTMLAttributes<HTMLInputElement>,

View File

@@ -1,7 +1,7 @@
import classNames from 'classnames'; import classNames from 'classnames';
import type { ReactNode } from 'react'; import type { ReactNode } from 'react';
import { useCallback, useMemo } from 'react'; import { useCallback, useMemo } from 'react';
import { useDebouncedSetState } from '../../hooks/useDebouncedSetState'; import { useDebouncedState } from '../../hooks/useDebouncedState';
import { useFilterResponse } from '../../hooks/useFilterResponse'; import { useFilterResponse } from '../../hooks/useFilterResponse';
import { useResponseBodyText } from '../../hooks/useResponseBodyText'; import { useResponseBodyText } from '../../hooks/useResponseBodyText';
import { useResponseContentType } from '../../hooks/useResponseContentType'; import { useResponseContentType } from '../../hooks/useResponseContentType';
@@ -19,7 +19,7 @@ interface Props {
export function TextViewer({ response, pretty }: Props) { export function TextViewer({ response, pretty }: Props) {
const [isSearching, toggleIsSearching] = useToggle(); const [isSearching, toggleIsSearching] = useToggle();
const [filterText, setDebouncedFilterText, setFilterText] = useDebouncedSetState<string>('', 400); const [filterText, setDebouncedFilterText, setFilterText] = useDebouncedState<string>('', 400);
const contentType = useResponseContentType(response); const contentType = useResponseContentType(response);
const rawBody = useResponseBodyText(response) ?? ''; const rawBody = useResponseBodyText(response) ?? '';

View File

@@ -2,7 +2,7 @@ import type { Dispatch, SetStateAction } from 'react';
import { useMemo, useState } from 'react'; import { useMemo, useState } from 'react';
import { debounce } from '../lib/debounce'; import { debounce } from '../lib/debounce';
export function useDebouncedSetState<T>( export function useDebouncedState<T>(
defaultValue: T, defaultValue: T,
delay?: number, delay?: number,
): [T, Dispatch<SetStateAction<T>>, Dispatch<SetStateAction<T>>] { ): [T, Dispatch<SetStateAction<T>>, Dispatch<SetStateAction<T>>] {

View File

@@ -1,8 +1,8 @@
import { useEffect } from 'react'; import { useEffect } from 'react';
import { useDebouncedSetState } from './useDebouncedSetState'; import { useDebouncedState } from './useDebouncedState';
export function useDebouncedValue<T>(value: T, delay?: number) { export function useDebouncedValue<T>(value: T, delay?: number) {
const [state, setState] = useDebouncedSetState<T>(value, delay); const [state, setState] = useDebouncedState<T>(value, delay);
useEffect(() => setState(value), [setState, value]); useEffect(() => setState(value), [setState, value]);
return state; return state;
} }