Minor style tweaks

This commit is contained in:
Gregory Schier
2023-03-21 18:31:05 -07:00
parent c51805fe69
commit 7a6f0ccc46
9 changed files with 33 additions and 12 deletions

View File

@@ -1,10 +1,20 @@
import classnames from 'classnames';
import React, { memo } from 'react'; import React, { memo } from 'react';
interface Props {
className?: string;
}
export const DropMarker = memo( export const DropMarker = memo(
function DropMarker() { function DropMarker({ className }: Props) {
return ( return (
<div className="relative w-full h-0 overflow-visible pointer-events-none"> <div
<div className="absolute z-50 left-2 right-2 bottom-[1px] h-[0.2em] bg-blue-500/50 rounded-full" /> className={classnames(
className,
'relative w-full h-0 overflow-visible pointer-events-none',
)}
>
<div className="absolute z-50 left-2 right-2 -bottom-[0.1rem] h-[0.2rem] bg-blue-500/50 rounded-full" />
</div> </div>
); );
}, },

View File

@@ -20,7 +20,7 @@ export const RequestMethodDropdown = memo(function RequestMethodDropdown({
}: Props) { }: Props) {
return ( return (
<RadioDropdown value={method} items={methodItems} onChange={onChange}> <RadioDropdown value={method} items={methodItems} onChange={onChange}>
<Button size="sm" className={className}> <Button size="xs" className={className}>
{method.toUpperCase()} {method.toUpperCase()}
</Button> </Button>
</RadioDropdown> </RadioDropdown>

View File

@@ -81,6 +81,11 @@ export function RequestPane({ fullHeight, className }: Props) {
tabListClassName="pl-3" tabListClassName="pl-3"
label="Request body" label="Request body"
> >
<TabContent value="auth">
<div className="flex items-center justify-center min-h-[5rem]">
<header>Hello</header>
</div>
</TabContent>
<TabContent value="headers"> <TabContent value="headers">
<HeaderEditor <HeaderEditor
key={activeRequestId} key={activeRequestId}

View File

@@ -26,7 +26,7 @@ export default function Workspace() {
// TODO: Use container query subscription instead of minitoring everything // TODO: Use container query subscription instead of minitoring everything
}, [mainContentRef.current, windowSize, sidebarWidth.value]); }, [mainContentRef.current, windowSize, sidebarWidth.value]);
const isSideBySide = mainContentWidth > 900; const isSideBySide = mainContentWidth > 700;
if (activeWorkspace == null) { if (activeWorkspace == null) {
return null; return null;
@@ -65,7 +65,7 @@ export default function Workspace() {
fullHeight={isSideBySide} fullHeight={isSideBySide}
className={classnames(isSideBySide ? 'pr-1.5' : 'pr-3 pb-0')} className={classnames(isSideBySide ? 'pr-1.5' : 'pr-3 pb-0')}
/> />
<ResponsePane className={classnames(isSideBySide && 'pl-1.5')} /> <ResponsePane className={classnames(isSideBySide ? 'pl-1.5' : 'mt-0')} />
</div> </div>
</div> </div>
</div> </div>

View File

@@ -17,7 +17,7 @@ const colorStyles = {
export type ButtonProps = HTMLAttributes<HTMLElement> & { export type ButtonProps = HTMLAttributes<HTMLElement> & {
to?: string; to?: string;
color?: keyof typeof colorStyles; color?: keyof typeof colorStyles;
size?: 'sm' | 'md'; size?: 'sm' | 'md' | 'xs';
justify?: 'start' | 'center'; justify?: 'start' | 'center';
type?: 'button' | 'submit'; type?: 'button' | 'submit';
forDropdown?: boolean; forDropdown?: boolean;
@@ -51,6 +51,7 @@ const _Button = forwardRef<any, ButtonProps>(function Button(
justify === 'center' && 'justify-center', justify === 'center' && 'justify-center',
size === 'md' && 'h-md px-3', size === 'md' && 'h-md px-3',
size === 'sm' && 'h-sm px-2.5 text-sm', size === 'sm' && 'h-sm px-2.5 text-sm',
size === 'xs' && 'h-xs px-2 text-sm',
), ),
[color, size, justify, className], [color, size, justify, className],
); );

View File

@@ -125,9 +125,9 @@ export const PairEditor = memo(function PairEditor({
className={classnames( className={classnames(
className, className,
'@container', '@container',
'pb-6 grid', 'pb-2 grid',
// NOTE: Add padding to top so overflow doesn't hide drop marker // NOTE: Add padding to top so overflow doesn't hide drop marker
'py-1', 'pt-1',
)} )}
> >
{pairs.map((p, i) => { {pairs.map((p, i) => {
@@ -137,6 +137,7 @@ export const PairEditor = memo(function PairEditor({
{hoveredIndex === i && <DropMarker />} {hoveredIndex === i && <DropMarker />}
<FormRow <FormRow
pairContainer={p} pairContainer={p}
className="py-1"
isLast={isLast} isLast={isLast}
nameAutocomplete={nameAutocomplete} nameAutocomplete={nameAutocomplete}
valueAutocomplete={valueAutocomplete} valueAutocomplete={valueAutocomplete}
@@ -162,6 +163,7 @@ enum ItemTypes {
} }
type FormRowProps = { type FormRowProps = {
className?: string;
pairContainer: PairContainer; pairContainer: PairContainer;
onMove: (id: string, side: 'above' | 'below') => void; onMove: (id: string, side: 'above' | 'below') => void;
onEnd: (id: string) => void; onEnd: (id: string) => void;
@@ -180,6 +182,7 @@ type FormRowProps = {
>; >;
const FormRow = memo(function FormRow({ const FormRow = memo(function FormRow({
className,
pairContainer, pairContainer,
onChange, onChange,
onDelete, onDelete,
@@ -247,7 +250,8 @@ const FormRow = memo(function FormRow({
<div <div
ref={ref} ref={ref}
className={classnames( className={classnames(
'pb-2 group grid grid-cols-[auto_auto_minmax(0,1fr)_auto]', className,
'group grid grid-cols-[auto_auto_minmax(0,1fr)_auto]',
'grid-rows-1 items-center', 'grid-rows-1 items-center',
!pairContainer.pair.enabled && 'opacity-60', !pairContainer.pair.enabled && 'opacity-60',
)} )}

View File

@@ -64,7 +64,7 @@ export function Tabs<T>({
> >
<div <div
aria-label={label} aria-label={label}
className={classnames(tabListClassName, 'h-auto flex items-center pb-1')} className={classnames(tabListClassName, 'h-auto flex items-center overflow-auto pb-0.5')}
> >
<HStack space={1}> <HStack space={1}>
{tabs.map((t) => { {tabs.map((t) => {

View File

@@ -32,7 +32,7 @@ const lightTheme: AppTheme = {
gray: '#7f8fb0', gray: '#7f8fb0',
red: '#ec3f87', red: '#ec3f87',
orange: '#ff8b00', orange: '#ff8b00',
yellow: '#deda00', yellow: '#e7cf24',
green: '#00d365', green: '#00d365',
blue: '#0090ff', blue: '#0090ff',
pink: '#f670f6', pink: '#f670f6',

View File

@@ -1,4 +1,5 @@
const height = { const height = {
"xs": "1.5rem",
"sm": "2rem", "sm": "2rem",
"md": "2.5rem" "md": "2.5rem"
}; };