ucsb-cs156-f23 / team03-f23-5pm-3

https://ucsb-cs156-f23.github.io/team03-f23-5pm-3/
0 stars 0 forks source link

Copy Placeholders for `MenuItemReview` pages; add to App.js/AppNavbar.js #39

Open github-actions[bot] opened 11 months ago

github-actions[bot] commented 11 months ago

Dependencies

None: can be done in parallel with other issues

Discussion

In this issue, you'll set up placeholders for the three pages you are adding to the app.

These placeholder components are temporary, but they are necessary so that you can add routes to the pages in frontend/src/App.js and add a link to the /menuitemreview name in to the Navigation Bar of the app in frontend/src/components/AppNavbar.js.

Note that the contents of the placeholder pages and tests are temporary, and will be replaced in a later issue. However, the changes you make in App.js and AppNavbar.js will be permanent.

The reason for the placeholder code is that we can't really test the changes to App.js and AppNavbar.js until at least some placeholder component for the pages exists, and we can't really test the new pages unless they are routed to in the app. The placeholder solves this "chicken/egg" problem.

Acceptance Criteria

Implementation Steps

Notes

The changes you will need to make from the examples are minimal.

In the three page components, typically you will only need to change the name of the default export, changing Placeholder to MenuItemReview

export default function PlaceholderCreatePage() {

In App.js, you will need to:

{
      hasRole(currentUser, "ROLE_USER") && (
        <>
          <Route exact path="/restaurants" element={<RestaurantIndexPage />} />
        </>
      )
}
{
      hasRole(currentUser, "ROLE_ADMIN") && (
        <>
          <Route exact path="/restaurants/edit/:id" element={<RestaurantEditPage />} />
          <Route exact path="/restaurants/create" element={<RestaurantCreatePage />} />
        </>
      )
}

In AppNavbar.js, copy/paste this section of code, and change /restaurants to /menuitemreview and Restaurants to MenuItemReview:

{
      hasRole(currentUser, "ROLE_USER") && (
        <>
          <Nav.Link as={NavLink} to="/restaurants">Restaurants</Nav.Link>
        </>
      )
}

Reminders (all from frontend directory):

What to do next