Refactor: Create UserLinks component

Have a single template for the UserLinks component, with a single
element wrapping all its subcomponents as discussed.

Change-Id: I35936a6fa1ba335639ca3f47fd439a3662268fca
This commit is contained in:
jdlrobson 2021-05-24 15:02:26 -07:00 committed by Jdlrobson
parent 3306124038
commit 96bf1e8276
4 changed files with 15 additions and 12 deletions

View File

@ -11,20 +11,12 @@
</label>
{{>Logo}}
{{#data-search-box}}{{>SearchBox}}{{/data-search-box}}
{{#data-portlets}}
{{^is-consolidated-user-links}}
{{#data-portlets}}
{{#data-personal}}{{>Menu}}{{/data-personal}}
{{/data-portlets}}
{{#data-personal}}{{>Menu}}{{/data-personal}}
{{/is-consolidated-user-links}}
{{#is-consolidated-user-links}}
{{#data-portlets}}
{{#data-notifications}}{{>Menu}}{{/data-notifications}}
{{/data-portlets}}
{{#data-portlets}}
{{#data-user-page}}{{>Menu}}{{/data-user-page}}
{{/data-portlets}}
{{#data-portlets}}
{{#data-user-menu}}{{>Menu}}{{/data-user-menu}}
{{/data-portlets}}
{{>UserLinks}}
{{/is-consolidated-user-links}}
{{/data-portlets}}
</header>

View File

@ -0,0 +1,5 @@
<div class="vector-user-links">
{{#data-notifications}}{{>Menu}}{{/data-notifications}}
{{#data-user-page}}{{>Menu}}{{/data-user-page}}
{{#data-user-menu}}{{>Menu}}{{/data-user-menu}}
</div>

View File

@ -0,0 +1,5 @@
// This import can be removed when $wgVectorConsolidateUserLinks feature flag is removed.
.vector-user-links {
display: flex;
}

View File

@ -18,6 +18,7 @@
// This import can be removed when $wgVectorConsolidateUserLinks feature flag is removed.
@import '../skins.vector.styles.legacy/components/UserMenu.less';
@import './components/UserMenu.less';
@import './components/UserLinks.less';
}
@media all {