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

Update UI on the wayfinding page #420

Merged
merged 7 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions packages/map-template/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.60.0] - 2024-12-10

### Added

- Upgrade UI on the Wayfinding page.

## [1.59.0] - 2024-11-26

### Added
Expand Down
24 changes: 13 additions & 11 deletions packages/map-template/src/components/Search/Search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -387,17 +387,19 @@ function Search({ onSetSize, isOpen }) {
{isKioskContext && showLegendButton && <button className='search__legend' onClick={() => setShowLegendDialog(true)}><Legend /></button>}

{ /* Search field that allows users to search for locations (MapsIndoors Locations and external) */}

<SearchField
ref={searchFieldRef}
mapsindoors={true}
placeholder={t('Search by name, category, building...')}
results={locations => onResults(locations)}
clicked={() => searchFieldClicked()}
cleared={() => cleared()}
category={selectedCategory}
disabled={searchDisabled} // Disabled initially to prevent content jumping when clicking and changing sheet size.
/>
<label className="search__label">
<span>{t('Search by name, category, building...')}</span>
<SearchField
ref={searchFieldRef}
mapsindoors={true}
placeholder={t('Search by name, category, building...')}
results={locations => onResults(locations)}
clicked={() => searchFieldClicked()}
cleared={() => cleared()}
category={selectedCategory}
disabled={searchDisabled} // Disabled initially to prevent content jumping when clicking and changing sheet size.
/>
</label>
</div>


Expand Down
7 changes: 6 additions & 1 deletion packages/map-template/src/components/Search/Search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,13 @@
background-color: white;
}

&__label {
span {
display: none;
}
}

