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
*/
public function onSkinTemplateNavigation__Universal( $sktemplate, &$links ): void {
$isRegistered = $sktemplate->getUser()->isRegistered();
$user = $sktemplate->getUser();
$isRegistered = $user->isRegistered();
$isTemp = $user->isTemp();
if ( $isRegistered ) {
// Remove user page link from user menu and recreate it in user info
unset( $links['user-menu']['userpage'] );
if ( $isTemp ) {
// Remove temporary user page text from user menu and recreate it in user info
unset( $links['user-menu']['tmpuserpage'] );
// Remove links as they are added to the bottom of user menu later
// 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 {
// 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'] );
// Remove links as they are added to the bottom of user menu later
// unset( $links['user-menu']['createaccount'] );

View file

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