mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-30 14:12:07 +02:00
Better environment color picker (#282)
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user