Skip to content

Commit 2088fb6

Browse files
committed
refactor: remove duplication
1 parent 5554743 commit 2088fb6

File tree

5 files changed

+42
-57
lines changed

5 files changed

+42
-57
lines changed

src/2023/TalkDetail/MeetingDetail.Type.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/2024/TalkDetail/MeetingDetail.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import conferenceData from "../../data/2024.json";
2020
import {Tag} from "../../components/Tag/Tag";
2121
import styled from "styled-components";
2222
import {AddToCalendarButton} from "add-to-calendar-button-react";
23-
import {IMeeting} from "../../views/MeetingDetail/MeetingDetail.Type";
2423
import {
2524
StyledContainer,
2625
StyledDetailsContainer,
@@ -41,6 +40,7 @@ import {
4140
} from "../../views/MeetingDetail/Style.MeetingDetail";
4241
import {StyledTitle} from "../Home/Style.Home";
4342
import {ISpeaker} from "../../types/speakers";
43+
import {IMeeting} from "../../types/sessions";
4444

4545
const getVideoHeight = (windowWidth: number) => {
4646
let videoHeight;

src/types/sessions.ts

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import {ISpeaker} from "./speakers";
2+
13
export interface SessionSpeaker {
24
readonly id: string;
35
readonly name: string;
@@ -47,4 +49,41 @@ export interface QuestionAnswers {
4749
readonly question: string;
4850
readonly questionType: string;
4951
readonly answer: string;
50-
}
52+
}
53+
54+
export interface IMeeting {
55+
id: number;
56+
urlName?: string;
57+
title: string;
58+
description: string;
59+
videoUrl?: string;
60+
slidesURL?: string;
61+
videoTags?: string[];
62+
speakers: SessionSpeaker[];
63+
level?: string;
64+
type?: string;
65+
language?: string;
66+
track?: string;
67+
startDate: string;
68+
endDate: string;
69+
startTime: string;
70+
endTime: string;
71+
}
72+
73+
export interface IMeetingDetailProps {
74+
meeting: IMeeting;
75+
speakers?: ISpeaker[];
76+
}
77+
78+
export type MyType = {
79+
urlName?: string;
80+
videoUrl?: string;
81+
level?: string;
82+
videoTags?: string[];
83+
speakers?: ISpeaker[];
84+
description: string;
85+
language?: string;
86+
title: string;
87+
type?: string;
88+
track?: string;
89+
};

src/views/MeetingDetail/MeetingDetail.Type.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/views/MeetingDetail/MeetingDetail.tsx

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
} from "../../constants/BreakPoints";
66
import {Color} from "../../styles/colors";
77
import React, {FC, Suspense, useEffect} from "react";
8-
import {IMeeting} from "./MeetingDetail.Type";
98
import LessThanIconWhite from "../../assets/images/LessThanIconWhite.svg";
109
import LessThanIcon from "../../assets/images/LessThanBlueIcon.svg";
1110
import MoreThanIcon from "../../assets/images/MoreThanBlueIcon.svg";
@@ -37,7 +36,7 @@ import conferenceData from "../../data/2024.json";
3736
import {Tag} from "../../components/Tag/Tag";
3837
import styled from "styled-components";
3938
import {AddToCalendarButton} from "add-to-calendar-button-react";
40-
import {ISpeaker} from "../../types/speakers";
39+
import {IMeetingDetailProps, MyType} from "../../types/sessions";
4140

4241
const getVideoHeight = (windowWidth: number) => {
4342
let videoHeight;
@@ -105,24 +104,6 @@ export const StyledVoteTalkLink = styled.a`
105104
font-size: 0.8rem;
106105
`;
107106

108-
interface IMeetingDetailProps {
109-
meeting: IMeeting;
110-
speakers?: ISpeaker[];
111-
}
112-
113-
type MyType = {
114-
urlName?: string;
115-
videoUrl?: string;
116-
level?: string;
117-
videoTags?: string[];
118-
speakers?: ISpeaker[];
119-
description: string;
120-
language?: string;
121-
title: string;
122-
type?: string;
123-
track?: string;
124-
};
125-
126107
const MeetingDetail: FC<React.PropsWithChildren<IMeetingDetailProps>> = ({
127108
meeting,
128109
speakers: mySpeakers,

0 commit comments

Comments
 (0)