diff --git a/src-web/components/BinaryFileEditor.tsx b/src-web/components/BinaryFileEditor.tsx index 1fa4107a..cb742039 100644 --- a/src-web/components/BinaryFileEditor.tsx +++ b/src-web/components/BinaryFileEditor.tsx @@ -45,7 +45,7 @@ export function BinaryFileEditor({ return ( - + diff --git a/src-web/components/CookieDialog.tsx b/src-web/components/CookieDialog.tsx index 7427dbb5..3b7504b6 100644 --- a/src-web/components/CookieDialog.tsx +++ b/src-web/components/CookieDialog.tsx @@ -36,7 +36,7 @@ export const CookieDialog = function ({ cookieJarId }: Props) { - + {cookieJar?.cookies.map((c) => ( diff --git a/src-web/components/GrpcConnectionMessagesPane.tsx b/src-web/components/GrpcConnectionMessagesPane.tsx index a034e26d..66548bbc 100644 --- a/src-web/components/GrpcConnectionMessagesPane.tsx +++ b/src-web/components/GrpcConnectionMessagesPane.tsx @@ -61,8 +61,8 @@ export function GrpcConnectionMessagesPane({ style, methodType, activeRequest }: firstSlot={() => activeConnection && (
- - + + {events.length} messages {activeConnection.elapsed === 0 && ( diff --git a/src-web/components/HeaderSize.tsx b/src-web/components/HeaderSize.tsx new file mode 100644 index 00000000..3aa16867 --- /dev/null +++ b/src-web/components/HeaderSize.tsx @@ -0,0 +1,31 @@ +import classNames from 'classnames'; +import type { HTMLAttributes, ReactNode } from 'react'; +import { useIsFullscreen } from '../hooks/useIsFullscreen'; +import { useOsInfo } from '../hooks/useOsInfo'; + +interface HeaderSizeProps extends HTMLAttributes { + children?: ReactNode; + size: 'md' | 'lg'; +} + +export function HeaderSize({ className, style, size, ...props }: HeaderSizeProps) { + const platform = useOsInfo(); + const fullscreen = useIsFullscreen(); + const stoplightsVisible = platform?.osType === 'macos' && !fullscreen; + return ( +
+ {/* NOTE: This needs display:grid or else the element shrinks (even though scrollable) */} +
+
+ ); +} diff --git a/src-web/components/RecentConnectionsDropdown.tsx b/src-web/components/RecentConnectionsDropdown.tsx index 06e53a61..54f62eec 100644 --- a/src-web/components/RecentConnectionsDropdown.tsx +++ b/src-web/components/RecentConnectionsDropdown.tsx @@ -43,7 +43,7 @@ export function RecentConnectionsDropdown({ ...connections.slice(0, 20).map((c) => ({ key: c.id, label: ( - + {formatDistanceToNowStrict(c.createdAt + 'Z')} ago •{' '} {c.elapsed}ms diff --git a/src-web/components/RecentResponsesDropdown.tsx b/src-web/components/RecentResponsesDropdown.tsx index d33ebc81..175d3dc5 100644 --- a/src-web/components/RecentResponsesDropdown.tsx +++ b/src-web/components/RecentResponsesDropdown.tsx @@ -46,7 +46,7 @@ export const RecentResponsesDropdown = function ResponsePane({ ...responses.slice(0, 20).map((r: HttpResponse) => ({ key: r.id, label: ( - + {' '} {r.elapsed >= 0 ? `${r.elapsed}ms` : 'n/a'} diff --git a/src-web/components/ResponsePane.tsx b/src-web/components/ResponsePane.tsx index 26774a51..13be7047 100644 --- a/src-web/components/ResponsePane.tsx +++ b/src-web/components/ResponsePane.tsx @@ -92,7 +92,6 @@ export const ResponsePane = memo(function ResponsePane({ style, className, activ ) : (
diff --git a/src-web/components/Settings/Settings.tsx b/src-web/components/Settings/Settings.tsx index 845ab894..8d45f7a8 100644 --- a/src-web/components/Settings/Settings.tsx +++ b/src-web/components/Settings/Settings.tsx @@ -1,7 +1,11 @@ import { getCurrent } from '@tauri-apps/api/webviewWindow'; +import React from 'react'; import { createGlobalState, useKeyPressEvent } from 'react-use'; import { capitalize } from '../../lib/capitalize'; +import { HStack } from '../core/Stacks'; import { TabContent, Tabs } from '../core/Tabs/Tabs'; +import { HeaderSize } from '../HeaderSize'; +import { WindowControls } from '../WindowControls'; import { SettingsAppearance } from './SettingsAppearance'; import { SettingsGeneral } from './SettingsGeneral'; @@ -22,12 +26,20 @@ export const Settings = () => { return ( <> -
- Settings -
+ +
Settings
+ +
+ +
Theme
{(settings.appearance === 'system' || settings.appearance === 'light') && (
diff --git a/src-web/components/core/Stacks.tsx b/src-web/components/core/Stacks.tsx index 00b3cb14..7ac05299 100644 --- a/src-web/components/core/Stacks.tsx +++ b/src-web/components/core/Stacks.tsx @@ -19,7 +19,7 @@ interface HStackProps extends BaseStackProps { } export const HStack = forwardRef(function HStack( - { className, space, children, ...props }: HStackProps, + { className, space, children, alignItems = 'center', ...props }: HStackProps, // eslint-disable-next-line @typescript-eslint/no-explicit-any ref: ForwardedRef, ) { @@ -27,6 +27,7 @@ export const HStack = forwardRef(function HStack( {children} diff --git a/src-web/lib/theme/themes/yaak.ts b/src-web/lib/theme/themes/yaak.ts index d38e0fad..1a495f68 100644 --- a/src-web/lib/theme/themes/yaak.ts +++ b/src-web/lib/theme/themes/yaak.ts @@ -34,9 +34,9 @@ export const yaakDark: YaakTheme = { background: new Color('hsl(244,23%,14%)', 'dark'), backgroundHighlight: new Color('hsl(244,23%,23%)', 'dark'), backgroundHighlightSecondary: new Color('hsl(244,23%,20%)', 'dark'), - foreground: new Color('hsl(245,23%,80%)', 'dark'), + foreground: new Color('hsl(245,23%,83%)', 'dark'), foregroundSubtle: new Color('hsl(245,20%,65%)', 'dark'), - foregroundSubtler: new Color('hsl(245,18%,50%)', 'dark'), + foregroundSubtler: new Color('hsl(245,18%,51%)', 'dark'), colors: { primary: new Color('hsl(266,100%,79%)', 'dark'),