Fix URLBar expanded state inner buttons

This commit is contained in:
Gregory Schier
2024-01-18 20:40:56 -08:00
parent be8f0e4521
commit 1f9756c917
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
method={method}
onChange={handleMethodChange}
className="!h-auto mx-0.5 my-0.5"
className="mx-0.5 my-0.5"
/>
}
rightSlot={
@@ -80,7 +80,7 @@ export const UrlBar = memo(function UrlBar({ id: requestId, url, method, classNa
iconSize="md"
title="Send Request"
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'}
spin={loading}
hotkeyAction="request.send"

View File

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

View File

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

View File

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

View File

@@ -1,8 +1,8 @@
import { useEffect } from 'react';
import { useDebouncedSetState } from './useDebouncedSetState';
import { useDebouncedState } from './useDebouncedState';
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]);
return state;
}