Skip to content

Commit

Permalink
update relay stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
stavares843 committed Oct 7, 2024
1 parent e573ff6 commit a837836
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
34 changes: 19 additions & 15 deletions src/lib/components/ui/RelaySelector.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,19 @@

<div class="relay-selector">
<Label hook="label-relay" text={$_("settings.network.relay.title")} />
<Controls>
<Button
hook="button-relay-add"
class="relay-add"
appearance={Appearance.Success}
text={$_("generic.add")}
on:click={_ => {
adding = true
}}>
<Icon icon={Shape.Plus} />
</Button>
</Controls>

<div class="relay-content">
{#if adding || editing}
<Modal hook="modal-relay-add">
Expand Down Expand Up @@ -138,6 +151,7 @@
</div>
</Modal>
{/if}

{#each getRelays(relays) as [name, relay]}
<div class="relay-entry">
<div class="relay-info">
Expand Down Expand Up @@ -167,23 +181,23 @@
<Button
hook="button-relay-edit"
class="relay-edit"
icon
appearance={Appearance.Alt}
on:click={_ => {
editing = name
nameToAdd = name
relayToAdd = relay.address
}}>
}}
text={$_("generic.edit")}>
<Icon icon={Shape.Pencil} />
</Button>
<Button
hook="button-relay-delete"
icon
class="relay-delete"
appearance={Appearance.Error}
on:click={_ => {
deleteRelay(name)
}}>
}}
text={$_("generic.delete")}>
<Icon icon={Shape.Trash} />
</Button>
{/if}
Expand All @@ -199,17 +213,6 @@
<Spacer />

<Controls>
<Button
hook="button-relay-add"
class="relay-add"
appearance={Appearance.Alt}
text={$_("generic.add")}
on:click={_ => {
adding = true
}}>
<Icon icon={Shape.Plus} />
</Button>
<div class="filling"></div>
{#if changed}
<Button hook="button-relay-revert" icon class="revert" appearance={Appearance.Alt} tooltip={$_("generic.undo")} on:click={revert}>
<Icon icon={Shape.UTurn} />
Expand Down Expand Up @@ -244,6 +247,7 @@
</div>
</div>


<style lang="scss">
.relay-selector {
width: 100%;
Expand Down
1 change: 1 addition & 0 deletions src/lib/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"add": "Add",
"remove": "Remove",
"save": "Save",
"edit": "Edit",
"confirm": "Confirm",
"cancel": "Cancel",
"undo": "Undo",
Expand Down

0 comments on commit a837836

Please sign in to comment.