update Header
This commit is contained in:
parent
d056493014
commit
e5bc75c60e
@ -4,6 +4,10 @@ const nextConfig = {
|
|||||||
compiler: {
|
compiler: {
|
||||||
styledComponents: true,
|
styledComponents: true,
|
||||||
},
|
},
|
||||||
|
images: {
|
||||||
|
domains: ["kluppdevelopment.s3.sa-east-1.amazonaws.com"]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = nextConfig
|
module.exports = nextConfig
|
||||||
|
|
||||||
|
|||||||
@ -27,22 +27,22 @@ function stringToColor(string: string) {
|
|||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
function stringAvatar(name: string) {
|
function stringAvatar(profile_picture: string) {
|
||||||
return {
|
return {
|
||||||
sx: {
|
|
||||||
bgcolor: stringToColor(name),
|
children: `${profile_picture}`,
|
||||||
},
|
|
||||||
children: `${name.split(' ')[0][0]}`,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
interface headerInterface {
|
interface headerInterface {
|
||||||
name: string,
|
name: string,
|
||||||
admin?: boolean | undefined
|
admin?: boolean | undefined
|
||||||
logo?: string
|
logo?: string
|
||||||
|
profile_picture: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Header({ name, admin, logo }: headerInterface) {
|
export default function Header({ name, admin, profile_picture }: headerInterface) {
|
||||||
return (
|
return (
|
||||||
<HeaderView>
|
<HeaderView>
|
||||||
<section>
|
<section>
|
||||||
@ -60,7 +60,13 @@ export default function Header({ name, admin, logo }: headerInterface) {
|
|||||||
olá, {name}
|
olá, {name}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<Avatar {...stringAvatar(name)} style={{border: 'white solid 4px', width: '47px', height: '47px'}}/>
|
{
|
||||||
|
!admin?
|
||||||
|
<Image src={profile_picture} alt='teste' height={45} width={50} />
|
||||||
|
:
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
</HeaderView>
|
</HeaderView>
|
||||||
)
|
)
|
||||||
|
|||||||
@ -28,12 +28,10 @@ export const HeaderView = styled.header`
|
|||||||
min-width: 120px;
|
min-width: 120px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
|
|
||||||
border-radius: 8px 0 0 8px;
|
border-radius: 8px;
|
||||||
|
|
||||||
background-color: #254F7F;
|
background-color: #254F7F;
|
||||||
|
|
||||||
transform: translateX(16px);
|
|
||||||
|
|
||||||
p{
|
p{
|
||||||
color: white;
|
color: white;
|
||||||
margin-left: 15%;
|
margin-left: 15%;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user