bconnorwhite / local-climbing-route-search

0 stars 0 forks source link

Add page for each problem #9

Open bconnorwhite opened 1 year ago

ghost commented 1 year ago

[!NOTE] Here's an outline for how you might approach this issue:

📋 Add a new page for each climbing problem

The task involves creating a new page for each climbing problem in the application. This will allow users to view detailed information about each problem. The pages should be created using Next.js routing conventions as described in the provided web resource. Here are the steps to follow:
  1. Identify the data structure: Understand the structure of the data in tempData.json. Each object in the routes array represents a climbing problem.

  2. Create a new folder for each problem: For each problem, create a new folder under src/app. The name of the folder should be a unique identifier for the problem, such as the problem's name or ID.

  3. Create a page.tsx file in each folder: In each problem's folder, create a page.tsx file. This file will represent the route for the problem's page.

  4. Define a React component in each page.tsx file: In each page.tsx file, define a React component that displays the problem's details. The details should be fetched from tempData.json based on the problem's unique identifier.

  5. Test the new pages: After creating the pages, test them by navigating to their URLs. The URL for a problem's page should be localhost:3000/[problem's unique identifier].

Remember to commit your changes and push them to the repository when you're done.

- - [ ] **🔬 Understand the structure of the data in `tempData.json`** The first step is to understand the structure of the data in `tempData.json`. This file contains the data for the climbing problems. Each object in the `routes` array represents a climbing problem. Understanding the structure of this data will help in creating a new page for each problem. - - [ ] **🔨 Create a new folder for each problem** For each problem, create a new folder under `src/app`. The name of the folder should be a unique identifier for the problem, such as the problem's name or ID. This will serve as the base for creating a new page for each problem. - - [ ] **🔨 Create a `page.tsx` file in each folder** In each problem's folder, create a `page.tsx` file. This file will represent the route for the problem's page. The `page.tsx` file will contain a React component that displays the problem's details. - - [ ] **🔨 Define a React component in each `page.tsx` file** In each `page.tsx` file, define a React component that displays the problem's details. The details should be fetched from `tempData.json` based on the problem's unique identifier. This will allow users to view detailed information about each problem. - - [ ] **🔬 Research on Next.js routing conventions** Since the task requires the pages to be created using Next.js routing conventions, it's important to understand how Next.js routing works. This will involve researching on how to define routes in Next.js, how to navigate between pages, and how to pass data between pages.