-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathSpeakerDetailContainer2023.tsx
More file actions
51 lines (46 loc) · 1.62 KB
/
Copy pathSpeakerDetailContainer2023.tsx
File metadata and controls
51 lines (46 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import { Color } from "../../styles/colors";
import React, { FC } from "react";
import SectionWrapper from "../../components/SectionWrapper/SectionWrapper";
import SpeakerDetail2023 from "./SpeakerDetail2023";
import { useParams } from "react-router";
import { StyledContainer, StyledWaveContainer } from "./Speaker.style";
import conferenceData from "../../data/2023.json";
import { useFetchSpeakers } from "../Speakers/UseFetchSpeakers";
import * as Sentry from "@sentry/react";
const SpeakerDetailContainer2023: FC<React.PropsWithChildren<unknown>> = () => {
const { id } = useParams<{ id: string }>();
const { isLoading, error, data } = useFetchSpeakers(id);
if (error) {
Sentry.captureException(error);
}
React.useEffect(() => {
if (data) {
document.title = `${data[0]?.fullName} - DevBcn - ${conferenceData.edition}`;
}
}, [id, data]);
return (
<StyledContainer>
<SectionWrapper color={Color.BLUE} marginTop={4}>
{isLoading && <h2>Loading</h2>}
{!isLoading && data && data.length > 0 ? (
<SpeakerDetail2023 speaker={data[0]} />
) : (
"not found"
)}
</SectionWrapper>
<StyledWaveContainer>
<svg
viewBox="0 0 500 150"
preserveAspectRatio="none"
style={{ height: "100%", width: "100%" }}
>
<path
d="M-8.17,75.50 C207.95,-129.75 329.85,202.80 500.27,5.45 L501.41,-5.41 L0.00,0.00 Z"
style={{ stroke: "none", fill: "#0496ff" }}
></path>
</svg>
</StyledWaveContainer>
</StyledContainer>
);
};
export default SpeakerDetailContainer2023;