mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
user_profile_modal: Update add and subscribe button to action buttons.
This commit updates the add and subscribe button in the user profile modal to use the action button component. Fixes part of #33027.
This commit is contained in:
@@ -54,6 +54,7 @@ import * as subscriber_api from "./subscriber_api.ts";
|
|||||||
import * as timerender from "./timerender.ts";
|
import * as timerender from "./timerender.ts";
|
||||||
import type {HTMLSelectOneElement} from "./types.ts";
|
import type {HTMLSelectOneElement} from "./types.ts";
|
||||||
import * as ui_report from "./ui_report.ts";
|
import * as ui_report from "./ui_report.ts";
|
||||||
|
import * as ui_util from "./ui_util.ts";
|
||||||
import type {UploadWidget} from "./upload_widget.ts";
|
import type {UploadWidget} from "./upload_widget.ts";
|
||||||
import * as user_deactivation_ui from "./user_deactivation_ui.ts";
|
import * as user_deactivation_ui from "./user_deactivation_ui.ts";
|
||||||
import * as user_group_edit_members from "./user_group_edit_members.ts";
|
import * as user_group_edit_members from "./user_group_edit_members.ts";
|
||||||
@@ -233,19 +234,13 @@ function change_state_of_subscribe_button(
|
|||||||
assert(user_profile_subscribe_widget !== undefined);
|
assert(user_profile_subscribe_widget !== undefined);
|
||||||
user_profile_subscribe_widget.render();
|
user_profile_subscribe_widget.render();
|
||||||
const $subscribe_button = $("#user-profile-modal .add-subscription-button");
|
const $subscribe_button = $("#user-profile-modal .add-subscription-button");
|
||||||
const $element: (tippy.ReferenceElement & HTMLElement) | undefined =
|
ui_util.enable_element_and_remove_tooltip($subscribe_button);
|
||||||
$subscribe_button.parent()[0];
|
|
||||||
assert($element !== undefined);
|
|
||||||
$element._tippy?.destroy();
|
|
||||||
$subscribe_button.prop("disabled", false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function reset_subscribe_widget(): void {
|
function reset_subscribe_widget(): void {
|
||||||
$("#user-profile-modal .add-subscription-button").prop("disabled", true);
|
ui_util.disable_element_and_add_tooltip(
|
||||||
settings_components.initialize_disable_button_hint_popover(
|
$("#user-profile-modal .add-subscription-button"),
|
||||||
$("#user-profile-modal .add-subscription-button-wrapper"),
|
|
||||||
$t({defaultMessage: "Select a channel to subscribe"}),
|
$t({defaultMessage: "Select a channel to subscribe"}),
|
||||||
{},
|
|
||||||
);
|
);
|
||||||
$("#user_profile_subscribe_widget .dropdown_widget_value").text(
|
$("#user_profile_subscribe_widget .dropdown_widget_value").text(
|
||||||
$t({defaultMessage: "Select a channel"}),
|
$t({defaultMessage: "Select a channel"}),
|
||||||
|
@@ -1554,7 +1554,3 @@ ul.popover-menu-list {
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.add-groups-button-wrapper {
|
|
||||||
flex: 0 0 auto;
|
|
||||||
}
|
|
||||||
|
@@ -146,11 +146,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="add-groups-button-wrapper">
|
{{> components/action_button label=(t "Add") custom_classes="add-groups-button" attention="quiet" intent="brand" aria-label=(t "Add") }}
|
||||||
<button type="button" name="subscribe" class="add-groups-button button small rounded">
|
|
||||||
{{t 'Add' }}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<div class="group-list-top-section">
|
<div class="group-list-top-section">
|
||||||
|
@@ -1,8 +1,4 @@
|
|||||||
<div class="user_profile_subscribe_widget">
|
<div class="user_profile_subscribe_widget">
|
||||||
{{> dropdown_widget widget_name="user_profile_subscribe"}}
|
{{> dropdown_widget widget_name="user_profile_subscribe"}}
|
||||||
<div class="add-subscription-button-wrapper">
|
{{> components/action_button label=(t "Subscribe") custom_classes="add-subscription-button" attention="quiet" intent="brand" aria-label=(t "Subscribe") }}
|
||||||
<button type="button" name="subscribe" class="add-subscription-button button small rounded">
|
|
||||||
{{t 'Subscribe' }}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user