WalkingPal / walking-pal-web

WalkingPal Nextjs Website
https://walkingpal.in/
MIT License
21 stars 43 forks source link

feat: implement MUI skeleton for loading assets/ components #136

Open ashuvssut opened 1 year ago

ashuvssut commented 1 year ago

Description

senali-d commented 1 year ago

Hey @ashuvssut, I like to work on this. Can you assign it to me.

senali-d commented 1 year ago

When was the skeleton component need to load.

ashuvssut commented 1 year ago

@senali-d

We have always used our custom Image global component to render images. There are some props like onLoad & onLoadComplete (ref Nextjs docs on next/image for this) that you can use to detect when the image has loaded/failed to load. Implementing a rectangular Skeleton compo must be simple for these image components. You need to implement the Skeleton compo in components/Image.tsx

for gif images, you can always put a conditional to show a skeleton compo and then show the image when it has loaded .

For youtube player, you have to figure out this part. I have not put much thought for this one. Maybe checkout React Player docs to find out if there is a way to detect the loading state.