WIP show POI list on click, save to RS
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user