Skip to content

Commit

Permalink
Merge pull request #152 from skni-kod/issue-151
Browse files Browse the repository at this point in the history
Issue 151
  • Loading branch information
pablitoo1 authored Dec 9, 2024
2 parents 33daa55 + 276c8c6 commit 845f7aa
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/api/logout/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { NextRequest, NextResponse } from 'next/server';
import AuthService from '@/services/auth/authService';

const ACCESS_TOKEN_COOKIE = 'AUTH_CONTEXT';
const REFRESH_TOKEN_COOKIE = 'AUTH_PERSIST';
// const REFRESH_TOKEN_COOKIE = 'AUTH_PERSIST';

const accessCookie = `${ACCESS_TOKEN_COOKIE}=; Path=/; Max-Age=0; SameSite=Lax;`;
const refreshCookie = `${ACCESS_TOKEN_COOKIE}=; Path=/; Max-Age=0; SameSite=Lax;`;
Expand Down
2 changes: 1 addition & 1 deletion src/components/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundarySta
this.state = { hasError: false };
}

static getDerivedStateFromError(error: Error): ErrorBoundaryState {
static getDerivedStateFromError(): ErrorBoundaryState {
// Update state so the next render will show the fallback UI
return { hasError: true };
}
Expand Down
3 changes: 2 additions & 1 deletion src/components/layout/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,14 @@ export default function Sidebar() {
<Link
key={id}
href={`/sections/${id}`}
onClick={sidebar.handleClose}
className="flex w-full cursor-pointer flex-row items-center bg-bg hover:bg-bgHover"
>
<div className="p-5">
<Image src={theme === 'light' ? icon.light : icon.dark} width={24} height={24} alt={name} />
</div>
<span
className={`relative text-secondary transition-all duration-300 ease-in-out ${!sidebar.isOpen ? '-left-96 w-0' : 'left-0 w-40'}`}
className={`relative text-secondary transition-all duration-300 ease-in-out ${!sidebar.isOpen ? '-left-96 z-0 w-0 opacity-0' : 'left-0 z-50 w-40 opacity-100'}`}
>
{name}
</span>
Expand Down
4 changes: 4 additions & 0 deletions src/contexts/SidebarContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React, { useContext, useState } from 'react';
type SidebarContextType = {
isOpen: boolean;
handleToggle: () => void;
handleClose: () => void;
};

const SidebarContext = React.createContext<SidebarContextType | undefined>(undefined);
Expand All @@ -15,11 +16,14 @@ export const SidebarProvider = ({ children }: { children: React.ReactNode }) =>

const handleToggle = () => setIsOpen((state) => !state);

const handleClose = () => setIsOpen(false);

return (
<SidebarContext.Provider
value={{
isOpen,
handleToggle,
handleClose,
}}
>
{children}
Expand Down

0 comments on commit 845f7aa

Please sign in to comment.