Skip to content

Commit

Permalink
logout
Browse files Browse the repository at this point in the history
  • Loading branch information
Arejula11 committed Apr 4, 2024
1 parent 3f737df commit ec30464
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 75 deletions.
2 changes: 1 addition & 1 deletion playbeat/src/components/Header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ import FlechaIzqHeader from "@/icons/FlechaIzqHeader.astro";
</button>
</div>
<a href="/myUser">
<button class="bg-black w-8 h-8 rounded-full text-white text-lg solid flex items-center justify-center" >P</button>
<button class="bg-black w-8 h-8 rounded-full text-white text-lg solid flex items-center justify-center" >M</button>
</a>
</header>
79 changes: 5 additions & 74 deletions playbeat/src/components/HeaderMyUser.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
import FlechaDchHeader from "@/icons/FlechaDchHeader.astro";
import FlechaIzqHeader from "@/icons/FlechaIzqHeader.astro";
const but ={name: '...', items:['Cerrar sesión']}
---

<header class=" h-80 w-full">
Expand Down Expand Up @@ -44,14 +45,8 @@ const but ={name: '...', items:['Cerrar sesión']}
</span>
</a>

<button class="bg-[#6985C0] flex flex-wrap content-center justify-center p-1 px-3 gap-1 w-7 h-7 rounded-full button" >{but.name}</button>
<button class="bg-[#6985C0] flex flex-wrap content-center justify-center p-1 px-3 gap-1 w-7 h-7 rounded-full buttonOculto" >{but.name}</button>

<div class="dropdown">
{but.items.map( (item) => {
return <span>{item}</span>
})}
</div>
<a href="/logout" class="bg-[#6985C0] flex flex-row items-center p-1 px-3 gap-1 w-max h-7 rounded-md font-semibold" >CERRAR SESIÓN</a>

</div>


Expand All @@ -72,71 +67,7 @@ const but ={name: '...', items:['Cerrar sesión']}
bottom: 1vw;
right: 0.5vw;
}
.dropdown {
display: none;
position: absolute;
background-color: #2f2f2f;
min-width: 130px;
border-radius: 10px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 100;
margin-left: -30%;
margin-top: 32px;

}
.dropdown span {
color: white;

padding: 12px 16px;

text-decoration: none;
display: flex;
cursor: pointer;
font-weight: normal;
font-size: medium;
}

.dropdown span{
border-top: .5px solid white;

}
.dropdown span:first-child{
border-top: 0px;
border-top-left-radius:10px;
border-top-right-radius:10px;
}
.dropdown span:last-child{

border-bottom-left-radius:10px;
border-bottom-right-radius:10px;
}

.dropdown span:hover {background-color: #6e6e6e;}

.button {

border-radius: 30px;
width: 30px;
height: 30px;
border: none;
color: white;
font-weight: semibold;
cursor: pointer;
padding: 8px;
}
.buttonOculto {

border-radius: 30px;
width: 30px;
height: 30px;
border: none;
color: white;
font-weight: semibold;
cursor: pointer;
padding: 8px;
display:none;
margin-left: 69%;
}
.button:focus ~ .dropdown {display: flex; flex-direction: column;}
.button:focus ~ .buttonOculto {display: flex; position:absolute; top: 0; left: 0;}

</style>
6 changes: 6 additions & 0 deletions playbeat/src/pages/logout.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
//Para usar astro.cookies.delete no pude usarse en una funcion, por lo tanto se puede solucionar con el siguiente codigo
Astro.cookies.delete('token');
return Astro.redirect('/login');
---

0 comments on commit ec30464

Please sign in to comment.