feat(core): add styles for temp user in user menu

This commit is contained in:
alistair3149 2022-10-05 20:06:48 -04:00
parent bb27f801bd
commit 6ab486b82e
No known key found for this signature in database
2 changed files with 13 additions and 6 deletions

View file

@ -93,15 +93,20 @@ class SkinHooks implements
* @param array &$links * @param array &$links
*/ */
public function onSkinTemplateNavigation__Universal( $sktemplate, &$links ): void { public function onSkinTemplateNavigation__Universal( $sktemplate, &$links ): void {
$isRegistered = $sktemplate->getUser()->isRegistered(); $user = $sktemplate->getUser();
$isRegistered = $user->isRegistered();
$isTemp = $user->isTemp();
if ( $isRegistered ) { if ( $isTemp ) {
// Remove user page link from user menu and recreate it in user info // Remove temporary user page text from user menu and recreate it in user info
unset( $links['user-menu']['userpage'] ); unset( $links['user-menu']['tmpuserpage'] );
// Remove links as they are added to the bottom of user menu later // Remove links as they are added to the bottom of user menu later
// unset( $links['user-menu']['logout'] ); // unset( $links['user-menu']['logout'] );
} else if ( $isRegistered ) {
// Remove user page link from user menu and recreate it in user info
unset( $links['user-menu']['userpage'] );
} else { } else {
// Remove anonuserpage from user menu and recreate it in user info // Remove anon user page text from user menu and recreate it in user info
unset( $links['user-menu']['anonuserpage'] ); unset( $links['user-menu']['anonuserpage'] );
// Remove links as they are added to the bottom of user menu later // Remove links as they are added to the bottom of user menu later
// unset( $links['user-menu']['createaccount'] ); // unset( $links['user-menu']['createaccount'] );

View file

@ -67,6 +67,7 @@
#pt { #pt {
&-anonuserpage span, &-anonuserpage span,
&-tmpuserpage-2,
&-userpage-2 a { &-userpage-2 a {
padding: var( --space-xs ) 0; padding: var( --space-xs ) 0;
color: var( --color-base--emphasized ); color: var( --color-base--emphasized );
@ -77,6 +78,8 @@
&-user { &-user {
&groups { &groups {
margin-bottom: var( --space-sm );
ul { ul {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
@ -105,7 +108,6 @@
} }
&contris { &contris {
margin-top: var( --space-sm );
font-weight: 500; font-weight: 500;
} }
} }