Skip to content

Commit 57f8f62

Browse files
committed
refactor: remove duplication
1 parent e7edf4c commit 57f8f62

23 files changed

+169
-200
lines changed

src/2023/SpeakerDetail/SpeakerDetail2023.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { BIG_BREAKPOINT } from "../../constants/BreakPoints";
1+
import {BIG_BREAKPOINT} from "../../constants/BreakPoints";
22

3-
import { FC, Suspense } from "react";
3+
import {FC, Suspense} from "react";
44
import MoreThanIcon from "../../assets/images/MoreThanBlueIcon.svg";
55
import LessThan from "../../assets/images/MoreThanIcon.svg";
66
import SlashesWhite from "../../assets/images/SlashesWhite.svg";
77
import linkedinIcon from "../../assets/images/linkedinIcon.svg";
88
import twitterIcon from "../../assets/images/twitterIcon.svg";
9-
import { useWindowSize } from "react-use";
9+
import {useWindowSize} from "react-use";
1010
import {
1111
StyledDetailsContainer,
1212
StyledFlexCol,
@@ -30,10 +30,10 @@ import {
3030
ROUTE_2023_SPEAKERS,
3131
ROUTE_2023_TALK_DETAIL,
3232
} from "../../constants/routes";
33-
import { StyledTalkDescription } from "./SpeakerDetail.style";
34-
import { Link } from "react-router";
35-
import { Color } from "../../styles/colors";
36-
import { ISpeaker } from "../Speakers/Speaker.types";
33+
import {StyledTalkDescription} from "./SpeakerDetail.style";
34+
import {Link} from "react-router";
35+
import {Color} from "../../styles/colors";
36+
import {ISpeaker} from "../../types/speakers";
3737

3838
interface ISpeakerDetailProps {
3939
speaker: ISpeaker;

src/2023/Speakers/Speaker.types.ts

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

src/2023/Speakers/Speakers2023.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { MOBILE_BREAKPOINT } from "../../constants/BreakPoints";
2-
import { Color } from "../../styles/colors";
3-
import { FC, useCallback, useEffect } from "react";
1+
import {MOBILE_BREAKPOINT} from "../../constants/BreakPoints";
2+
import {Color} from "../../styles/colors";
3+
import {FC, useCallback, useEffect} from "react";
44
import LessThanBlueIcon from "../../assets/images/LessThanBlueIcon.svg";
55
import MoreThanBlueIcon from "../../assets/images/MoreThanBlueIcon.svg";
66
import SectionWrapper from "../../components/SectionWrapper/SectionWrapper";
7-
import { SpeakerCard } from "./components/SpeakersCard";
7+
import {SpeakerCard} from "./components/SpeakersCard";
88
import TitleSection from "../../components/SectionTitle/TitleSection";
9-
import { useWindowSize } from "react-use";
9+
import {useWindowSize} from "react-use";
1010
import {
1111
SpeakersCardsContainer,
1212
StyledContainerLeftSlash,
@@ -19,10 +19,10 @@ import {
1919
} from "./Speakers.style";
2020
import webData from "../../data/2023.json";
2121
import Button from "../../components/UI/Button";
22-
import { gaEventTracker } from "../../components/analytics/Analytics";
23-
import { useFetchSpeakers } from "./UseFetchSpeakers";
24-
import { ISpeaker } from "./Speaker.types";
22+
import {gaEventTracker} from "../../components/analytics/Analytics";
23+
import {useFetchSpeakers} from "./UseFetchSpeakers";
2524
import * as Sentry from "@sentry/react";
25+
import {ISpeaker} from "../../types/speakers";
2626

2727
const LessThanGreaterThan = (props: { width: number }) => (
2828
<>

src/2023/Speakers/UseFetchSpeakers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {useQuery, UseQueryResult} from "react-query";
22
import axios from "axios";
3-
import {ISpeaker} from "./Speaker.types";
43
import {speakerAdapter} from "../../services/speakerAdapter";
4+
import {ISpeaker} from "../../types/speakers";
55

66
export const useFetchSpeakers = (id?: string): UseQueryResult<ISpeaker[]> => {
77
return useQuery("api-speakers", async () => {

src/2023/Speakers/components/SpeakersCard.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FC, Suspense } from "react";
1+
import {FC, Suspense} from "react";
22
import {
33
StyledImageAnimation,
44
StyledSpeakerCard,
@@ -7,10 +7,10 @@ import {
77
StyledSpeakerText,
88
StyledSpeakerTitle,
99
} from "./SpeakerCard.Style";
10-
import { Link } from "react-router";
11-
import { ISpeaker } from "../Speaker.types";
10+
import {Link} from "react-router";
1211
import Loading from "../../../assets/images/logo.png";
13-
import { ROUTE_2023_SPEAKER_DETAIL } from "../../../constants/routes";
12+
import {ROUTE_2023_SPEAKER_DETAIL} from "../../../constants/routes";
13+
import {ISpeaker} from "../../../types/speakers";
1414

1515
type SpeakersCardProps = {
1616
speaker: ISpeaker;

src/2023/TalkDetail/TalkDetail.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import {
33
LARGE_BREAKPOINT,
44
MOBILE_BREAKPOINT,
55
} from "../../constants/BreakPoints";
6-
import { Color } from "../../styles/colors";
7-
import { FC, Suspense, useEffect } from "react";
8-
import { IMeeting } from "./MeetingDetail.Type";
6+
import {Color} from "../../styles/colors";
7+
import {FC, Suspense, useEffect} from "react";
8+
import {IMeeting} from "./MeetingDetail.Type";
99
import LessThanIconWhite from "../../assets/images/LessThanIconWhite.svg";
1010
import LessThanIcon from "../../assets/images/LessThanBlueIcon.svg";
1111
import MoreThanIcon from "../../assets/images/MoreThanBlueIcon.svg";
1212
import SectionWrapper from "../../components/SectionWrapper/SectionWrapper";
13-
import { useWindowSize } from "react-use";
13+
import {useWindowSize} from "react-use";
1414
import {
1515
StyledContainer,
1616
StyledDescription,
@@ -28,14 +28,14 @@ import {
2828
StyledVideoContainer,
2929
StyledVideoTagsContainer,
3030
} from "./Style.MeetingDetail";
31-
import { Link } from "react-router";
31+
import {Link} from "react-router";
3232
import {
3333
ROUTE_2023_SPEAKER_DETAIL,
3434
ROUTE_2023_TALKS,
3535
} from "../../constants/routes";
3636
import conferenceData from "../../data/2023.json";
37-
import { Tag } from "../../components/Tag/Tag";
38-
import { ISpeaker } from "../Speakers/Speaker.types";
37+
import {Tag} from "../../components/Tag/Tag";
38+
import {ISpeaker} from "../../types/speakers";
3939

4040
const getVideoHeight = (windowWidth: number) => {
4141
let videoHeight;

src/2023/TalkDetail/TalkDetailContainer2023.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import { Color } from "../../styles/colors";
2-
import React, { FC, useEffect } from "react";
1+
import {Color} from "../../styles/colors";
2+
import React, {FC, useEffect} from "react";
33
import NotFoundError from "../../components/NotFoundError/NotFoundError";
44
import SectionWrapper from "../../components/SectionWrapper/SectionWrapper";
55
import styled from "styled-components";
6-
import { useParams } from "react-router";
6+
import {useParams} from "react-router";
77
import conferenceData from "../../data/2023.json";
8-
import { sessionAdapter, useFetchTalksById } from "../Talks/UseFetchTalks";
8+
import {sessionAdapter, useFetchTalksById} from "../Talks/UseFetchTalks";
99
import * as Sentry from "@sentry/react";
10-
import { useFetchSpeakers } from "../Speakers/UseFetchSpeakers";
11-
import { ISpeaker } from "../Speakers/Speaker.types";
12-
import { Session } from "../Talks/Talk.types";
10+
import {useFetchSpeakers} from "../Speakers/UseFetchSpeakers";
11+
import {Session} from "../Talks/Talk.types";
1312
import TalkDetail from "./TalkDetail";
13+
import {ISpeaker} from "../../types/speakers";
1414

1515
const StyledContainer = styled.div`
1616
background-color: ${Color.WHITE};

src/2024/SpeakerDetail/SpeakerDetail.tsx

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,29 @@ import {ROUTE_SPEAKERS, ROUTE_TALK_DETAIL} from "../../constants/routes";
1212
import {Link} from "react-router";
1313
import {Color} from "../../styles/colors";
1414
import conferenceData from "../../data/2024.json";
15-
import {ISpeaker} from "../../views/Speakers/Speaker.types";
1615
import {
17-
StyledDetailsContainer,
18-
StyledFlexCol,
19-
StyledImageContainer,
20-
StyledInfoContainer,
21-
StyledLink,
22-
StyledMoreThanIcon,
23-
StyledMoreThanIconContainer,
24-
StyledName,
25-
StyledNameContainer,
26-
StyledRightContainer,
27-
StyledSlashes,
28-
StyledSocialMediaContainer,
29-
StyledSocialMediaIcon,
30-
StyledSpeakerDescription,
31-
StyledSpeakerDetailContainer,
32-
StyledSpeakerImg,
33-
StyledSpeakerTitle
16+
StyledDetailsContainer,
17+
StyledFlexCol,
18+
StyledImageContainer,
19+
StyledInfoContainer,
20+
StyledLink,
21+
StyledMoreThanIcon,
22+
StyledMoreThanIconContainer,
23+
StyledName,
24+
StyledNameContainer,
25+
StyledRightContainer,
26+
StyledSlashes,
27+
StyledSocialMediaContainer,
28+
StyledSocialMediaIcon,
29+
StyledSpeakerDescription,
30+
StyledSpeakerDetailContainer,
31+
StyledSpeakerImg,
32+
StyledSpeakerTitle
3433
} from "../../views/SpeakerDetail/Speaker.style";
3534
import {
36-
StyledTalkDescription
35+
StyledTalkDescription
3736
} from "../../views/SpeakerDetail/SpeakerDetail.style";
37+
import {ISpeaker} from "../../types/speakers";
3838

3939
interface ISpeakerDetailProps {
4040
speaker: ISpeaker;

src/2024/Speakers/Speakers2024.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import Button from "../../components/UI/Button";
2121
import {gaEventTracker} from "../../components/analytics/Analytics";
2222
import {useFetchSpeakers} from "./UseFetchSpeakers";
2323
import * as Sentry from "@sentry/react";
24-
import {ISpeaker} from "../../views/Speakers/Speaker.types";
2524
import {SpeakerCard} from "../../views/Speakers/components/SpeakersCard";
25+
import {ISpeaker} from "../../types/speakers";
2626

2727
const LessThanGreaterThan = (props: { width: number }) => (
2828
<>

src/2024/Speakers/UseFetchSpeakers.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import {QueryClient, QueryClientProvider} from "react-query";
33
import {renderHook, waitFor} from "@testing-library/react";
44
import {useFetchSpeakers} from "./UseFetchSpeakers";
55
import axios, {AxiosHeaders, AxiosResponse} from "axios";
6-
import {IResponse} from "../../views/Speakers/Speaker.types";
76
import {speakerAdapter} from "../../services/speakerAdapter";
7+
import {IResponse} from "../../types/speakers";
88

99
jest.mock("axios");
1010
const mockedAxios = axios as jest.Mocked<typeof axios>;

0 commit comments

Comments
 (0)