Skip to content

Root: ui|v2.5|src|components|Performers: Performers.tsx

Serechops edited this page Apr 10, 2024 · 1 revision

Performers.tsx

This file contains two React functional components: Performers and PerformerRoutes, responsible for managing routes related to performers in the application.

1. Performers Component:

  • This component is a functional component responsible for rendering the list of performers.
  • It utilizes the useScrollToTopOnMount hook to ensure that the page scrolls to the top when mounted.
  • It renders the PerformerList component, passing PersistanceLevel.ALL as the persistState prop.

2. PerformerRoutes Component:

  • This component is a functional component responsible for defining routes related to performers.
  • It uses the useTitleProps hook to get the title properties for the page and sets them using the Helmet component from react-helmet.
  • It utilizes the Switch component from react-router-dom to render different routes based on the URL path.
    • The route /performers renders the Performers component.
    • The route /performers/new renders the PerformerCreate component, which is responsible for creating a new performer.
    • The route /performers/:id/:tab? renders the Performer component, which is responsible for displaying details of a specific performer. The :id parameter represents the performer's ID, and :tab? is an optional parameter for specifying a tab within the performer details page.

Example Usage:

<PerformerRoutes />

Explanation:

This component should be included in the main routing setup of the application to handle performer-related routes and render the appropriate components based on the URL path.

Clone this wiki locally