feat: New tag creation UI (#1014)

* feat: Update tag creation UI

* fix: remove unused target

* fix: remove connect/disconnect functions

* fix: remove unnecessary target
This commit is contained in:
Alessio Cappa
2026-02-19 19:55:10 +01:00
committed by GitHub
parent cfadff641f
commit 13c2335a6a
5 changed files with 37 additions and 10 deletions

View File

@@ -0,0 +1,18 @@
import { Controller } from "@hotwired/stimulus";
// Connects to data-controller="color-badge"
// Used by the transaction merchant form to show a preview of what the avatar will look like
export default class extends Controller {
static targets = ["name", "badge"];
handleNameChange = (e) => {
this.nameTarget.textContent = e.currentTarget.value || "?";
};
handleColorChange(e) {
const color = e.currentTarget.value;
this.badgeTarget.style.backgroundColor = `color-mix(in oklab, ${color} 10%, transparent)`;
this.badgeTarget.style.borderColor = `color-mix(in oklab, ${color} 10%, transparent)`;
this.badgeTarget.style.color = color;
}
}