fix(client): clean up nav menu (#40864)
This commit is contained in:
@ -1,23 +1,16 @@
|
||||
/* eslint-disable react/sort-prop-types */
|
||||
import React from 'react';
|
||||
import {
|
||||
Link,
|
||||
borderColorPicker,
|
||||
SkeletonSprite,
|
||||
AvatarRenderer
|
||||
} from '../../helpers';
|
||||
import { Link, borderColorPicker, AvatarRenderer } from '../../helpers';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import Login from '../components/Login';
|
||||
|
||||
const propTypes = {
|
||||
pending: PropTypes.bool,
|
||||
pathName: PropTypes.string.isRequired,
|
||||
user: PropTypes.object
|
||||
};
|
||||
|
||||
export function AuthOrProfile({ user, pathName, pending }) {
|
||||
export function AuthOrProfile({ user }) {
|
||||
const { t } = useTranslation();
|
||||
const isUserDonating = user && user.isDonating;
|
||||
const isUserSignedIn = user && user.username;
|
||||
@ -26,13 +19,7 @@ export function AuthOrProfile({ user, pathName, pending }) {
|
||||
|
||||
const badgeColorClass = borderColorPicker(isUserDonating, isTopContributor);
|
||||
|
||||
if (pending && pathName !== '/') {
|
||||
return (
|
||||
<div className='nav-skeleton'>
|
||||
<SkeletonSprite />
|
||||
</div>
|
||||
);
|
||||
} else if (pathName === '/' || !isUserSignedIn) {
|
||||
if (!isUserSignedIn) {
|
||||
return (
|
||||
<Login data-test-label='landing-small-cta'>{t('buttons.sign-in')}</Login>
|
||||
);
|
||||
|
Reference in New Issue
Block a user