svcsa-dev / svcsa-react

0 stars 0 forks source link

code of teamlist #10

Closed vivian0420 closed 6 months ago

vivian0420 commented 6 months ago

Pull Request

Added /teams router and TeamList Component

Description

Commit: code of teamlist:

  1. Built /teams router under /[competition]
  2. Created TeamList Component
  3. Implemented the URL query parameter 'season={id}' under the teams router

Commit: refactored the TeamCard component from the TeamList component:

  1. Created TeamCard component from the TeamList component

Commit: Fixed the team logo uploading issues:

  1. If a team logo uploading issue occurs, utilize the first letter of the team name to replace the team logo.

Commit: Added key prop for each teamCard:

  1. Added key prop to teamCard to get rid of the error => 'missing "key" prop for element in iterator'
umliuxin commented 6 months ago

Build is failing due to some issues like

i [Error]: Page with `dynamic = "error"` couldn't be rendered statically because it used `searchParams.season`.
    at s (/github/workspace/.next/server/chunks/248.js:1:98315)
    at Object.get (/github/workspace/.next/server/chunks/248.js:1:97442)
    at m (/github/workspace/.next/server/app/basketball/[competition]/teams/page.js:1:[566](https://github.com/svcsa-dev/svcsa-react/actions/runs/8806973560/job/24172961171#step:4:567)2) {
  code: 'NEXT_STATIC_GEN_BAILOUT'
}

This is due to some issue in the SSR mode. In the build time, the app will generate static pages, which is not working with search params.

I am not expert in this either, encourage you to try to figure out the Next.js doc to see if you can solve it

vivian0420 commented 6 months ago

I have addressed the build errors and optimized the code according to the comments provided earlier. Please review the changes.