mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-11-28 19:22:39 +01:00
Better environment color picker (#282)
This commit is contained in:
1 parent
923b1ac830
commit
3f5b5a397c
10 files changed
+233
-64
No files matched your search
@@ -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