@@ -96,7 +96,7 @@ const InfoBar: React.FC = ({ title, device }) => { await i18n.changeLanguage(newLang) } - const { email, first_name, last_name, profile_picture_link } = useAppSelector((state) => state.user) + const { email, first_name, last_name, profile_picture_link, account_type } = useAppSelector((state) => state.user) const dispatch = useAppDispatch() @@ -355,17 +355,21 @@ const InfoBar: React.FC = ({ title, device }) => { - - - router.push('/account?scope=referral')}> - {''} - - {' '} - Рефералам{' '} - - - - + + {account_type === 'regular' && ( + + + router.push('/account?scope=referral')}> + {''} + + {' '} + Рефералам{' '} + + + + + )} + router.push('/account?scope=subscribe')}> @@ -68,7 +68,6 @@ export async function getServerSideProps(context: any): Promise<{ props: IAccoun }, } } - return { props: { device, @@ -348,6 +347,9 @@ const Account: React.FC = ({ device, token, plans }) => { if (!desktop && el.scope === 'business') { return null } + if (el.scope === 'referral' && account_type !== 'regular') { + return null + } return ( = ({ device, token, plans }) => { ) : scope === 'subscribe' ? ( - ) : ( + ) : scope === 'referral' && account_type === 'regular' ? ( + ) : ( + <> )} @@ -37,7 +37,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext): Pr } export const Main: React.FC = ({ deviceType }) => { - const { first_name } = useAppSelector((state) => state.user) + const { first_name, account_type } = useAppSelector((state) => state.user) const [, setCookie] = useCookies() @@ -60,7 +60,7 @@ export const Main: React.FC = ({ deviceType }) => { {/**/} - + {account_type === 'regular' && } Полезная статья