Better environment color picker (#282)

This commit is contained in:
Gregory Schier authored and GitHub committed 2025-10-26 12:05:03 -07:00
1 parent 923b1ac830
commit 3f5b5a397c
10 files changed
+233 -64

No files matched your search

+1 -1
View File
@@ -49,7 +49,7 @@ export function getCharsetFromContentType(headers: HttpResponseHeader[]): string
}
export function isBaseEnvironment(environment: Environment): boolean {
return environment.parentId == null;
return environment.parentModel == 'workspace';
}
export function isSubEnvironment(environment: Environment): boolean {
+3 -3
View File
@@ -1,17 +1,17 @@
import type { Environment } from '@yaakapp-internal/models';
import { patchModel } from '@yaakapp-internal/models';
import { showDialog } from './dialog';
import { EnvironmentColorPicker } from '../components/EnvironmentColorPicker';
import { showDialog } from './dialog';
export function showColorPicker(environment: Environment) {
showDialog({
title: 'Environment Color',
id: 'color-picker',
size: 'dynamic',
size: 'sm',
render: ({ hide }) => {
return (
<EnvironmentColorPicker
color={environment.color ?? '#54dc44'}
color={environment.color}
onChange={async (color) => {
await patchModel(environment, { color });
hide();