WIP show POI list on click, save to RS

This commit is contained in:
2026-01-16 10:47:05 +07:00
parent 46079e96e3
commit 5f6a13386b
9 changed files with 525 additions and 22 deletions

View File

@@ -1,11 +1,18 @@
import Component from '@glimmer/component';
import { pageTitle } from 'ember-page-title';
import Map from '#components/map';
import PlacesSidebar from '#components/places-sidebar';
import { service } from '@ember/service';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
export default class ApplicationComponent extends Component {
@service storage;
@tracked nearbyPlaces = null;
@tracked selectedPlace = null;
@tracked isSidebarOpen = false;
constructor() {
super(...arguments);
console.log('Application component constructed');
@@ -13,10 +20,34 @@ export default class ApplicationComponent extends Component {
this.storage;
}
@action
showPlaces(places, selectedPlace = null) {
this.nearbyPlaces = places;
this.selectedPlace = selectedPlace;
this.isSidebarOpen = true;
}
@action
closeSidebar() {
this.isSidebarOpen = false;
this.nearbyPlaces = null;
this.selectedPlace = null;
}
<template>
{{pageTitle "M/\RCO"}}
<Map />
<Map
@onPlacesFound={{this.showPlaces}}
/>
{{#if this.isSidebarOpen}}
<PlacesSidebar
@places={{this.nearbyPlaces}}
@initialPlace={{this.selectedPlace}}
@onClose={{this.closeSidebar}}
/>
{{/if}}
{{outlet}}
</template>