diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx index 0a45024ba..c74765513 100644 --- a/src/components/Header/Header.tsx +++ b/src/components/Header/Header.tsx @@ -22,7 +22,6 @@ import Panel from '#components/Panel/Panel'; import type { Profile } from '#types/account'; import ProfileCircle from '#src/icons/ProfileCircle'; import type { AccessModel } from '#types/Config'; -import defaultAvatar from '#src/assets/profiles/default_avatar.png'; type TypeHeader = 'static' | 'fixed'; @@ -50,12 +49,15 @@ type Props = { supportedLanguages: LanguageDefinition[]; currentLanguage: LanguageDefinition | undefined; onLanguageClick: (code: string) => void; - currentProfile?: Profile; - profiles?: Profile[]; - profilesEnabled?: boolean; - selectProfile?: UseMutateFunction; - isSelectingProfile?: boolean; + accessModel?: AccessModel; + profilesData?: { + currentProfile?: Profile; + profiles?: Profile[]; + profilesEnabled?: boolean; + selectProfile?: UseMutateFunction; + isSelectingProfile?: boolean; + }; }; const Header: React.FC = ({ @@ -82,12 +84,8 @@ const Header: React.FC = ({ supportedLanguages, currentLanguage, onLanguageClick, - currentProfile, - profiles, - profilesEnabled, - selectProfile, - isSelectingProfile, accessModel, + profilesData: { currentProfile, profiles, profilesEnabled, selectProfile, isSelectingProfile } = {}, }) => { const { t } = useTranslation('menu'); const [logoLoaded, setLogoLoaded] = useState(false); @@ -138,7 +136,7 @@ const Header: React.FC = ({ return isLoggedIn ? ( - + diff --git a/src/components/ProfileBox/ProfileBox.tsx b/src/components/ProfileBox/ProfileBox.tsx index ff04d8727..00934e27d 100644 --- a/src/components/ProfileBox/ProfileBox.tsx +++ b/src/components/ProfileBox/ProfileBox.tsx @@ -7,7 +7,6 @@ import styles from './ProfileBox.module.scss'; import Edit from '#src/icons/Edit'; import Check from '#src/icons/Check'; import IconButton from '#components/IconButton/IconButton'; -import defaultAvatar from '#src/assets/profiles/default_avatar.png'; type Props = { name?: string; @@ -27,7 +26,7 @@ const ProfileBox = ({ name, image, editMode = false, onClick, onEdit, selected =
- +
{editMode && ( diff --git a/src/components/UserMenu/ProfilesMenu/ProfilesMenu.tsx b/src/components/UserMenu/ProfilesMenu/ProfilesMenu.tsx index ffa3647aa..fbc3635d7 100644 --- a/src/components/UserMenu/ProfilesMenu/ProfilesMenu.tsx +++ b/src/components/UserMenu/ProfilesMenu/ProfilesMenu.tsx @@ -15,7 +15,6 @@ type ProfilesMenuProps = { small?: boolean; selectingProfile: boolean; selectProfile: UseMutateFunction; - defaultAvatar: string; createButtonLabel?: string; switchProfilesLabel?: string; onCreateButtonClick: () => void; @@ -27,7 +26,6 @@ const ProfilesMenu = ({ small, selectingProfile, selectProfile, - defaultAvatar, createButtonLabel, switchProfilesLabel, onCreateButtonClick, @@ -46,7 +44,7 @@ const ProfilesMenu = ({ small={small} onClick={() => selectProfile({ id: profile.id, avatarUrl: profile.avatar_url })} label={profile.name} - startIcon={} + startIcon={} /> )) diff --git a/src/components/UserMenu/UserMenu.tsx b/src/components/UserMenu/UserMenu.tsx index b9a2a7bcf..e0faff683 100644 --- a/src/components/UserMenu/UserMenu.tsx +++ b/src/components/UserMenu/UserMenu.tsx @@ -16,7 +16,6 @@ import { logout } from '#src/stores/AccountController'; import ProfileCircle from '#src/icons/ProfileCircle'; import type { AccessModel } from '#types/Config'; import type { Profile } from '#types/account'; -import defaultAvatar from '#src/assets/profiles/default_avatar.png'; type Props = { small?: boolean; @@ -62,7 +61,6 @@ const UserMenu = ({ small={small} selectingProfile={!!isSelectingProfile} selectProfile={selectProfile} - defaultAvatar={defaultAvatar} createButtonLabel={t('nav.add_profile')} switchProfilesLabel={t('nav.switch_profiles')} onCreateButtonClick={() => navigate('/u/profiles/create')} @@ -76,7 +74,7 @@ const UserMenu = ({ onClick={onClick} to={`/u/my-profile/${currentProfile?.id ?? ''}`} label={t('nav.profile')} - startIcon={} + startIcon={} /> )} diff --git a/src/containers/Layout/Layout.tsx b/src/containers/Layout/Layout.tsx index 3d392746a..21eecc493 100644 --- a/src/containers/Layout/Layout.tsx +++ b/src/containers/Layout/Layout.tsx @@ -153,12 +153,14 @@ const Layout = () => { closeLanguageMenu={closeLanguageMenu} canLogin={!!clientId} showPaymentsMenuItem={accessModel !== 'AVOD'} - currentProfile={profile ?? undefined} - profiles={profiles} - profilesEnabled={profilesEnabled} - selectProfile={selectProfile.mutate} - isSelectingProfile={!!selectProfile.isLoading} accessModel={accessModel} + profilesData={{ + currentProfile: profile ?? undefined, + profiles, + profilesEnabled, + selectProfile: selectProfile.mutate, + isSelectingProfile: !!selectProfile.isLoading, + }} >