Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

modals: Add support for tab switcher in modal header.

Sayam Samal8e2217746fd0
diff --git a/web/src/user_profile.ts b/web/src/user_profile.ts
index 9f3a3e01d5d..2deefacedf0 100644
--- a/web/src/user_profile.ts
+++ b/web/src/user_profile.ts
@@ -815,7 +815,8 @@ export function show_user_profile(user: User, default_tab_key = "profile-tab"):
toggler = components.toggle(opts);
const $elem = toggler.get();
$elem.addClass("large allow-overflow");
- $("#tab-toggle").append($elem);
+ const $tab_switcher_container = $("#user-profile-modal .modal__tab-switcher-container");
+ $tab_switcher_container.append($elem);
setTimeout(() => {
$(".ind-tab.selected").trigger("focus");
}, 0);
diff --git a/web/styles/modal.css b/web/styles/modal.css
index 0717852e9d4..a79eb635335 100644
--- a/web/styles/modal.css
+++ b/web/styles/modal.css
@@ -72,6 +72,7 @@
grid-template:
". modal-header-content modal-close-button modal-close-button" 2.75em /* 44px at 16px/1em */
". modal-header-content . ." minmax(0, auto)
+ ". modal-tab-switcher modal-tab-switcher ." minmax(0, auto)
/ 1em minmax(0, 1fr) minmax(0, auto) 1em; /* 16px at 16px/1em */
background-color: var(--color-background-modal-bar);
@@ -250,6 +251,12 @@
color: hsl(0deg 0% 100%) !important;
}
+.modal__tab-switcher-container {
+ grid-area: modal-tab-switcher;
+ font-weight: initial;
+ padding-bottom: 0.5em; /* 8px at 16px/1em */
+}
+
/* Modal-specific CSS belongs below this point. */
#user-profile-modal {
@@ -257,11 +264,6 @@
height: var(--user-profile-modal-height);
}
- #tab-toggle {
- font-weight: initial;
- padding: 0 16px 6px;
- }
-
.name {
color: var(--color-user-profile-field-name);
font-weight: 600;
diff --git a/web/templates/user_profile_modal.hbs b/web/templates/user_profile_modal.hbs
index 2b2052ec904..132e4060051 100644
--- a/web/templates/user_profile_modal.hbs
+++ b/web/templates/user_profile_modal.hbs
@@ -37,9 +37,9 @@
</span>
</h1>
</div>
+ <div class="modal__tab-switcher-container"></div>
{{> components/icon_button icon="close" intent="neutral" custom_classes="modal__close" aria-label=(t 'Close modal') data-micromodal-close=true }}
</div>
- <div id="tab-toggle"></div>
<main class="modal__content" data-simplebar data-simplebar-tab-index="-1" data-simplebar-auto-hide="false">
<div class="tab-data">
<div class="tabcontent active" id="profile-tab">