Skip to content

Commit

Permalink
feat(U257): chg header e role picker 20241206
Browse files Browse the repository at this point in the history
  • Loading branch information
lcucuzzella committed Dec 6, 2024
1 parent 4fa571c commit 10122fb
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 18 deletions.
21 changes: 11 additions & 10 deletions fe-piattaforma/src/components/CardProfile/cardProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,15 @@ const CardProfile: React.FC<CardProfileI> = (props) => {
!activeProfile && 'card-profile-container__opacity'
)}
>
<UserAvatar
{/* <UserAvatar
avatarImage={profilePicture}
user={{ uSurname: user?.cognome, uName: user?.nome }}
size={AvatarSizes.Small}
font={AvatarTextSizes.Small}
lightColor={device.mediaIsPhone}
/>
/> */}
</div>
) : (
<div className='spacing' />
)}
) : null}
<div>
<CardTitle className='mb-1 primary-color-a12 '>
<span
Expand All @@ -87,22 +85,25 @@ const CardProfile: React.FC<CardProfileI> = (props) => {
'switch-profile-titles'
)}
>
{profile?.descrizioneRuolo}
<b>{profile?.descrizioneRuolo}</b>
{device.mediaIsPhone && <br />}
{profile?.nomeEnte ? (
<em className='switch-profile-subs pr-1'>
{` "${profile?.nomeEnte}" `}
</em>
<div className='switch-profile-subs pr-1'>
{`Ente`} <em><b>{`${profile?.nomeEnte} `}</b></em>
</div>
) : null}
</span>
</CardTitle>
<CardText
<CardText
className={clsx(
activeProfile && 'primary-color-b7',
!activeProfile && 'neutral-2-color-a5',
'switch-profile-subs'
)}
>

{/* QUI VA PROGETTO O PROGRAMMA */}

{profile?.nomeProgramma}
{profile?.nomeProgettoBreve
? `, ${profile?.nomeProgettoBreve}`
Expand Down
2 changes: 1 addition & 1 deletion fe-piattaforma/src/components/Header/header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 185px;
max-width: 260px;

@media screen and (max-width: 767px) {
font-size: 14px !important;
Expand Down
26 changes: 22 additions & 4 deletions fe-piattaforma/src/components/Header/view/headerDesktop.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { memo, useState } from 'react';
import React, { memo, useEffect, useState } from 'react';
import clsx from 'clsx';
import { NavLink, useNavigate } from 'react-router-dom';
import {
Expand All @@ -25,6 +25,7 @@ import { defaultRedirectUrl } from '../../../routes';
import { NotificationsPreview } from '../../index';
import UserAvatar from '../../Avatar/UserAvatar/UserAvatar';
import { LogoutRedirect } from '../../../redux/features/user/userThunk';
import API from '../../../utils/apiHelper';

const HeaderDesktop: React.FC<HeaderI> = ({
isHeaderFull = true,
Expand Down Expand Up @@ -57,7 +58,24 @@ const HeaderDesktop: React.FC<HeaderI> = ({
},
];

console.log('USER PROFILE: ', userProfile);
const [profile, setProfile] = useState<any>(null);

useEffect(() => {
const fetchProfile = async () => {
if (userProfile?.idEnte) {
const response = await API.get(`/ente/${userProfile?.idEnte}`);
setProfile(response);
console.log('PROFILE: ', response);
}
};
fetchProfile();
}, [userProfile]);



const userDropDown = () => (

<Dropdown
className='p-0 header-container__top__user-dropdown position-relative'
isOpen={openUser}
Expand Down Expand Up @@ -103,12 +121,12 @@ const HeaderDesktop: React.FC<HeaderI> = ({
'user-description'
)}
>
<span className='h6 m-0 text-sans-serif'>
{/* <span className='h6 m-0 text-sans-serif'>
{user?.cognome}&nbsp;{user?.nome}
</span>
</span> */}
<span className='h6 font-weight-light text-nowrap pr-1'>
{/*<em>{getRoleLabel(userProfile?.codiceRuolo)}</em>*/}
<em>{`${userProfile?.descrizioneRuolo}${
<b>{`${userProfile?.descrizioneRuolo}`}</b><em>{`${
userProfile?.nomeEnte ? ` ${userProfile.nomeEnte}` : ''
}`}</em>
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
}
}

.spacing {
padding-left: 50px;
}
// .spacing {
// padding-left: 50px;
// }


.switch-profile-titles {
overflow: hidden;
text-overflow: ellipsis;
Expand Down

0 comments on commit 10122fb

Please sign in to comment.