Skip to content
Snippets Groups Projects
Commit 0e8a9c8b authored by Guilherme Eduardo's avatar Guilherme Eduardo
Browse files

Issue #288: UPDATE change order icons sidebar

parent d41a208b
No related branches found
No related tags found
1 merge request!267Issue #288: UPDATE change order icons sidebar
Pipeline #41835 passed
...@@ -53,12 +53,12 @@ export default function NavigationBar({ mobileSearch}) { ...@@ -53,12 +53,12 @@ export default function NavigationBar({ mobileSearch}) {
const navItems = [ const navItems = [
{ label: "Pesquisar", href: "#", icon: SearchIcon }, { label: "Pesquisar", href: "#", icon: SearchIcon },
{ label: "Recursos", href: "/busca?page=LearningObject", icon: SubjectIcon },
{ label: "Coleções", href: "/busca?page=Collection", icon: CollectionsBookmarkIcon },
{ label: "Publicar", href: "/publicar", icon: FileUploadIcon },
{ label: "MEC", href: "/busca?page=MEC", icon: VerifiedIcon },
{ label: "Perfil", href: "/perfil", icon: Person }, { label: "Perfil", href: "/perfil", icon: Person },
{ label: "Coleções", href: "/busca?page=Collection", icon: CollectionsBookmarkIcon },
{ label: "Recursos", href: "/busca?page=LearningObject", icon: SubjectIcon },
{ label: "Sobre", href: "/sobre", icon: HelpIcon }, { label: "Sobre", href: "/sobre", icon: HelpIcon },
{ label: "MEC", href: "/busca?page=MEC", icon: VerifiedIcon },
{ label: "Publicar", href: "/publicar", icon: FileUploadIcon },
{ label: "Contato", href: "/contato", icon: EmailRoundedIcon }, { label: "Contato", href: "/contato", icon: EmailRoundedIcon },
{ label: "Sair", href: "", icon: LogoutRounded}, { label: "Sair", href: "", icon: LogoutRounded},
] ]
......
...@@ -89,7 +89,7 @@ export default function Overlay({ ...@@ -89,7 +89,7 @@ export default function Overlay({
<div <div
className="grid w-full pt-[160px] h-dvh text-base 2xl:grid-cols-[150px_minmax(0,1fr)_500px] xl:grid-cols-[150px_minmax(0,1fr)_400px] grid-cols-[150px_minmax(0,1fr)]" className="grid w-full pt-[160px] h-dvh text-base 2xl:grid-cols-[150px_minmax(0,1fr)_500px] xl:grid-cols-[150px_minmax(0,1fr)_400px] grid-cols-[150px_minmax(0,1fr)]"
> >
<div className="min-h-0"> <div className="min-h-0 overflow-y-auto">
<SideBar setFilterState={setFilterState} filterState={filterState} /> <SideBar setFilterState={setFilterState} filterState={filterState} />
</div> </div>
{children} {children}
......
...@@ -12,8 +12,10 @@ import { Person } from "@mui/icons-material"; ...@@ -12,8 +12,10 @@ import { Person } from "@mui/icons-material";
import FileUploadIcon from '@mui/icons-material/FileUpload'; import FileUploadIcon from '@mui/icons-material/FileUpload';
import { isLoggedIn } from "../handlers/loginHandler"; import { isLoggedIn } from "../handlers/loginHandler";
import NeedLoginModal from "./needLoginModal"; import NeedLoginModal from "./needLoginModal";
import LogoutRounded from '@mui/icons-material/LogoutRounded';
import { import {
getStoredValue, getStoredValue,
removeFromLocalStorage,
} from "../handlers/localStorageHandler"; } from "../handlers/localStorageHandler";
/** /**
...@@ -24,18 +26,11 @@ import { ...@@ -24,18 +26,11 @@ import {
const acessoRapido = [ const acessoRapido = [
{ {
title: "Publicar", title: "Meu perfil",
icon: FileUploadIcon, icon: Person,
href: "/publicar", href: "/perfil",
id: "Publicar Recurso", id: "Perfil",
},
{
title: "MEC",
icon: VerifiedIcon,
href: "MEC",
id: "MEC",
}, },
{ {
title: "Coleções", title: "Coleções",
icon: CollectionsBookmarkIcon, icon: CollectionsBookmarkIcon,
...@@ -48,23 +43,35 @@ const acessoRapido = [ ...@@ -48,23 +43,35 @@ const acessoRapido = [
href: "LearningObject", href: "LearningObject",
id: "Recursos", id: "Recursos",
}, },
{
title: "Perfil",
icon: Person,
href: "/perfil",
id: "Perfil",
},
{ {
title: "Sobre", title: "Sobre",
icon: HelpIcon, icon: HelpIcon,
href: "/sobre", href: "/sobre",
id: "Sobre", id: "Sobre",
}, },
{
title: "MEC",
icon: VerifiedIcon,
href: "MEC",
id: "MEC",
},
{
title: "Publicar",
icon: FileUploadIcon,
href: "/publicar",
id: "Publicar Recurso",
},
{ {
title: "Contato", title: "Contato",
icon: EmailRoundedIcon, icon: EmailRoundedIcon,
href: "/contato", href: "/contato",
id: "Contato", id: "Contato",
},
{
title: "Sair",
icon: LogoutRounded,
href: "/sobre",
id: "sobre",
} }
]; ];
...@@ -110,6 +117,16 @@ export default function SideBar({ setFilterState, filterState }) { ...@@ -110,6 +117,16 @@ export default function SideBar({ setFilterState, filterState }) {
const [needLoginOpen, setNeedLoginOpen] = useState(false); const [needLoginOpen, setNeedLoginOpen] = useState(false);
const handleLogout = () => {
removeFromLocalStorage("access_token");
removeFromLocalStorage("user_data");
removeFromLocalStorage("uid");
removeFromLocalStorage("expiry");
removeFromLocalStorage("token-type");
removeFromLocalStorage("client");
window.location.reload();
}
const handleOpenLogin = () => { const handleOpenLogin = () => {
...@@ -132,18 +149,24 @@ export default function SideBar({ setFilterState, filterState }) { ...@@ -132,18 +149,24 @@ export default function SideBar({ setFilterState, filterState }) {
<NeedLoginModal open={needLoginOpen} setOpen={setNeedLoginOpen} /> <NeedLoginModal open={needLoginOpen} setOpen={setNeedLoginOpen} />
<div className="max-md:hidden min-h-0 overflow-y-auto flex flex-col text-darkGray-HC-white-underline font-light"> <div className="max-md:hidden min-h-0 overflow-y-auto flex flex-col text-darkGray-HC-white-underline font-light">
<div className="flex flex-col justify-start items-center gap-3 w-full "> <div className="flex flex-col justify-start items-center gap-3 w-full mb-5">
{acessoRapido {acessoRapido
.filter(item => isLoggedIn() || item.href !== "/perfil") .filter(item => isLoggedIn() || (item.title !== "Sair" && item.href !== "/perfil"))
.map((item, index) => { .map((item, index) => {
return ( return (
<Link <Link
onClick={item.href === "/publicar" ? handleOpenLogin : () => { }} onClick={() => {
if (item.title === "Sair") {
handleLogout();
} else if (item.href === "/publicar" && !isLoggedIn()) {
handleOpenLogin();
}
}}
href={item.href === "/publicar" ? (isLoggedIn() ? "/publicar" : "") : getHref(item.href)} href={item.href === "/publicar" ? (isLoggedIn() ? "/publicar" : "") : getHref(item.href)}
key={index} key={index}
alt={item.title} alt={item.title}
title={item.title} title={item.title}
className={`aspect-square cursor-pointer hover:bg-lightGray-HC-white hover:text-darkGray-HC-dark-underline focus:bg-lightGray-HC-white text-center rounded-lg pt-2 w-[80px] className={`aspect-square cursor-pointer hover:bg-lightGray-HC-white hover:text-darkGray-HC-dark-underline focus:bg-lightGray-HC-white text-center rounded-lg pt-2 w-[88px]
${(page === item.href) || (pathname.startsWith(item.href)) ? "bg-lightGray-HC-white text-darkGray-HC-dark-underline font-bold" : ""} ${(page === item.href) || (pathname.startsWith(item.href)) ? "bg-lightGray-HC-white text-darkGray-HC-dark-underline font-bold" : ""}
`} `}
> >
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment