Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions src/hooks/useTimelineUrlState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { useCallback } from "react";
import { useSearch, useNavigate } from "@tanstack/react-router";
import type { TimelineSearch } from "@/lib/searchSchemas";

export type TimelineView = TimelineSearch["view"];
export type TimeFilter = TimelineSearch["time"];

export function useTimelineUrlState(tab: "timeline" | "list" = "timeline") {
Expand All @@ -13,17 +12,6 @@ export function useTimelineUrlState(tab: "timeline" | "list" = "timeline") {
});
const navigate = useNavigate({ from: route });

const updateView = useCallback(
(view: TimelineView) => {
navigate({
to: ".",
search: (prev) => ({ ...prev, view }),
replace: true,
});
},
[navigate],
);

const updateDay = useCallback(
(day: string) => {
navigate({
Expand Down Expand Up @@ -60,17 +48,15 @@ export function useTimelineUrlState(tab: "timeline" | "list" = "timeline") {
const clearFilters = useCallback(() => {
navigate({
to: ".",
search: (prev) => ({ view: prev.view }),
search: () => ({}),
replace: true,
});
}, [navigate]);

return {
view: state.view,
day: state.day,
time: state.time,
stages: state.stages,
updateView,
updateDay,
updateTime,
updateStages,
Expand Down
1 change: 0 additions & 1 deletion src/hooks/useUrlState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export function useUrlState() {
search: (prev) => ({
invite: prev.invite,
groupId: prev.groupId,
votePerspective: prev.votePerspective,
}),
replace: true,
});
Expand Down
3 changes: 0 additions & 3 deletions src/lib/searchSchemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export const filterSortSearchSchema = z.object({
groupId: z.string().optional(),
invite: z.string().optional(),
sortLocked: z.boolean().catch(false),
votePerspective: z.string().optional(),
});

export type FilterSortSearch = z.infer<typeof filterSortSearchSchema>;
Expand All @@ -36,7 +35,6 @@ export const filterSortSearchDefaults = {
} satisfies Partial<FilterSortSearch>;

export const timelineSearchSchema = z.object({
view: timelineViewSchema.catch("list"),
day: z.string().catch("all"),
time: z.enum(["all", "morning", "afternoon", "evening"]).catch("all"),
stages: z.array(z.string()).catch([]),
Expand All @@ -45,7 +43,6 @@ export const timelineSearchSchema = z.object({
export type TimelineSearch = z.infer<typeof timelineSearchSchema>;

export const timelineSearchDefaults: TimelineSearch = {
view: "list",
day: "all",
time: "all",
stages: [],
Expand Down

This file was deleted.

53 changes: 0 additions & 53 deletions src/pages/EditionView/tabs/ScheduleTab/TimelineControls.tsx

This file was deleted.

82 changes: 0 additions & 82 deletions src/pages/EditionView/tabs/ScheduleTab/TimelineNavigation.tsx

This file was deleted.

Loading