forked from MapComplete/MapComplete
		
	UX: improve 'move wizard' layout
This commit is contained in:
		
							parent
							
								
									2822eafef6
								
							
						
					
					
						commit
						74b2d38a14
					
				
					 3 changed files with 10 additions and 7 deletions
				
			
		|  | @ -38,6 +38,7 @@ | ||||||
|   import { Utils } from "../../Utils" |   import { Utils } from "../../Utils" | ||||||
|   import Gear from "../../assets/svg/Gear.svelte" |   import Gear from "../../assets/svg/Gear.svelte" | ||||||
|   import { DesktopComputerIcon } from "@rgossiaux/svelte-heroicons/solid" |   import { DesktopComputerIcon } from "@rgossiaux/svelte-heroicons/solid" | ||||||
|  |   import Relocation from "../../assets/svg/Relocation.svelte" | ||||||
| 
 | 
 | ||||||
|   /** |   /** | ||||||
|    * Renders a single icon. |    * Renders a single icon. | ||||||
|  | @ -139,6 +140,8 @@ | ||||||
|     <WifiIcon class={"m-0 " +clss} {color} /> |     <WifiIcon class={"m-0 " +clss} {color} /> | ||||||
|   {:else if icon === "computer"} |   {:else if icon === "computer"} | ||||||
|     <DesktopComputerIcon class={"m-0 "+clss} {color} /> |     <DesktopComputerIcon class={"m-0 "+clss} {color} /> | ||||||
|  |   {:else if icon === "relocation"} | ||||||
|  |     <Relocation class={clss} {color} /> | ||||||
|   {:else if Utils.isEmoji(icon)} |   {:else if Utils.isEmoji(icon)} | ||||||
|     <span style={`font-size: ${emojiHeight}px; line-height: ${emojiHeight}px`}> |     <span style={`font-size: ${emojiHeight}px; line-height: ${emojiHeight}px`}> | ||||||
|       {icon} |       {icon} | ||||||
|  |  | ||||||
|  | @ -23,6 +23,7 @@ | ||||||
|   import BackButton from "../Base/BackButton.svelte" |   import BackButton from "../Base/BackButton.svelte" | ||||||
|   import ChevronLeft from "@babeard/svelte-heroicons/solid/ChevronLeft" |   import ChevronLeft from "@babeard/svelte-heroicons/solid/ChevronLeft" | ||||||
|   import ThemeViewState from "../../Models/ThemeViewState" |   import ThemeViewState from "../../Models/ThemeViewState" | ||||||
|  |   import Icon from "../Map/Icon.svelte" | ||||||
| 
 | 
 | ||||||
|   export let state: ThemeViewState |   export let state: ThemeViewState | ||||||
| 
 | 
 | ||||||
|  | @ -47,7 +48,7 @@ | ||||||
|       location: new UIEventSource({ lon, lat }), |       location: new UIEventSource({ lon, lat }), | ||||||
|       minzoom: new UIEventSource($reason.minZoom), |       minzoom: new UIEventSource($reason.minZoom), | ||||||
|       rasterLayer: state.mapProperties.rasterLayer, |       rasterLayer: state.mapProperties.rasterLayer, | ||||||
|       zoom: new UIEventSource($reason?.startZoom ?? 16), |       zoom: new UIEventSource($reason?.startZoom ?? 16) | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  | @ -84,7 +85,6 @@ | ||||||
|         </span> |         </span> | ||||||
|         <span class="flex flex-col p-2"> |         <span class="flex flex-col p-2"> | ||||||
|           {#if currentStep === "reason" && moveWizardState.reasons.length > 1} |           {#if currentStep === "reason" && moveWizardState.reasons.length > 1} | ||||||
|             <Tr cls="text-lg font-bold" t={t.whyMove} /> |  | ||||||
|             {#each moveWizardState.reasons as reasonSpec} |             {#each moveWizardState.reasons as reasonSpec} | ||||||
|               <button |               <button | ||||||
|                 on:click={() => { |                 on:click={() => { | ||||||
|  | @ -92,7 +92,7 @@ | ||||||
|                   currentStep = "pick_location" |                   currentStep = "pick_location" | ||||||
|                 }} |                 }} | ||||||
|               > |               > | ||||||
|                 <ToSvelte construct={reasonSpec.icon.SetClass("w-16 h-16 pr-2")} /> |                 <Icon icon={reasonSpec.icon} clss="w-12 h-12"/> | ||||||
|                 <Tr t={Translations.T(reasonSpec.text)} /> |                 <Tr t={Translations.T(reasonSpec.text)} /> | ||||||
|               </button> |               </button> | ||||||
|             {/each} |             {/each} | ||||||
|  |  | ||||||
|  | @ -16,7 +16,7 @@ import Location from "../../assets/svg/Location.svelte" | ||||||
| export interface MoveReason { | export interface MoveReason { | ||||||
|     text: Translation | string |     text: Translation | string | ||||||
|     invitingText: Translation | string |     invitingText: Translation | string | ||||||
|     icon: BaseUIElement |     icon: string | ||||||
|     changesetCommentValue: string |     changesetCommentValue: string | ||||||
|     lockBounds: true | boolean |     lockBounds: true | boolean | ||||||
|     includeSearch: false | boolean |     includeSearch: false | boolean | ||||||
|  | @ -48,7 +48,7 @@ export class MoveWizardState { | ||||||
|             reasons.push({ |             reasons.push({ | ||||||
|                 text: t.reasons.reasonRelocation, |                 text: t.reasons.reasonRelocation, | ||||||
|                 invitingText: t.inviteToMove.reasonRelocation, |                 invitingText: t.inviteToMove.reasonRelocation, | ||||||
|                 icon: new SvelteUIElement(Relocation), |                 icon: "relocation", | ||||||
|                 changesetCommentValue: "relocated", |                 changesetCommentValue: "relocated", | ||||||
|                 lockBounds: false, |                 lockBounds: false, | ||||||
|                 background: undefined, |                 background: undefined, | ||||||
|  | @ -62,7 +62,7 @@ export class MoveWizardState { | ||||||
|             reasons.push({ |             reasons.push({ | ||||||
|                 text: t.reasons.reasonInaccurate, |                 text: t.reasons.reasonInaccurate, | ||||||
|                 invitingText: t.inviteToMove.reasonInaccurate, |                 invitingText: t.inviteToMove.reasonInaccurate, | ||||||
|                 icon: new SvelteUIElement(Location), |                 icon: "location", | ||||||
|                 changesetCommentValue: "improve_accuracy", |                 changesetCommentValue: "improve_accuracy", | ||||||
|                 lockBounds: true, |                 lockBounds: true, | ||||||
|                 includeSearch: false, |                 includeSearch: false, | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue