We Should Watch - Update 2
Вставка
- Опубліковано 7 лют 2025
- The second video in the series of updates for my We Should Watch... project! In this video I review some updates on the Front End.
1. PosterButton component & PreviewCard component
2. We review the array of objects that we receive on an API call that is passed in as props utilizing the spread operator
3. Interface file where we have some interfaces set up for Typescript
3. PreviewCard:
3a. Ternary operators to set some of the variables appropriately based on what props we get (since we expect some different ones based on the type of media we receive form the API)
3b. Function to modify how we display a description of the media
3c. How we map through an array of numbers representing genres, pass them to a function and return the matching genre name
4. PosterButton
4a. Using the PropsWithChildren type
4b. State handling to display children
4c. Handling modals and backdrops with a fixed position flexbox container
4d. Conditional returns based on whether or not we have a child element
4e. Conditional in a handleClick to prevent event bubbling
5. Trending components with SwiperJS
5a. Setting breakpoints with SwiperJS
5b. useEffect with an async function to call an API
5c. Using params to dynamically set a url for the API call
5d. Conditional returns based on state and props
5e. Transform: Translate3d and its impact on children with Fixed Position
That last one is a biggie