@media (max-width: $desktop-breakpoint) {
padding: var(--spacing-medium) var(--spacing-x-small) var(--spacing-medium) var(--spacing-x-small);
}

}
11 changes: 5 additions & 6 deletions packages/map-template/src/components/Wayfinding/Wayfinding.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -402,21 +402,21 @@ function Wayfinding({ onStartDirections, onBack, directionsToLocation, direction
return (
<div className="wayfinding" ref={wayfindingRef}>
<div className="wayfinding__directions">
<div className="wayfinding__title">{t('Start wayfinding')}</div>
<div className="wayfinding__title">{t('Directions')}</div>
<button className="wayfinding__close"
onClick={() => closeWayfinding()}
aria-label="Close">
<CloseIcon />
</button>
<div className="wayfinding__locations">
<label className="wayfinding__label">
{t('From').toUpperCase()}
<span>{t('Choose departure')}</span>
<SearchField
ref={fromFieldRef}
mapsindoors={true}
google={selectedMapType === mapTypes.Google && searchExternalLocations}
mapbox={selectedMapType === mapTypes.Mapbox && searchExternalLocations}
placeholder={t('Search by name, category, building...')}
placeholder={t('Choose departure')}
results={locations => searchResultsReceived(locations, searchFieldIdentifiers.FROM)}
clicked={() => onSearchClicked(searchFieldIdentifiers.FROM)}
cleared={() => onSearchCleared(searchFieldIdentifiers.FROM)}
Expand All @@ -429,20 +429,19 @@ function Wayfinding({ onStartDirections, onBack, directionsToLocation, direction
<SwitchIcon />
</button>
<label className="wayfinding__label">
{t('To').toUpperCase()}
<span>{t('Choose destination')}</span>
<SearchField
ref={toFieldRef}
mapsindoors={true}
google={selectedMapType === mapTypes.Google && searchExternalLocations}
mapbox={selectedMapType === mapTypes.Mapbox && searchExternalLocations}
placeholder={t('Search by name, category, building...')}
placeholder={t('Choose destination')}
results={locations => searchResultsReceived(locations, searchFieldIdentifiers.TO)}
clicked={() => onSearchClicked(searchFieldIdentifiers.TO)}
cleared={() => onSearchCleared(searchFieldIdentifiers.TO)}
changed={() => onInputChanged(searchFieldIdentifiers.TO)}
/>
</label>

</div>
</div>
{!hasFoundRoute && <p className="wayfinding__error">{t('No route found')}</p>}
Expand Down
22 changes: 12 additions & 10 deletions packages/map-template/src/components/Wayfinding/Wayfinding.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.wayfinding {
color: var(--brand-colors-black-100);
display: grid;
grid-template-rows: 238px min-content;
grid-template-rows: 190px min-content;
min-height: 435px;

&__directions {
Expand Down Expand Up @@ -47,14 +47,6 @@
position: relative;
}

&__label {
display: grid;
gap: var(--spacing-x-small);
font-size: var(--font-size-small);
color: var(--color-gray-70);
font-weight: var(--font-weight-large);
}

&__use-current-position {
padding: var(--spacing-medium);
font-size: var(--font-size-medium);
Expand Down Expand Up @@ -169,7 +161,7 @@
background: transparent;
position: absolute;
right: 0;
top: 80px;
top: 40px;

&:hover {
opacity: .8;
Expand All @@ -189,6 +181,12 @@
align-items: center;
}

&__label {
span {
display: none;
}
}

mi-dropdown::part(dropdown-container) {
overflow-y: auto;
left: unset;
Expand All @@ -207,4 +205,8 @@
background: var(--color-gray-10);
border: 1px solid var(--color-gray-30);
}

mi-search {
width: calc(100% - 48px);
}
}
3 changes: 3 additions & 0 deletions packages/map-template/src/i18n/da.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ const da = {
'My position': 'Min position',
'Turn on Accessibility to get directions that avoid stairs and escalators.': 'Slå "Tilgængelig rute" til for at få en rutevejledning uden trapper og rulletrapper.',
'Go!': 'Go!',
'Directions': 'Rutevejledning',
'Choose departure': 'Vælg startpunkt',
'Choose destination': 'Vælg destination',
// Venue selector
'Venues': 'Venues',
'Select venue': 'Vælg venue',
Expand Down
3 changes: 3 additions & 0 deletions packages/map-template/src/i18n/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ const de = {
'My position': 'Meine Position',
'Turn on Accessibility to get directions that avoid stairs and escalators.': 'Schalte Barrierefrei ein, um Treppen und Rolltreppen zu vermeiden.',
'Go!': 'Start!',
'Directions': 'Wegbeschreibung',
'Choose departure': 'Abfahrt wählen',
'Choose destination': 'Ziel wählen',
// Venue selector
'Venues': 'Standorte',
'Select venue': 'Wähle Standort',
Expand Down
3 changes: 3 additions & 0 deletions packages/map-template/src/i18n/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ const en = {
'My position': 'My position',
'Turn on Accessibility to get directions that avoid stairs and escalators.': 'Turn on Accessibility to get directions that avoid stairs and escalators.',
'Go!': 'Go!',
'Directions': 'Directions',
'Choose departure': 'Choose departure',
'Choose destination': 'Choose destination',
// Venue selector
'Venues': 'Venues',
'Select venue': 'Select venue',
Expand Down
3 changes: 3 additions & 0 deletions packages/map-template/src/i18n/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ const es = {
'My position': 'Mi posición',
'Turn on Accessibility to get directions that avoid stairs and escalators.': 'Active Accesibilidad para obtener indicaciones que eviten escalares y escaleras mecánicas',
'Go!': '¡Ir!',
'Directions': 'Instrucciones',
'Choose departure': 'Elige la salida',
'Choose destination': 'Elige destino',
// Venue selector
'Venues': 'Lugares',
'Select venue': 'Seleccionar lugar',
Expand Down
3 changes: 3 additions & 0 deletions packages/map-template/src/i18n/fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ const fr = {
'My position': 'Ma position',
'Turn on Accessibility to get directions that avoid stairs and escalators.': 'Activez l\'accessibilité pour obtenir des itinéraires qui évitent les escaliers.',
'Go!': 'C\'est parti!',
'Directions': 'Instructions',
'Choose departure': 'Choisir le départ',
'Choose destination': 'Choisir la destination',
// Venue selector
'Venues': 'Lieux',
'Select venue': 'Sélectionner le lieu',
Expand Down
3 changes: 3 additions & 0 deletions packages/map-template/src/i18n/it.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ const it = {
'My position': 'La mia posizione',
'Turn on Accessibility to get directions that avoid stairs and escalators.': 'Attiva "Percorso accessibile" per ottenere indicazioni che evitano scale e scale mobili.',
'Go!': 'Vai!',
'Directions': 'Indicazioni',
'Choose departure': 'Scegli la partenza',
'Choose destination': 'Scegli destinazione',
// Venue selector
'Venues': 'Luoghi',
'Select venue': 'Seleziona luogo',
Expand Down
3 changes: 3 additions & 0 deletions packages/map-template/src/i18n/nl.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ const nl = {
'My position': 'Mijn positie',
'Turn on Accessibility to get directions that avoid stairs and escalators.': 'Schakel toegankelijkheid in voor een routebeschrijving waarbij trappen en roltrappen worden vermeden',
'Go!': 'Gaan!',
'Directions': 'Richtingen',
'Choose departure': 'Kies vertrek',
'Choose destination': 'Kies bestemming',
// Venue selector
'Venues': 'Locaties',
'Select venue': 'Kies locatie',
Expand Down
Loading