Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(relay): update relay stuff #684

Merged
merged 2 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>


stavares843 marked this conversation as resolved.
Show resolved Hide resolved
<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
Loading