mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-06 19:18:22 +01:00
fix color preview
This commit is contained in:
parent
65158febc4
commit
6a84d00b5e
@ -12,6 +12,7 @@ import "./background.less";
|
||||
|
||||
type BackgroundType = {
|
||||
label: string;
|
||||
color: string;
|
||||
click: () => void;
|
||||
};
|
||||
|
||||
@ -56,6 +57,7 @@ function Background({ model }: { model: BackgroundModel }) {
|
||||
}
|
||||
backgrounds.push({
|
||||
label: preset["display:name"] ?? presetName,
|
||||
color: preset["bg"] ?? "var(--main-bg-color)",
|
||||
click: () => {
|
||||
services.ObjectService.UpdateObjectMeta(oref, preset);
|
||||
},
|
||||
@ -69,7 +71,7 @@ function Background({ model }: { model: BackgroundModel }) {
|
||||
{backgrounds.map((bg, index) => {
|
||||
return (
|
||||
<div key={`${bg.label}-${index}`} className="bg-item" onClick={() => bg.click()}>
|
||||
<div className="bg-preview" style={{ backgroundColor: bg.label }}></div>
|
||||
<div className="bg-preview" style={{ background: bg.color }}></div>
|
||||
<div className="bg-label">{bg.label}</div>
|
||||
</div>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user