Skip to content
Snippets Groups Projects
Commit 7c956f5f authored by Richard Fernando Heise Ferreira's avatar Richard Fernando Heise Ferreira
Browse files

Issue #256: FIX minor interface bugs

parent 3a196d03
No related branches found
No related tags found
1 merge request!237Issue #256: FIX minor interface bugs
Pipeline #40953 passed
......@@ -37,7 +37,7 @@ const nextConfig = {
{
protocol: 'http',
hostname: 'mecdb4.c3sl.ufpr.br',
port: '8443',
port: '443',
pathname: '/**',
},
],
......
......@@ -359,14 +359,9 @@ export default function AboutComponent() {
<div className="text-main-text text-lg mt-4 ml-3">Acesse a página de Ajuda e Suporte!</div>
<a href="/ajuda" className="mt-4 bg-secondary text-lg text-white p-2 px-4 rounded-lg hover:bg-secondary-hover">Ir para a página de Ajuda</a>
</div>
<Link
href="https://gitlab.c3sl.ufpr.br/mecred/frontend-mecred"
className="flex flex-col text-center items-center mt-8 max-md:mt-0"
>
<h6 className="underline text-gray-700 pb-[60px]">
<h6 className="text-center pt-5 text-gray-700 pb-[100px]">
Versão {packageInfo.version}
</h6>
</Link>
</div>
</div>
</div>
......
......@@ -44,7 +44,7 @@ function DefaultContent({
return (
<>
<div className="grid xl:grid-cols-[150px_auto_500px] md:grid-cols-[150px_auto_300px] grid-cols-[170px_auto] w-full">
<div className="grid xl:grid-cols-[150px_auto_500px] md:grid-cols-[150px_auto_300px] grid-cols-[170px_auto] max-md:pl-8 w-full">
<Link href="/" className="flex justify-center items-center">
<div className="flex gap-2 justify-center items-center">
<div
......
......@@ -6,6 +6,7 @@ import FileUploadIcon from '@mui/icons-material/FileUpload';
import CollectionsBookmarkIcon from "@mui/icons-material/CollectionsBookmark";
import SubjectIcon from "@mui/icons-material/Subject";
import EmailRoundedIcon from '@mui/icons-material/EmailRounded';
import LogoutRounded from '@mui/icons-material/LogoutRounded';
import HelpIcon from "@mui/icons-material/Help";
import VerifiedIcon from "@mui/icons-material/Verified";
import { Person } from "@mui/icons-material";
......@@ -13,6 +14,7 @@ import SearchIcon from '@mui/icons-material/Search';
import { usePathname, useRouter, useSearchParams } from "next/navigation";
import {
getStoredValue,
removeFromLocalStorage,
} from "../handlers/localStorageHandler";
......@@ -39,16 +41,26 @@ export default function NavigationBar({ mobileSearch}) {
}
};
const handleLogout = () => {
removeFromLocalStorage("access_token");
removeFromLocalStorage("user_data");
removeFromLocalStorage("uid");
removeFromLocalStorage("expiry");
removeFromLocalStorage("token-type");
removeFromLocalStorage("client");
window.location.reload();
};
const navItems = [
{ 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: "Usuários", href: "/busca?page=User", icon: Person },
{ label: "MEC", href: "/busca?page=MEC", icon: VerifiedIcon },
{ label: "Perfil", href: "/perfil", icon: Person },
{ label: "Sobre", href: "/sobre", icon: HelpIcon },
{ label: "Contato", href: "/contato", icon: EmailRoundedIcon },
{ label: "Sair", href: "", icon: LogoutRounded},
]
const handleToggleMobileSearch = (e) => {
......@@ -66,6 +78,7 @@ export default function NavigationBar({ mobileSearch}) {
const isPublishRoute = item.href === "/publicar";
const isPerfilRoute = item.href === "/perfil";
const isSearchButton = item.label === "Pesquisar";
const isLogout = item.label === "Sair";
const isActive =
(page === item.href.split("page=")[1]) ||
......@@ -75,12 +88,13 @@ export default function NavigationBar({ mobileSearch}) {
return (
<li key={index} className="flex w-20 flex-col items-center justify-center p-3">
<a
href={
href={isLogout ? "#" : (
isPublishRoute ? (isLoggedIn() ? "/publicar" : "") :
isPerfilRoute ? (isLoggedIn() ? `/perfil/${id}` : "") :
item.href
}
)}
onClick={
isLogout ? (e) => { e.preventDefault(); handleLogout(); } :
isPublishRoute || isPerfilRoute ? (e) => handleOpenLoggin(e) :
isSearchButton ? (e) => handleToggleMobileSearch(e) :
undefined
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment