diff --git a/app/components/icon.gjs b/app/components/icon.gjs new file mode 100644 index 0000000..58794d8 --- /dev/null +++ b/app/components/icon.gjs @@ -0,0 +1,54 @@ +import Component from '@glimmer/component'; +import { htmlSafe } from '@ember/template'; + +import clock from 'feather-icons/dist/icons/clock.svg?raw'; +import globe from 'feather-icons/dist/icons/globe.svg?raw'; +import home from 'feather-icons/dist/icons/home.svg?raw'; +import map from 'feather-icons/dist/icons/map.svg?raw'; +import mapPin from 'feather-icons/dist/icons/map-pin.svg?raw'; +import navigation from 'feather-icons/dist/icons/navigation.svg?raw'; +import phone from 'feather-icons/dist/icons/phone.svg?raw'; +import user from 'feather-icons/dist/icons/user.svg?raw'; +import settings from 'feather-icons/dist/icons/settings.svg?raw'; + +const ICONS = { + clock, + globe, + home, + map, + mapPin, + navigation, + phone, + user, + settings +}; + +export default class IconComponent extends Component { + get svg() { + return ICONS[this.args.name]; + } + + get size() { + return this.args.size || 16; + } + + get color() { + return this.args.color || '#888'; + } + + get style() { + return `width:${this.size}px;height:${this.size}px;color:${this.color}`; + } + + get title() { + return this.args.title || ''; + } + + +} diff --git a/app/components/place-details.gjs b/app/components/place-details.gjs index 68cf5e7..91d7569 100644 --- a/app/components/place-details.gjs +++ b/app/components/place-details.gjs @@ -2,6 +2,7 @@ import Component from '@glimmer/component'; import { fn } from '@ember/helper'; import { on } from '@ember/modifier'; import capitalize from '../helpers/capitalize'; +import Icon from '../components/icon'; export default class PlaceDetails extends Component { get place() { @@ -129,55 +130,66 @@ export default class PlaceDetails extends Component {
{{#if this.cuisine}} -

Cuisine: {{this.cuisine}}

+

+ Cuisine: + {{this.cuisine}} +

{{/if}} {{#if this.openingHours}} -

Open: {{this.openingHours}}

+

+ + {{this.openingHours}} +

{{/if}} {{#if this.phone}} -

Phone: {{this.phone}}

+

+ + {{this.phone}} +

{{/if}} {{#if this.website}} -

- Website: - - Visit Link - +

+ + Website

{{/if}} {{#if this.wikipedia}}

Wikipedia: - - Article - + Article

{{/if}}
{{#if this.address}} -

Address: {{this.address}}

+

+ + {{this.address}} +

{{/if}} - -

- Geo: - - {{this.visibleGeoLink}} - +

+ + + + {{this.visibleGeoLink}} + +

{{#if this.osmUrl}} -

- OSM ID: - - {{this.place.osmId}} - +

+ + + + OpenStreetMap + +

{{/if}}
diff --git a/app/styles/app.css b/app/styles/app.css index 4672203..14de172 100644 --- a/app/styles/app.css +++ b/app/styles/app.css @@ -223,3 +223,28 @@ body { .ol-touch .ol-control.ol-locate { top: 5.5em; /* Adjust for touch devices where controls might be larger */ } + +span.icon { + display: inline-block; +} + +.icon { + flex-shrink: 0; +} + +.icon svg { + width: 100%; + height: 100%; + stroke: currentColor; + fill: none; + stroke-width: 2; + stroke-linecap: round; + stroke-linejoin: round; +} + +.content-with-icon { + display: flex; + flex-direction: row; + align-items: center; + gap: 0.5rem; +}