Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added loading feature #93

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

disvid
Copy link
Collaborator

@disvid disvid commented Jan 4, 2025

Related Issue

Closes #76

Type of Change

Put x inside the square bracket to specify what type of change your PR is:

  • New Feature
  • Bug Fix
  • Code Refactor
  • Documentation Update
  • Other (please specify):

Description of Change

Hence, add a spinning loading circle which instructs the users to wait for the tickets to be loaded.

Implementation Details

Required changes have been made in NoTicketExistsCard.jsx file.

Demo

Screencast from 2025-01-03 01-04-38.webm
Screencast from 2025-01-03 01-08-15.webm

@AyushDharDubey
Copy link
Collaborator

can you provide the prove of solution?
i can see that it is only adding a timeout of 2 sec for displaying a loading animation before actually rendering the tickets or NoTicketExistsCard

@AyushDharDubey
Copy link
Collaborator

what we actually need is to display a loading animation until:

  • the getTickets() api call returns a valid array of tickets
  • or a timeout of n seconds is reached (whichever happens first)

check if the data object contains a valid array (Array.isArray(data?.tickets)).
If the data is invalid, set the state to empty arrays setTickets([]) and display the NoTicketExistCard
we should edit app/page.jsx instead of NoTicketExistCard
this way, extra loading time can be avoided if the tickets are loaded before 2 sec

@disvid
Copy link
Collaborator Author

disvid commented Jan 8, 2025

@AyushDharDubey done sir , please check the changes, and please assign me issue#69 and issue#49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add loading message when we are fetching tickets on home page
2 participants