Skip to content

Commit fa77170

Browse files
committed
fix: fix 2024 diversity route
1 parent 017ac8e commit fa77170

File tree

33 files changed

+911
-916
lines changed

33 files changed

+911
-916
lines changed

src/2023/Cfp/CfpSection2023.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ describe("CfpSection2023", () => {
9898
render(<CfpSection2023 />);
9999
await waitFor(() => {
100100
expect(document.title).toBe(
101-
`CFP Committee - DevBcn - ${conferenceData.edition}`,
101+
`CFP Committee DevBcn - Barcelona Developers Conference — ${conferenceData.edition}`,
102102
);
103103
});
104104
});

src/2023/Cfp/CfpSection2023.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
StyledAboutImage,
2222
StyledSocialIconsWrapper,
2323
} from "../../views/About/components/Style.AboutCard";
24+
import { useDocumentTitleUpdater } from "../../services/useDocumentTitleUpdate";
2425

2526
const TrackName = styled.h2`
2627
padding-top: 1.2rem;
@@ -75,9 +76,8 @@ const CfpTrackComponent: FC<React.PropsWithChildren<CfpTrackProps>> = ({
7576

7677
const CfpSection2023: FC<React.PropsWithChildren<unknown>> = () => {
7778
const { width } = useWindowSize();
78-
React.useEffect(() => {
79-
document.title = `CFP Committee - DevBcn - ${conferenceData.edition}`;
80-
}, []);
79+
80+
useDocumentTitleUpdater("CFP Committee", conferenceData.edition);
8181
return (
8282
<>
8383
<SectionWrapper color={Color.WHITE} marginTop={5}>

src/2023/Communities/Communities2023.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import styled from "styled-components";
33
import TwitterIcon from "../../components/Icons/Twitter";
44
import { Color } from "../../styles/colors";
55
import WebsiteIcon from "../../components/Icons/website";
6+
import { useDocumentTitleUpdater } from "../../services/useDocumentTitleUpdate";
67

78
const Heading = styled.h1`
89
padding-top: 10rem;
@@ -29,9 +30,7 @@ const FoSS = styled.div`
2930
`;
3031

