LetsGetTechnical / gridiron-survivor

https://gridiron-survivor-letsgettechnical.vercel.app
15 stars 1 forks source link

Update teamLogo picture #423

Open vmaineng opened 3 months ago

vmaineng commented 3 months ago

Currently showing old teamLogos:

Image

This is what the teamLogos should look like:

Image

vmaineng commented 2 months ago

In WeekTeams, logos come from the schedule data (competition.team.logo). In LeagueEntries, the logo comes from a prop (teamLogo), likely set based on the user's pick

vmaineng commented 2 months ago

Essentially, the 'Entry' and 'WeekTeams' components are grabbing data from different information hence why the teamLogos do not match up.

Here is what I'm thinking of doing to correct this:

1) Store the schedule data in the Zustand store

const useScheduleStore = create((set) => ({ schedule: [], loading: true, fetchSchedule: async () => { set({ loading: true }); try { const schedule = await getSchedule(); set({ schedule, loading: false }); } catch (error) { console.error('Error fetching schedule:', error); set({ loading: false }); } }, }));

2) then call the functions in 'Entry' and 'WeekTeams' components Am I on the right track with this?

vmaineng commented 2 months ago

Please see the research conducted to ensure teamLogo is correctly pulled from Appwrite's collection: https://docs.google.com/document/d/1GCK2R5l4sO2ILc7edXSHUJY5uGmZBUiHpUyFYKd_4ho/edit?usp=sharing