realm-of-ra / mancala

https://meowing-anteater-cee.notion.site/Mancala-Game-MVP-7521e2f2e5294575b33b17601afde810
MIT License
9 stars 23 forks source link

feat: implementation of logic for a user duels #110

Closed EjembiEmmanuel closed 6 days ago

vercel[bot] commented 1 week ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mancala ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 23, 2024 8:10pm
mancala-pkco ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 23, 2024 8:10pm
supreme2580 commented 1 week ago

Hi @EjembiEmmanuel I just reviewed your PR and I love it but there's this concern

image

A fix I suggest is to remove

bg-[#16181D]

from this line (line 71 on duels-lobby.tsx)

<tbody className="absolute h-[450px] w-[814px] overflow-y-scroll bg-[#16181D]">

image

For this, the issue seems to be this line (line 93 in duels-lobby.tsx)

const isLast = index === player_stats.length - 1;

player_stats is a static data set we created for testing purposes now you're fetching live data I advice you use

const isLast = index === data.length - 1;

instead, but this naming will cause an issue

{data ? data.map((data: any, index: number) => {
     const isLast = index === data.length - 1;
      const date = new Date(data.date)

Because to get the last item you need to know the size of the full array (data.length) but your code is naming the full array and an item of it "data" and isLast cannot reach the full array to calculate if the particular item is the last item, I suggest you rename the inner data to something else like item

Also implement isLast logic for the bottom border of your loading skeleton