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

Refactor into components and add global state management #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

friuns2
Copy link
Owner

@friuns2 friuns2 commented Jun 24, 2024

Refactors the application by splitting the logic into separate components and introducing global state management.

  • Introduces state.js: Adds a new file composables/state.js implementing global state management using useState from Nuxt 3. This file manages attractions and homeLocation states.
  • Adds new components: Creates MapComponent.vue, AttractionListComponent.vue, and ItineraryComponent.vue with <script setup> syntax. Each component is responsible for a specific part of the application:
    • MapComponent initializes the map, updates attractions, and handles marker creation.
    • AttractionListComponent manages the display of attractions based on sorted and filtered data.
    • ItineraryComponent displays the itinerary and allows for recalculating directions.
  • Updates index.vue: Refactors pages/index.vue to use the new components, passing the necessary props for functionality. Removes previously integrated logic for map, attraction list, and itinerary management, leveraging the new component-based structure and global state.

For more details, open the Copilot Workspace session.

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.

1 participant