Add support for displaying avatar in navbar
This commit is contained in:
parent
ecb7bca9cd
commit
80d9e9404c
Binary file not shown.
After Width: | Height: | Size: 43 KiB |
|
@ -134,6 +134,7 @@ const username = Astro.cookies.get('username')?.value ?? "";
|
||||||
<li class="nav-item"><a href={element.url} class={`nav-url ${active === element.id ? "active" : ""}`}>{element.title}</a></li>
|
<li class="nav-item"><a href={element.url} class={`nav-url ${active === element.id ? "active" : ""}`}>{element.title}</a></li>
|
||||||
)}
|
)}
|
||||||
<li class="nav-item"><span class="nav-username nav-keep-right">{username}</span></li>
|
<li class="nav-item"><span class="nav-username nav-keep-right">{username}</span></li>
|
||||||
|
{loggedIn === "true" ? <li class="nav-item"><img src="/gargamel.png" class="avatar-icon" /></li> : ""}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -190,10 +191,20 @@ nav ul {
|
||||||
|
|
||||||
.nav-keep-right {
|
.nav-keep-right {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 20px;
|
right: 80px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.active {
|
.active {
|
||||||
color: lime;
|
color: lime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.avatar-icon {
|
||||||
|
/* object-fit: contain; */
|
||||||
|
/* width: 100%; */
|
||||||
|
height: 50px;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 1px solid white;
|
||||||
|
position: absolute;
|
||||||
|
right: 13px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
|
@ -4,7 +4,7 @@ if(Astro.cookies.has('sessionToken')) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Astro.cookies.has('username')) {
|
if(Astro.cookies.has('username')) {
|
||||||
Astro.cookies.delete('uesrname');
|
Astro.cookies.delete('username');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Astro.cookies.has('userid')) {
|
if(Astro.cookies.has('userid')) {
|
||||||
|
|
Loading…
Reference in New Issue