3132
const Communities2023: FC<React.PropsWithChildren<unknown>> = () => {
32-
React.useEffect(() => {
33-
document.title = "Communities";
34-
});
33+
useDocumentTitleUpdater("Communities", "2023");
3534
return (
3635
<>
3736
<Heading>FOSS & Diversity Communities</Heading>

src/2023/Diversity/Diversity2023.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FC, useEffect } from "react";
1+
import { FC } from "react";
22
import { Color } from "../../styles/colors";
33
import data from "../../data/2023.json";
44
import styled from "styled-components";
@@ -8,6 +8,7 @@ import {
88
ROUTE_CODE_OF_CONDUCT,
99
ROUTE_CONDITIONS,
1010
} from "../../constants/routes";
11+
import { useDocumentTitleUpdater } from "../../services/useDocumentTitleUpdate";
1112

1213
const StyledSection = styled.section`
1314
{
@@ -96,9 +97,7 @@ const StyledParagraph = styled.section`
9697
}
9798
`;
9899
const Diversity2023: FC<React.PropsWithChildren<unknown>> = () => {
99-
useEffect(() => {
100-
document.title = `Diversity - DevBcn ${data.edition}`;
101-
});
100+
useDocumentTitleUpdater("Diversity", data.edition);
102101

103102
return (
104103
<StyledSection className="styled-section">

src/2023/Home/Home2023Wrapper.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import Sponsors from "./components/Sponsors/Sponsors";
77
import styled from "styled-components";
88
import data from "../../data/2023.json";
99
import { useLocation } from "react-router";
10+
import { useDocumentTitleUpdater } from "../../services/useDocumentTitleUpdate";
1011

1112
const StyledContainer = styled.div`
1213
padding-bottom: 10rem;
@@ -20,12 +21,13 @@ export const Home2023Wrapper: FC<React.PropsWithChildren<unknown>> = () => {
2021
const { hash } = useLocation();
2122

2223
React.useEffect(() => {
23-
document.title = `Home - DevBcn - ${data.edition}`;
2424
if (hash != null && hash !== "") {
2525
const scroll = document.getElementById(hash.substring(1));
2626
scroll?.scrollIntoView();
2727
}
2828
}, [hash]);
29+
30+
useDocumentTitleUpdater("Home", data.edition);
2931
return (
3032
<StyledContainer id="home-wrapper">
3133
<Home />

src/2023/JobOffers/JobOffers2023.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
StyledTitleContainer
1515
} from "../../styles/JobOffers/JobOffers.Style";
1616
import CompanyOffers from "../../components/JobOffers/CompanyOffers";
17+
import { useDocumentTitleUpdater } from "../../services/useDocumentTitleUpdate";
1718

1819
const NoOffersAvailable = () => (
1920
<h4 style={{ color: Color.DARK_BLUE }}>No job offers available yet</h4>
@@ -29,9 +30,7 @@ const MoreThanLessThan = (props: { width: number }) => (
2930
const JobOffers2023: FC<React.PropsWithChildren<unknown>> = () => {
3031
const { width } = useWindowSize();
3132

32-
React.useEffect(() => {
33-
document.title = `Job Offers - DevBcn - ${data.edition}`;
34-
}, []);
33+
useDocumentTitleUpdater("Job Offers", data.edition);
3534

3635
return (
3736
<SectionWrapper color={Color.WHITE} marginTop={6} paddingBottom={100}>

src/2023/Schedule/Schedule2023.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ import {
1313
StyledScheduleSection,
1414
} from "../../styles/Schedule/Schedule.style";
1515
import * as Sentry from "@sentry/react";
16+
import { useDocumentTitleUpdater } from "../../services/useDocumentTitleUpdate";
1617

1718
const Schedule2023: FC<React.PropsWithChildren<unknown>> = () => {
1819
const { width } = useWindowSize();
1920

20-
React.useEffect(() => {
21-
document.title = `Schedule - DevBcn - ${data.edition}`;
21+
useDocumentTitleUpdater("Schedule", data.edition);
2222

23+
React.useEffect(() => {
2324
fetch("https://sessionize.com/api/v2/a2sw0wks/view/GridSmart")
2425
.then((value) => value.text())
2526
.then((value) => {

src/2023/SessionFeedback/SessionFeedback2023.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { FilterMatchMode } from "primereact/api";
1515
import { Color } from "../../styles/colors";
1616
import { Link } from "react-router";
1717
import { ROUTE_TALK_DETAIL } from "../../constants/routes";
18+
import { useDocumentTitleUpdater } from "../../services/useDocumentTitleUpdate";
1819

1920
const SessionFeedback2023: FC<React.PropsWithChildren<unknown>> = () => {
2021
const bodyTemplate = React.useCallback(
@@ -65,9 +66,7 @@ const SessionFeedback2023: FC<React.PropsWithChildren<unknown>> = () => {
6566
</div>
6667
);
6768

68-
React.useEffect(() => {
69-
document.title = "DevBcn 2023 - Session Feedback";
70-
});
69+
useDocumentTitleUpdater("Session Feedback", "2023");
7170

7271
const header = renderHeader();
7372

src/2023/TalkDetail/TalkDetail.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
MOBILE_BREAKPOINT,
55
} from "../../constants/BreakPoints";
66
import {Color} from "../../styles/colors";
7-
import React, {FC, Suspense, useEffect} from "react";
7+
import React, { FC, Suspense } from "react";
88
import LessThanIconWhite from "../../assets/images/LessThanIconWhite.svg";
99
import LessThanIcon from "../../assets/images/LessThanBlueIcon.svg";
1010
import MoreThanIcon from "../../assets/images/MoreThanBlueIcon.svg";
@@ -33,8 +33,9 @@ import {
3333
ROUTE_2023_TALKS,
3434
} from "../../constants/routes";
3535
import conferenceData from "../../data/2023.json";
36-
import {Tag} from "../../components/Tag/Tag";
37-
import {IMeetingDetailProps, MyType} from "../../types/sessions";
36+
import { Tag } from "../../components/Tag/Tag";
37+
import { IMeetingDetailProps, MyType } from "../../types/sessions";
38+
import { useDocumentTitleUpdater } from "../../services/useDocumentTitleUpdate";
3839

3940
const getVideoHeight = (windowWidth: number) => {
4041
let videoHeight;
@@ -102,9 +103,7 @@ const TalkDetail: FC<React.PropsWithChildren<IMeetingDetailProps>> = ({
102103
}) => {
103104
const { width } = useWindowSize();
104105

105-
useEffect(() => {
106-
document.title = `${meeting.title} - DevBcn ${conferenceData.edition}`;
107-
}, [meeting.title]);
106+
useDocumentTitleUpdater(meeting.title, conferenceData.edition);
108107

109108
const finalMeetingInfo: MyType = {
110109
...meeting,

src/2024/Cfp/CfpSection.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe("CfpSection", () => {
99
it("sets document title on mount", () => {
1010
render(<CfpSection2024 />);
1111
expect(document.title).toBe(
12-
`CFP Committee — ${conferenceData.title}${conferenceData.edition}`,
12+
`CFP Committee — DevBcn - Barcelona Developers Conference ${conferenceData.edition}`,
1313
);
1414
});
1515

0 commit comments

Comments
 (0)