forked from MapComplete/MapComplete
		
	Refactoring: LayoutToUse is a simple value now
This commit is contained in:
		
							parent
							
								
									41a2a79fe9
								
							
						
					
					
						commit
						a78d33112b
					
				
					 22 changed files with 133 additions and 153 deletions
				
			
		|  | @ -3,12 +3,18 @@ import Translations from "../../UI/i18n/Translations"; | |||
| import Locale from "../../UI/i18n/Locale"; | ||||
| import TagRenderingAnswer from "../../UI/Popup/TagRenderingAnswer"; | ||||
| import Combine from "../../UI/Base/Combine"; | ||||
| import LayoutConfig from "../../Models/ThemeConfig/LayoutConfig"; | ||||
| import {ElementStorage} from "../ElementStorage"; | ||||
| 
 | ||||
| export default class TitleHandler { | ||||
|     constructor(state) { | ||||
|     constructor(state : { | ||||
|         selectedElement: UIEventSource<any>, | ||||
|         layoutToUse: LayoutConfig, | ||||
|         allElements: ElementStorage | ||||
|     }) { | ||||
|         const currentTitle: UIEventSource<string> = state.selectedElement.map( | ||||
|             selected => { | ||||
|                 const layout = state.layoutToUse.data | ||||
|                 const layout = state.layoutToUse | ||||
|                 const defaultTitle = Translations.WT(layout?.title)?.txt ?? "MapComplete" | ||||
| 
 | ||||
|                 if (selected === undefined) { | ||||
|  | @ -27,7 +33,7 @@ export default class TitleHandler { | |||
|                     } | ||||
|                 } | ||||
|                 return defaultTitle | ||||
|             }, [Locale.language, state.layoutToUse] | ||||
|             }, [Locale.language] | ||||
|         ) | ||||
| 
 | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue