Skip to content

Commit

Permalink
[fix] merged timetable page title
Browse files Browse the repository at this point in the history
  • Loading branch information
cupoftea4 committed Nov 18, 2024
1 parent a31f117 commit 7dd0921
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/features/header/TimetableHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import HomeIcon from "@/assets/HomeIcon";
import usePageTitle from "@/hooks/usePageTitle";
import useWindowDimensions from "@/hooks/useWindowDimensions";
import Toggle from "@/shared/Toggle";
import { classes } from "@/styles/utils";
Expand Down Expand Up @@ -42,6 +43,8 @@ const TimetableHeader: FC<OwnProps> = ({
const group = useParams().group?.trim() ?? "";
const { width } = useWindowDimensions();
const isMobile = width < MOBILE_SCREEN_BREAKPOINT;
const groupTitle = timetableType === "merged" ? "Мій розклад" : group;
usePageTitle(groupTitle);

const handleIsExamsTimetableChange = (isExams: boolean) => {
const path =
Expand All @@ -68,7 +71,7 @@ const TimetableHeader: FC<OwnProps> = ({
<HomeIcon />
</Link>
<SavedMenu timetableChanged={loading} />
<h1 className={styles.title}>{timetableType === "merged" ? "Мій розклад" : group}</h1>
<h1 className={styles.title}>{groupTitle}</h1>
{timetableType !== "selective" && (
<button
type="button"
Expand Down
2 changes: 0 additions & 2 deletions src/pages/TimetablePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import CreateMergedModal from "@/features/merged_modal/CreateMergedModal";
import ExamsTimetable from "@/features/timetable/ExamsTimetable";
import Timetable from "@/features/timetable/Timetable";
import useGTagTimetableEvents from "@/hooks/useGTagTimetableEvents";
import usePageTitle from "@/hooks/usePageTitle";
import type { ExamsTimetableItem, HalfTerm, TimetableItem, TimetableType } from "@/types/timetable";
import type { RenderPromises } from "@/types/utils";
import TimetableManager from "@/utils/data/TimetableManager";
Expand Down Expand Up @@ -45,7 +44,6 @@ const TimetablePage: FC<OwnProps> = ({ isExamsTimetable = false }) => {

const navigate = useNavigate();
const timetableRef = useRef<HTMLElement>(null);
usePageTitle(group);

const iscFile = useTimetableISCFile(
(!isExamsTimetable && timetable) || (isExamsTimetable && examsTimetable),
Expand Down

0 comments on commit 7dd0921

Please sign in to comment.