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

feat(loader): Created the loader component #34

Merged

Conversation

OluwafisayoIbrahim
Copy link
Collaborator

PR Title:

feat: created a loader component

Description:

This PR introduces a reusable Loader component designed for our Next.js project. The Loader is built using React with TypeScript and styled using Tailwind CSS. It provides a customizable spinner that can be used as a full-screen overlay or inline, depending on the use case.

Changes Included:

  • Loader Component:
  • Accepts three props: fullscreen (boolean, defaults to true): Determines if the loader covers the entire viewport or just a section, message (string, defaults to "Loading, Please wait..."): Displays a customizable loading message, className (string): Allows additional Tailwind classes for further customization.

Usage Examples:

  • Full-screen usage for page-level data loading.
  • Inline usage for section-specific loading states.

Testing:

  • Verified that the Loader overlays the entire screen when fullscreen is true.
  • Confirmed that the loader appears only in a designated container when fullscreen is set to false (with additional positioning classes).
  • Checked that the loading message is customizable via the message prop.
  • Confirmed that the component integrates seamlessly within our existing Next.js pages.

Screenshots:

image

Note:

The component uses inline <style jsx> for the spinner animation keyframes, ensuring compatibility without requiring modifications to the Tailwind config.

Please review and provide feedback. Thanks!

@Joshuafolorunsho Joshuafolorunsho marked this pull request as draft March 6, 2025 12:42
@Joshuafolorunsho Joshuafolorunsho marked this pull request as ready for review March 6, 2025 12:42
@olaoluwajo olaoluwajo merged commit 7b6bdd2 into hngprojects:main Mar 6, 2025
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.

2 participants