mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-11-29 11:42:56 +01:00
Environment colors (#225)
This commit is contained in:
1 parent
27901231dc
commit
d0fde99b1c
19 files changed
+182
-25
No files matched your search
@@ -0,0 +1,23 @@
|
||||
import type { Environment } from '@yaakapp-internal/models';
|
||||
import { patchModel } from '@yaakapp-internal/models';
|
||||
import { showDialog } from './dialog';
|
||||
import { EnvironmentColorPicker } from '../components/EnvironmentColorPicker';
|
||||
|
||||
export function showColorPicker(environment: Environment) {
|
||||
showDialog({
|
||||
title: 'Environment Color',
|
||||
id: 'color-picker',
|
||||
size: 'dynamic',
|
||||
render: ({ hide }) => {
|
||||
return (
|
||||
<EnvironmentColorPicker
|
||||
color={environment.color ?? '#54dc44'}
|
||||
onChange={async (color) => {
|
||||
await patchModel(environment, { color });
|
||||
hide();
|
||||
}}
|
||||
/>
|
||||
);
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user