mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-23 00:58:32 +02:00
Fix split layout placeholder
This commit is contained in:
@@ -27,7 +27,6 @@ export const EnvironmentActionsDropdown = memo(function EnvironmentActionsDropdo
|
|||||||
const showEnvironmentDialog = useCallback(() => {
|
const showEnvironmentDialog = useCallback(() => {
|
||||||
dialog.toggle({
|
dialog.toggle({
|
||||||
id: 'environment-editor',
|
id: 'environment-editor',
|
||||||
hideX: true,
|
|
||||||
noPadding: true,
|
noPadding: true,
|
||||||
size: 'lg',
|
size: 'lg',
|
||||||
className: 'h-[80vh]',
|
className: 'h-[80vh]',
|
||||||
|
|||||||
@@ -73,9 +73,11 @@ export const EnvironmentEditDialog = function ({ initialEnvironment }: Props) {
|
|||||||
>
|
>
|
||||||
Global Variables
|
Global Variables
|
||||||
</SidebarButton>
|
</SidebarButton>
|
||||||
<div className="px-2">
|
{environments.length > 0 && (
|
||||||
<Separator className="my-3"></Separator>
|
<div className="px-2">
|
||||||
</div>
|
<Separator className="my-3"></Separator>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
{environments.map((e) => (
|
{environments.map((e) => (
|
||||||
<SidebarButton
|
<SidebarButton
|
||||||
key={e.id}
|
key={e.id}
|
||||||
@@ -164,11 +166,6 @@ const EnvironmentEditor = function ({
|
|||||||
<HStack space={2} className="justify-between">
|
<HStack space={2} className="justify-between">
|
||||||
<Heading className="w-full flex items-center">
|
<Heading className="w-full flex items-center">
|
||||||
<div>{environment?.name ?? 'Global Variables'}</div>
|
<div>{environment?.name ?? 'Global Variables'}</div>
|
||||||
{environment == null && (
|
|
||||||
<span className="pr-3 text-sm text-gray-600 pl-2 font-normal italic ml-auto">
|
|
||||||
Always available no matter which environment is active
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
</Heading>
|
</Heading>
|
||||||
</HStack>
|
</HStack>
|
||||||
<PairEditor
|
<PairEditor
|
||||||
|
|||||||
@@ -3,11 +3,9 @@ import classNames from 'classnames';
|
|||||||
import type { CSSProperties, MouseEvent as ReactMouseEvent, ReactNode } from 'react';
|
import type { CSSProperties, MouseEvent as ReactMouseEvent, ReactNode } from 'react';
|
||||||
import React, { useCallback, useMemo, useRef, useState } from 'react';
|
import React, { useCallback, useMemo, useRef, useState } from 'react';
|
||||||
import { useLocalStorage } from 'react-use';
|
import { useLocalStorage } from 'react-use';
|
||||||
import { useActiveRequestId } from '../../hooks/useActiveRequestId';
|
|
||||||
import { useActiveWorkspaceId } from '../../hooks/useActiveWorkspaceId';
|
import { useActiveWorkspaceId } from '../../hooks/useActiveWorkspaceId';
|
||||||
import { clamp } from '../../lib/clamp';
|
import { clamp } from '../../lib/clamp';
|
||||||
import { ResizeHandle } from '../ResizeHandle';
|
import { ResizeHandle } from '../ResizeHandle';
|
||||||
import { HotKeyList } from './HotKeyList';
|
|
||||||
|
|
||||||
interface SlotProps {
|
interface SlotProps {
|
||||||
orientation: 'horizontal' | 'vertical';
|
orientation: 'horizontal' | 'vertical';
|
||||||
@@ -142,11 +140,6 @@ export function SplitLayout({
|
|||||||
[width, height, vertical, minHeightPx, setHeight, minWidthPx, setWidth],
|
[width, height, vertical, minHeightPx, setHeight, minWidthPx, setWidth],
|
||||||
);
|
);
|
||||||
|
|
||||||
const activeRequestId = useActiveRequestId();
|
|
||||||
if (activeRequestId === null) {
|
|
||||||
return <HotKeyList hotkeys={['http_request.create', 'sidebar.toggle']} />;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div ref={containerRef} className={classNames(className, 'grid w-full h-full')} style={styles}>
|
<div ref={containerRef} className={classNames(className, 'grid w-full h-full')} style={styles}>
|
||||||
{firstSlot({ style: areaL, orientation: vertical ? 'vertical' : 'horizontal' })}
|
{firstSlot({ style: areaL, orientation: vertical ? 'vertical' : 'horizontal' })}
|
||||||
|
|||||||
Reference in New Issue
Block a user