Skip to content

Commit 5ea47a8

Browse files
refactor: remove duplication on fetch speaker logic (#680)
remove duplication on fetch speaker logic --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent f49aebc commit 5ea47a8

File tree

64 files changed

+2384
-2393
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+2384
-2393
lines changed

.junie/guidelines.md

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# DevBcn - Barcelona Developers Conference Website
2+
3+
## Project Overview
4+
5+
This repository contains the official website for the Barcelona Developers Conference (DevBcn), a tech conference held in Barcelona, Spain. The website serves as the primary platform for conference information, including schedules, speaker profiles, talk details, venue information, and registration.
6+
7+
## Technology Stack
8+
9+
- **Frontend Framework**: React 18 with TypeScript
10+
- **Routing**: React Router
11+
- **Data Fetching**: React Query and Axios
12+
- **Styling**: Styled Components and SASS
13+
- **UI Components**: PrimeReact, Swiper, Framer Motion
14+
- **Maps Integration**: Google Map React
15+
- **Testing**: Jest, React Testing Library
16+
- **Deployment**: GitHub Pages
17+
18+
## Project Structure
19+
20+
The project follows a standard React application structure:
21+
22+
- `src/`: Source code
23+
- `assets/`: Static assets like images
24+
- `components/`: Reusable UI components
25+
- `hooks/`: Custom React hooks (e.g., useFetchSpeakers, useFetchTalks)
26+
- `views/`: Page components
27+
- `2024/`: Components specific to the 2024 conference
28+
29+
## Development Workflow
30+
31+
### Getting Started
32+
33+
1. Clone the repository
34+
2. Install dependencies with `npm install`
35+
3. Start the development server with `npm start`
36+
4. View the site at http://localhost:3000
37+
38+
### Available Scripts
39+
40+
- `npm start`: Run the development server
41+
- `npm test`: Run tests
42+
- `npm run test-coverage`: Run tests with coverage reporting
43+
- `npm run build`: Build for production
44+
- `npm run deploy`: Deploy to GitHub Pages
45+
46+
## Contribution Guidelines
47+
48+
When contributing to this project, please:
49+
50+
1. Follow the existing code style and patterns
51+
2. Write tests for new features
52+
3. Ensure all tests pass before submitting pull requests
53+
4. Keep the UI consistent with the existing design
54+
5. Document any new components or significant changes
55+
56+
## Contact
57+
58+
For questions or issues related to the DevBcn website, please open an issue in this repository.
59+
60+
Visit the live site at [https://www.devbcn.com](https://www.devbcn.com)

README.md

+48-30
Original file line numberDiff line numberDiff line change
@@ -2,51 +2,69 @@
22

33
![](src/assets/images/1500x500.jpeg)
44

5-
# Barcelona Developers Conference - DevBcn
5+
# DevBcn - Barcelona Developers Conference Website
66

7-
## Getting Started with Create React App
7+
## Project Overview
88

9-
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
9+
This repository contains the official website for the Barcelona Developers
10+
Conference (DevBcn), a tech conference held in Barcelona, Spain. The website
11+
serves as the primary platform for conference information, including schedules,
12+
speaker profiles, talk details, venue information, and registration.
1013

11-
### Available Scripts
12-
13-
In the project directory, you can run:
14-
15-
#### `npm start`
14+
## Technology Stack
1615

17-
Runs the app in the development mode.\
18-
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
16+
- **Frontend Framework**: React 18 with TypeScript
17+
- **Routing**: React Router
18+
- **Data Fetching**: React Query and Axios
19+
- **Styling**: Styled Components and SASS
20+
- **UI Components**: PrimeReact, Swiper, Framer Motion
21+
- **Maps Integration**: Google Map React
22+
- **Testing**: Jest, React Testing Library
23+
- **Deployment**: GitHub Pages
1924

20-
The page will reload if you make edits.\
21-
You will also see any lint errors in the console.
25+
## Project Structure
2226

23-
#### `npm test`
27+
The project follows a standard React application structure:
2428

25-
Launches the test runner in the interactive watch mode.\
26-
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
29+
- `src/`: Source code
30+
- `assets/`: Static assets like images
31+
- `components/`: Reusable UI components
32+
- `hooks/`: Custom React hooks (e.g., useFetchSpeakers, useFetchTalks)
33+
- `views/`: Page components
34+
- `2024/`: Components specific to the 2024 conference edition
35+
- `2023/`: Components specific to the 2023 conference edition
2736

28-
#### `npm run build`
37+
## Development Workflow
2938

30-
Builds the app for production to the `build` folder.\
31-
It correctly bundles React in production mode and optimizes the build for the best performance.
39+
### Getting Started
3240

33-
The build is minified and the filenames include the hashes.\
34-
Your app is ready to be deployed!
41+
1. Clone the repository
42+
2. Install dependencies with `npm install`
43+
3. Start the development server with `npm start`
44+
4. View the site at http://localhost:3000
3545

36-
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
37-
38-
#### `npm run eject`
46+
### Available Scripts
3947

40-
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
48+
- `npm start`: Run the development server
49+
- `npm test`: Run tests
50+
- `npm run test-coverage`: Run tests with coverage reporting
51+
- `npm run build`: Build for production
52+
- `npm run deploy`: Deploy to GitHub Pages
53+
- `npm run eject`: Eject from Create React App (not recommended)
4154

42-
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
55+
## Contribution Guidelines
4356

44-
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
57+
When contributing to this project, please:
4558

46-
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
59+
1. Follow the existing code style and patterns
60+
2. Write tests for new features
61+
3. Ensure all tests pass before submitting pull requests
62+
4. Keep the UI consistent with the existing design
63+
5. Document any new components or significant changes
4764

48-
### Learn More
65+
## Contact
4966

50-
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
67+
For questions or issues related to the DevBcn website, please open an issue in
68+
this repository.
5169

52-
To learn React, check out the [React documentation](https://reactjs.org/).
70+
Visit the live site at [https://www.devbcn.com](https://www.devbcn.com)

src/2023/Diversity/Diversity.test.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe("Diversity component", () => {
1111
<Route path={"*"} element={<Diversity2023 />} />
1212
</Routes>
1313
</React.Suspense>,
14-
{ wrapper: BrowserRouter }
14+
{ wrapper: BrowserRouter },
1515
);
1616
const headingElement = screen.getByText("Diversity Sponsorship");
1717
expect(headingElement).toBeInTheDocument();
@@ -24,10 +24,10 @@ describe("Diversity component", () => {
2424
<Route path={"*"} element={<Diversity2023 />} />
2525
</Routes>
2626
</React.Suspense>,
27-
{ wrapper: BrowserRouter }
27+
{ wrapper: BrowserRouter },
2828
);
2929
const paragraphElement = screen.getByText(
30-
/DevBcn, its volunteers, and staff consider that understanding/i
30+
/DevBcn, its volunteers, and staff consider that understanding/i,
3131
);
3232
expect(paragraphElement).toBeInTheDocument();
3333
});
@@ -39,7 +39,7 @@ describe("Diversity component", () => {
3939
<Route path={"*"} element={<Diversity2023 />} />
4040
</Routes>
4141
</React.Suspense>,
42-
{ wrapper: BrowserRouter }
42+
{ wrapper: BrowserRouter },
4343
);
4444
const vepeeLogo = screen.getByAltText("Vepee");
4545
const adevintaLogo = screen.getByAltText("Adevinta");

src/2023/Diversity/Diversity2023.tsx

+26-26
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@ import {
1010
} from "../../constants/routes";
1111

1212
const StyledSection = styled.section`
13-
{
13+
{
1414
padding-top: 48px;
15-
}
15+
}
1616
17-
.top {
18-
clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 50px));
19-
height: 51px;
20-
background-color: ${Color.DARK_BLUE};
21-
border-top: 1px solid ${Color.DARK_BLUE};
22-
}
17+
.top {
18+
clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 50px));
19+
height: 51px;
20+
background-color: ${Color.DARK_BLUE};
21+
border-top: 1px solid ${Color.DARK_BLUE};
22+
}
2323
24-
.bottom {
25-
clip-path: polygon(0 0, 100% 50px, 100% 100%, 0 100%);
26-
margin-top: -50px;
27-
height: 50px;
28-
background-color: ${Color.WHITE};
29-
}
24+
.bottom {
25+
clip-path: polygon(0 0, 100% 50px, 100% 100%, 0 100%);
26+
margin-top: -50px;
27+
height: 50px;
28+
background-color: ${Color.WHITE};
29+
}
3030
`;
3131

3232
const StyledWave = styled.section`
@@ -36,15 +36,15 @@ const StyledWave = styled.section`
3636
`;
3737

3838
const StyledLogo = styled.img`
39-
{
39+
{
4040
max-width: 30vw;
4141
flex: 2 1 auto;
4242
padding-bottom: 50px;
43-
}
44-
@media only screen and (max-width: ${BIG_BREAKPOINT}px) {
45-
padding-bottom: 20px;
46-
max-width: 65vw;
47-
}
43+
}
44+
@media only screen and (max-width: ${BIG_BREAKPOINT}px) {
45+
padding-bottom: 20px;
46+
max-width: 65vw;
47+
}
4848
`;
4949

5050
const Heading = styled.h1`
@@ -68,17 +68,17 @@ const StyledP = styled.p`
6868
`;
6969

7070
const FlexDiv = styled.div`
71-
{
71+
{
7272
display: flex;
7373
width: 20%;
7474
margin: 0 auto;
7575
flex-direction: column;
7676
padding-bottom: 20px;
77-
}
78-
@media only screen and (max-width: ${BIG_BREAKPOINT}px) {
79-
width: 60%;
80-
padding-bottom: 0.5rem;
81-
}
77+
}
78+
@media only screen and (max-width: ${BIG_BREAKPOINT}px) {
79+
width: 60%;
80+
padding-bottom: 0.5rem;
81+
}
8282
`;
8383

8484
const StyledParagraph = styled.section`

src/2023/Home/components/SpeakersCarousel/SpeakerSwiper.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import "swiper/swiper-bundle.min.css";
77
import "./SpeakersCarousel.scss";
88
import { Link } from "react-router";
99
import { ROUTE_SPEAKER_DETAIL } from "../../../../constants/routes";
10-
import { useFetchSpeakers } from "../../../Speakers/UseFetchSpeakers";
10+
import { useFetchSpeakers } from "../../../../hooks/useFetchSpeakers";
1111
import * as Sentry from "@sentry/react";
1212

1313
const StyledSlideImage = styled.img`
@@ -35,7 +35,7 @@ const StyledSlideText = styled.p`
3535
color: white;
3636
`;
3737
const SpeakerSwiper: FC<React.PropsWithChildren<unknown>> = () => {
38-
const { isLoading, data, error } = useFetchSpeakers();
38+
const { isLoading, data, error } = useFetchSpeakers("2023");
3939

4040
const swiperSpeakers = data?.sort(() => 0.5 - Math.random()).slice(0, 20);
4141

src/2023/SessionFeedback/SessionFeedback2023.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ import { ROUTE_TALK_DETAIL } from "../../constants/routes";
1818

1919
const SessionFeedback2023: FC<React.PropsWithChildren<unknown>> = () => {
2020
const bodyTemplate = React.useCallback(
21-
(field: keyof MeasurableSessionRating) => (session: SessionRating) =>
22-
<Rating value={session[field]} readOnly cancel={false} />,
23-
[]
21+
(field: keyof MeasurableSessionRating) => (session: SessionRating) => (
22+
<Rating value={session[field]} readOnly cancel={false} />
23+
),
24+
[],
2425
);
2526

2627
const TitleTemplate = (session: SessionRating) =>

src/2023/SpeakerDetail/SpeakerDetailContainer2023.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import SpeakerDetail2023 from "./SpeakerDetail2023";
66
import { useParams } from "react-router";
77
import { StyledContainer, StyledWaveContainer } from "./Speaker.style";
88
import conferenceData from "../../data/2023.json";
9-
import { useFetchSpeakers } from "../Speakers/UseFetchSpeakers";
9+
import { useFetchSpeakers } from "../../hooks/useFetchSpeakers";
1010
import * as Sentry from "@sentry/react";
1111

1212
const SpeakerDetailContainer2023: FC<React.PropsWithChildren<unknown>> = () => {
1313
const { id } = useParams<{ id: string }>();
1414

15-
const { isLoading, error, data } = useFetchSpeakers(id);
15+
const { isLoading, error, data } = useFetchSpeakers("2023", id);
1616

1717
if (error) {
1818
Sentry.captureException(error);

0 commit comments

Comments
 (0)