Skip to content

Commit

Permalink
feat(profiles): remove profiles from the web app
Browse files Browse the repository at this point in the history
  • Loading branch information
borkopetrovicc authored Jun 12, 2024
1 parent 3d1cbf1 commit e507314
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions packages/ui-react/src/containers/HeaderUserMenu/HeaderUserMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ import { useUIStore } from '@jwp/ott-common/src/stores/UIStore';
import { useConfigStore } from '@jwp/ott-common/src/stores/ConfigStore';
import { useAccountStore } from '@jwp/ott-common/src/stores/AccountStore';
import { ACCESS_MODEL } from '@jwp/ott-common/src/constants';
import { useProfiles, useSelectProfile } from '@jwp/ott-hooks-react/src/useProfiles';
import { PATH_HOME, PATH_USER_PROFILES } from '@jwp/ott-common/src/paths';
import { useLocation, useNavigate } from 'react-router';
import { useProfileStore } from '@jwp/ott-common/src/stores/ProfileStore';

import UserMenu from '../../components/UserMenu/UserMenu';
import useBreakpoint, { Breakpoint } from '../../hooks/useBreakpoint';
Expand All @@ -26,17 +23,6 @@ const HeaderUserMenu = () => {
accessModel: state.accessModel,
}));
const isLoggedIn = useAccountStore(({ user }) => !!user);
const { profile } = useProfileStore();

const {
query: { data: { collection: profiles = [] } = {} },
profilesEnabled,
} = useProfiles();

const selectProfile = useSelectProfile({
onSuccess: () => navigate(PATH_HOME),
onError: () => navigate(PATH_USER_PROFILES),
});

const favoritesEnabled = !!features?.favoritesList;
const canLogin = accessModel !== ACCESS_MODEL.AVOD;
Expand All @@ -58,11 +44,11 @@ const HeaderUserMenu = () => {
favoritesEnabled={favoritesEnabled}
onLoginButtonClick={loginButtonClickHandler}
onSignUpButtonClick={signUpButtonClickHandler}
profilesEnabled={profilesEnabled}
profile={profile}
profiles={profiles}
profileLoading={selectProfile.isLoading}
onSelectProfile={selectProfile.mutate}
profilesEnabled={false}
profile={null}
profiles={[]}
profileLoading={false}
onSelectProfile={() => {}}
/>
);
};
Expand Down

0 comments on commit e507314

Please sign in to comment.