EcoRuta Form Redesign: Modernizing the User Interface with a Focus on Dark Mode

Introduction

The EcoRuta form, used for managing certified recycling routes, has undergone a significant redesign. This update focuses on modernizing the user interface, improving the user experience, and adding dark mode support to align with the Landing module's design patterns.

Key Changes

The redesign includes several key improvements:

  • Layout Update: The form now utilizes x-guest-layout instead of x-app-layout. This resolves issues related to duplicate head and body sections, ensuring a cleaner HTML structure.
  • Submit Button Fix: A missing submit button, previously broken due to incorrect @guest and @auth directives, has been re-implemented, restoring full form functionality.
  • Color Palette Alignment: The form's color palette has been updated to match the Landing module. This includes violet buttons and green focus rings, creating a cohesive visual experience.
  • Toggle Switch Implementation: Custom CSS toggle switches, which were previously broken, have been replaced with Alpine.js toggles, offering a more robust and maintainable solution.
  • Google Maps Autocomplete: The Google Maps autocomplete functionality has been improved using an async/defer callback pattern, ensuring proper loading and initialization.
  • Dark Mode Support: Dark mode support has been added, mirroring the Landing module's patterns and providing a consistent user experience across different themes.

Technical Details

The following code snippet demonstrates the updated layout structure:

<x-guest-layout>
    <div class="bg-gray-50 dark:bg-slate-900 min-h-screen">
        <div class="max-w-[1120px] mx-auto px-6 sm:px-8 py-12">
            ...
        </div>
    </div>
</x-guest-layout>

The Alpine.js toggle implementation replaces the previous CSS-based solution, offering improved interactivity and maintainability. The Google Maps integration now uses an async callback to prevent loading issues.

Benefits

  • Improved user experience through a modernized and consistent interface.
  • Enhanced accessibility with the addition of dark mode support.
  • Increased stability and maintainability by replacing custom CSS with Alpine.js components.

Conclusion

This redesign of the EcoRuta form provides a more user-friendly and visually appealing experience while ensuring consistency with the Landing module. The use of Alpine.js and the implementation of dark mode support contribute to a more robust and modern application.

Gerardo Ruiz

Gerardo Ruiz

Author

Share: