Skip to content

Commit cac568c

Browse files
committed
types
1 parent fde9f39 commit cac568c

File tree

2 files changed

+13
-76
lines changed

2 files changed

+13
-76
lines changed

frontend/src/components/schedule-view/events.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,7 @@ import { useCurrentLanguage } from "~/locale/context";
2222

2323
import { createHref } from "../link";
2424
import { EventTag } from "../schedule-event-detail/event-tag";
25-
import {
26-
type Item,
27-
ItemTypes,
28-
type Room,
29-
type Slot,
30-
Submission as SubmissionType,
31-
} from "./types";
25+
import type { Item, Room, Slot } from "./types";
3226

3327
export const getItemUrl = (item: Item) => {
3428
if (item.linkTo) {
Lines changed: 12 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,12 @@
1-
export const ItemTypes = {
2-
ALL_TRACKS_EVENT: "all_tracks_event",
3-
TRAINING: "training",
4-
TALK: "talk",
5-
CUSTOM: "custom",
6-
KEYNOTE: "keynote",
7-
ROOM_CHANGE: "room_change",
8-
};
9-
10-
export type Submission = {
11-
id: string;
12-
title: string;
13-
type?: { name: string } | null;
14-
duration?: { duration: number } | null;
15-
audienceLevel?: { name: string; id: string } | null;
16-
speaker?: { fullName: string } | null;
17-
tags?: { name: string }[] | null;
18-
};
19-
20-
export type Keynote = {
21-
id: string;
22-
title: string;
23-
slug: string;
24-
speakers: ({ fullName: string } | null)[];
25-
};
26-
27-
type Participant = {
28-
photo?: string;
29-
};
30-
31-
export type Item = {
32-
id: string;
33-
title: string;
34-
slug: string;
35-
language: { code: string };
36-
type: string;
37-
rooms: Room[];
38-
linkTo: string;
39-
duration?: number | null;
40-
submission?: Submission | null;
41-
keynote?: Keynote | null;
42-
audienceLevel?: { name: string; id: string } | null;
43-
speakers: { fullName: string; participant?: Participant }[];
44-
hasLimitedCapacity: boolean;
45-
userHasSpot: boolean;
46-
hasSpacesLeft: boolean;
47-
spacesLeft: number;
48-
};
49-
50-
export type Slot = {
51-
id: string;
52-
duration: number;
53-
hour: string;
54-
endHour: string;
55-
type: "DEFAULT" | "FREE_TIME" | "BREAK";
56-
items: Item[];
57-
};
58-
59-
export type ScheduleItem = {
60-
title: string;
61-
trackSpan?: number;
62-
allTracks?: boolean;
63-
};
64-
65-
export type Room = {
66-
id: string;
67-
name: string;
68-
type: string;
69-
};
1+
import {
2+
type ScheduleQuery,
3+
readUserStarredScheduleItemsQueryCache,
4+
useStarScheduleItemMutation,
5+
useUnstarScheduleItemMutation,
6+
useUserStarredScheduleItemsQuery,
7+
writeUserStarredScheduleItemsQueryCache,
8+
} from "~/types";
9+
10+
export type Slot = ScheduleQuery["conference"]["days"][0]["slots"][0];
11+
export type Item = Slot["items"][0];
12+
export type Room = ScheduleQuery["conference"]["days"][0]["rooms"][0];

0 commit comments

Comments
 (0)