add icon to public private toggle
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
interface Props {
|
interface Props {
|
||||||
name?: string;
|
name?: string;
|
||||||
|
icon?: string;
|
||||||
value?: boolean;
|
value?: boolean;
|
||||||
label?: string;
|
label?: string;
|
||||||
error?: string;
|
error?: string;
|
||||||
@@ -10,6 +11,7 @@
|
|||||||
|
|
||||||
let {
|
let {
|
||||||
name = "",
|
name = "",
|
||||||
|
icon = "",
|
||||||
value = $bindable(false),
|
value = $bindable(false),
|
||||||
label = "",
|
label = "",
|
||||||
error = "",
|
error = "",
|
||||||
@@ -23,7 +25,10 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label class="relative my-2 inline-flex items-center" class:cursor-pointer={!disabled}>
|
<label
|
||||||
|
class="relative my-2 inline-flex items-center"
|
||||||
|
class:cursor-pointer={!disabled}
|
||||||
|
>
|
||||||
<input
|
<input
|
||||||
{name}
|
{name}
|
||||||
bind:checked={value}
|
bind:checked={value}
|
||||||
@@ -38,6 +43,9 @@
|
|||||||
></div>
|
></div>
|
||||||
{#if label}
|
{#if label}
|
||||||
<span class="ms-3 text-sm font-medium">{label}</span>
|
<span class="ms-3 text-sm font-medium">{label}</span>
|
||||||
|
{#if icon.length}
|
||||||
|
<i class="fa fa-{icon} ml-2"></i>
|
||||||
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
|
|||||||
@@ -1084,7 +1084,7 @@
|
|||||||
></Select>
|
></Select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Toggle name="public" label={$_("public")}></Toggle>
|
<Toggle name="public" label={$formData.public ? $_("public") : $_("private")} icon={$formData.public ? "globe" : "lock"}></Toggle>
|
||||||
<hr class="border-separator" />
|
<hr class="border-separator" />
|
||||||
<h3 class="text-xl font-semibold">
|
<h3 class="text-xl font-semibold">
|
||||||
{$_("waypoints", { values: { n: 2 } })}
|
{$_("waypoints", { values: { n: 2 } })}
|
||||||
|
|||||||
Reference in New Issue
Block a user