Skip to content

Commit

Permalink
set navbar title
Browse files Browse the repository at this point in the history
  • Loading branch information
maheshj01 committed Dec 23, 2024
1 parent 8416a8a commit 10a4c45
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/app/(main)/_components/Sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"use client";
import { useNavbar } from '@/lib/Context/PSNavbarProvider';
import PencilSquareIcon from '@heroicons/react/24/solid/PencilSquareIcon';
import { useRouter } from 'next/navigation';
import React, { useCallback, useEffect, useState } from 'react';
Expand All @@ -22,10 +23,12 @@ const Sidebar: React.FC = () => {
const authService = new AuthService();
const logService = new LogService();
const [isFirstLogin, setIsFirstLogin] = useState<boolean>(false);
const { navbarTitle, setNavbarTitle } = useNavbar();

const onLogClick = useCallback((log: Log | null) => {
if (log) {
setSelected(log);
setNavbarTitle(log.title || log.id || '');
setId(log.id!);
router.push(`/logs/${log.id}`);
Analytics.logEvent('change_log', { id: log.id, action: 'click' });
Expand Down

0 comments on commit 10a4c45

Please sign in to comment.