ReDI-School / F24-Berlin-Web-Circle

6 stars 1 forks source link

Add CostsSummary component for booking price breakdown. #46

Closed grabinskij closed 1 month ago

grabinskij commented 1 month ago

This pull request introduces the CostsSummary component, which calculates and displays a detailed price breakdown for a booking. The component includes the number of nights, long stay discounts, cleaning fee, Airbnb service fee, and the total price. Currently, the data is static, but it will be replaced with dynamic values in the future.

grabinskij commented 1 month ago

In the original Airbnb functionality, clicking on discount titles or nightly costs opens a popup with additional info. I decided not to implement this yet as I'm unsure if it's necessary. However, I can add this feature by Tuesday if needed. Should I proceed?

grabinskij commented 1 month ago

I created a components folder and placed my CostsSummary component inside it. I'm concerned this might lead to merge conflicts if others on the team also create a components folder. To prevent this, should we establish a specific folder structure or naming conventions?

matus-vacula commented 1 month ago

Nice work on your first feature! Please check how the props work in react. It would already make this component universally reusable.

Regarding your question about the popup I think it's not necessary at this point of time. We can always make a new ticket for it later.

Regarding the components folder, you don't have to worry. You should definitely discuss this in the team slack channel where do you want to put the components. However, if everyone creates the 'components' folder independently, this will actually not create any merge conflicts (as far as I know). Git doesn't really track folders, only files. Folder is just a prefix in the file path. If you would create a folder without any files in it, git would ignore it. You would actually have to create a file in the folder so that the git would keep track of it. If someone wants to keep an empty folder in the git repo, they usually create an empty text file called .gitkeep just so that when somebody checks out the repo from remote, it also creates an empty folder. The conflicts occur only inside of files when they are being edited by multiple people in the same places. This is actually why separating code into multiple files makes it easier for teams to collaborate.

matus-vacula commented 1 month ago

Also, it would be amazing if you could paste a screenshot here in the PR every time when you're working on something visual.

grabinskij commented 1 month ago

Screenshot from 2024-09-23 17-46-28

grabinskij commented 1 month ago

I added the necessary props to the component and disabled the react/prop-types rule in ESLint due to warnings. Should we consider using PropTypes for validation, or is the current approach sufficient?

grabinskij commented 1 month ago

Thanks