Add warning box

This commit is contained in:
Luc Mcgrady 2025-10-03 23:32:28 +01:00
parent f7b857887d
commit d8fcc44fe5
No known key found for this signature in database
GPG key ID: 4F3D7A0B17CC3D9C

View file

@ -5,6 +5,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<script lang="ts">
import { tick } from "svelte";
import * as tr from "@generated/ftl";
import Warning from "./Warning.svelte";
export let value: number[];
@ -50,10 +51,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
let clickCount = 0;
function onClick() {
clickCount += 1;
if (clickCount == UNLOCK_EDIT_COUNT) {
alert(tr.deckConfigManualParameterEditWarning());
}
}
$: unlockEditWarning =
clickCount >= UNLOCK_EDIT_COUNT
? tr.deckConfigManualParameterEditWarning()
: "";
</script>
<svelte:window onresize={updateHeight} />
@ -71,6 +74,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
></textarea>
</div>
<Warning warning={unlockEditWarning} className="alert-danger"></Warning>
<style>
textarea {
resize: none;