diff --git a/packages/webapp/components/layouts/AccountLayout/SidebarNav.tsx b/packages/webapp/components/layouts/AccountLayout/SidebarNav.tsx index 1dfac0c0c6..eb8cf72582 100644 --- a/packages/webapp/components/layouts/AccountLayout/SidebarNav.tsx +++ b/packages/webapp/components/layouts/AccountLayout/SidebarNav.tsx @@ -1,20 +1,15 @@ import type { ReactElement } from 'react'; -import React, { useCallback, useContext, useEffect, useMemo } from 'react'; +import React, { useCallback, useEffect } from 'react'; import { useQuery, useQueryClient } from '@tanstack/react-query'; import classNames from 'classnames'; -import AuthContext from '@dailydotdev/shared/src/contexts/AuthContext'; +import { useAuthContext } from '@dailydotdev/shared/src/contexts/AuthContext'; import CloseButton from '@dailydotdev/shared/src/components/CloseButton'; import { disabledRefetch } from '@dailydotdev/shared/src/lib/func'; import { useRouter } from 'next/router'; import { isTouchDevice } from '@dailydotdev/shared/src/lib/tooltip'; -import Link from '@dailydotdev/shared/src/components/utilities/Link'; import SidebarNavItem from './SidebarNavItem'; -import { - AccountPage, - accountPage, - accountSidebarPages, - AccountSidebarPagesSection, -} from './common'; +import type { AccountPage } from './common'; +import { accountPage } from './common'; interface SidebarNavProps { className?: string; @@ -38,19 +33,7 @@ function SidebarNav({ queryFn: () => false, ...disabledRefetch, }); - const { user, isGdprCovered } = useContext(AuthContext); - - const keys = useMemo( - () => - pageKeys.filter((key) => { - if (key === AccountPage.Privacy) { - return isGdprCovered; - } - - return true; - }), - [isGdprCovered], - ); + const { user } = useAuthContext(); useEffect(() => { if (!isTouchDevice()) { @@ -84,7 +67,7 @@ function SidebarNav({
- {keys.map((key) => { + {pageKeys.map((key) => { const href = `/${basePath}${accountPage[key].href}`; const isActive = globalThis?.window?.location.pathname === href; @@ -98,24 +81,6 @@ function SidebarNav({ /> ); })} - {!isGdprCovered && ( - - {accountSidebarPages.map((accountSidebarPage) => ( - - - {accountSidebarPage.title} - - - ))} - - )}
); diff --git a/packages/webapp/components/layouts/AccountLayout/common.tsx b/packages/webapp/components/layouts/AccountLayout/common.tsx index a0da6eb8e1..86e7fa4635 100644 --- a/packages/webapp/components/layouts/AccountLayout/common.tsx +++ b/packages/webapp/components/layouts/AccountLayout/common.tsx @@ -15,13 +15,6 @@ import classed from '@dailydotdev/shared/src/lib/classed'; import type { LoggedUser } from '@dailydotdev/shared/src/lib/user'; import type { ReactNode } from 'react'; import React from 'react'; -import { - faq, - privacyPolicy, - reportIssue, - requestFeature, - termsOfService, -} from '@dailydotdev/shared/src/lib/constants'; export interface ManageSocialProvidersProps { type: ManageSocialProviderTypes; @@ -58,39 +51,6 @@ export enum AccountSecurityDisplay { ConnectEmail = 'connect_email', } -interface AccountSidebarPage { - title: string; - href: string; - target: string; -} -export const accountSidebarPages: AccountSidebarPage[] = [ - { - title: 'FAQ', - href: faq, - target: '_blank', - }, - { - title: 'Request a feature', - href: requestFeature, - target: '_blank', - }, - { - title: 'Report an issue', - href: reportIssue, - target: '_blank', - }, - { - title: 'Privacy policy', - href: privacyPolicy, - target: '_blank', - }, - { - title: 'Terms of service', - href: termsOfService, - target: '_blank', - }, -]; - export const accountPage: Record = { profile: { title: 'Profile',