add referrals levels
This commit is contained in:
@@ -5,7 +5,9 @@ import { usePathname } from 'next/navigation';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import { useSideMenuStore } from '@/app/stores/sideMenuStore';
|
||||
|
||||
export default function DropDownList() {
|
||||
export default function DropDownList(
|
||||
{ referralLink }: { referralLink: string | null }
|
||||
) {
|
||||
const pathname = usePathname().replace('/en/', '/').replace('/ru/', '/');
|
||||
const [dropDownExpanded, setDropDownExpanded] = useState(false);
|
||||
const t = useTranslations('Global');
|
||||
@@ -17,19 +19,19 @@ export default function DropDownList() {
|
||||
|
||||
const links = [
|
||||
{
|
||||
name: t('photo-marking'),
|
||||
name: 'photo-marking',
|
||||
href: '/pages/marking-images'
|
||||
},
|
||||
{
|
||||
name: t('video-marking'),
|
||||
name: 'video-marking',
|
||||
href: '/pages/marking-video'
|
||||
},
|
||||
{
|
||||
name: t('audio-marking'),
|
||||
name: 'audio-marking',
|
||||
href: '/pages/marking-audio'
|
||||
},
|
||||
{
|
||||
name: t('document-marking'),
|
||||
name: 'document-marking',
|
||||
href: '/pages/marking-document'
|
||||
}
|
||||
];
|
||||
@@ -54,6 +56,9 @@ export default function DropDownList() {
|
||||
</div>
|
||||
<ul className={`sub-menu ${dropDownExpanded ? 'expanded' : ''}`}>
|
||||
{links.map((link) => {
|
||||
if (referralLink && link.name === 'document-marking') {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<Link
|
||||
key={link.name}
|
||||
@@ -68,7 +73,7 @@ export default function DropDownList() {
|
||||
setMenuState(false)
|
||||
}}
|
||||
>
|
||||
<p className="">{link.name}</p>
|
||||
<p className="">{t(link.name)}</p>
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -26,7 +26,11 @@ export default function NavLinks() {
|
||||
return fetchReferralUserStats();
|
||||
},
|
||||
select: (data) => {
|
||||
return data?.referralLink;
|
||||
if (data?.referralLink) {
|
||||
return data?.referralLink;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -83,7 +87,7 @@ export default function NavLinks() {
|
||||
<p className="">{t('home')}</p>
|
||||
</Link>
|
||||
|
||||
<DropDownList />
|
||||
<DropDownList referralLink={referralLink} />
|
||||
|
||||
{links.map((link) => {
|
||||
if (!referralLink && link.name === 'referral-program') {
|
||||
|
||||
Reference in New Issue
Block a user