diff --git a/src/components/NavigationBarSingleList.jsx b/src/components/NavigationBarSingleList.jsx index 3177cb0..e298ed8 100644 --- a/src/components/NavigationBarSingleList.jsx +++ b/src/components/NavigationBarSingleList.jsx @@ -22,16 +22,19 @@ export function NavigationBarSingleList({ window.location.pathname.substring( window.location.pathname.lastIndexOf('/') + 1, ) === 'list'; - const localStorageListName = localStorage - .getItem('tcl-shopping-list-path') - .substring( - localStorage.getItem('tcl-shopping-list-path').lastIndexOf('/') + 1, - ); + + const localStorageListName = + localStorage + ?.getItem('tcl-shopping-list-path') + ?.substring( + localStorage.getItem('tcl-shopping-list-path').lastIndexOf('/') + 1, + ) || ''; return (
  • + {/*The above hex code (#ebf5ff) only worked in the ternary operator in lowercase format, not uppercase.*/} {/* Using Link instead of button */} ); } - -// <... className={`flex items-center space-x-2 px-4 py-5 transition duration-500 ease-in-out transform hover:-translate-y-1 hover:scale-110 border-l-4 border-white ${window.location.pathname === '/' ? 'border-red-200' : ''}`}>