settings: Update remove/unsubscribe buttons to action button component.

This commit updates the remove and unsubscribe buttons in channel
settings and user group settings to use the action button component.
This commit is contained in:
Sayam Samal
2025-03-22 08:52:30 +05:30
committed by Tim Abbott
parent 703acbaccc
commit 91549cfba0
5 changed files with 12 additions and 35 deletions

View File

@@ -466,8 +466,8 @@ export function initialize(): void {
});
$("#channels_overlay_container").on(
"submit",
".edit_subscribers_for_stream .subscriber_list_remove form",
"click",
".edit_subscribers_for_stream .remove-subscriber-button",
function (this: HTMLElement, e): void {
e.preventDefault();

View File

@@ -509,8 +509,8 @@ export function initialize(): void {
});
$("#groups_overlay_container").on(
"submit",
".edit_members_for_user_group .subscriber_list_remove form",
"click",
".edit_members_for_user_group .remove-subscriber-button",
function (this: HTMLElement, e): void {
e.preventDefault();
@@ -523,8 +523,8 @@ export function initialize(): void {
);
$("#groups_overlay_container").on(
"submit",
".edit_members_for_user_group .subgroup_list_remove form",
"click",
".edit_members_for_user_group .remove-subgroup-button",
function (this: HTMLElement, e): void {
e.preventDefault();

View File

@@ -178,12 +178,6 @@ h4.user_group_setting_subsection_title {
}
}
.subscriber_list_remove,
.subgroup-list-remove {
padding-right: 16px;
display: inline-block;
}
& thead th {
&:first-of-type {
border-top-left-radius: 4px;
@@ -274,11 +268,6 @@ h4.user_group_setting_subsection_title {
display: inline;
}
.remove-subscriber-form,
.remove-subgroup-form {
margin: 0;
}
.subscriptions-container .subscriptions-header .fa-chevron-left,
.user-groups-container .user-groups-header .fa-chevron-left {
position: relative;

View File

@@ -9,17 +9,11 @@
{{/if}}
{{#if can_remove_subscribers}}
<td class="unsubscribe">
<div class="subscriber_list_remove">
<form class="remove-subscriber-form">
<button type="submit" name="unsubscribe" class="remove-subscriber-button button small rounded button-danger">
{{#if for_user_group_members}}
{{t 'Remove'}}
{{else}}
{{t 'Unsubscribe' }}
{{/if}}
</button>
</form>
</div>
{{#if for_user_group_members}}
{{> ../components/action_button label=(t "Remove") custom_classes="remove-subscriber-button" attention="quiet" intent="danger" aria-label=(t "Remove") }}
{{else}}
{{> ../components/action_button label=(t "Unsubscribe") custom_classes="remove-subscriber-button" attention="quiet" intent="danger" aria-label=(t "Unsubscribe") }}
{{/if}}
</td>
{{/if}}
</tr>

View File

@@ -5,13 +5,7 @@
<td class="empty-email-col-for-user-group"></td>
{{#if can_remove_members}}
<td class="remove">
<div class="subgroup_list_remove">
<form class="remove-subgroup-form">
<button type="submit" name="remove" class="remove-subgroup-button button small rounded button-danger">
{{t 'Remove'}}
</button>
</form>
</div>
{{> ../components/action_button custom_classes="remove-subgroup-button" label=(t "Remove") attention="quiet" intent="danger" aria-label=(t "Remove") }}
</td>
{{/if}}
</tr>