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
|
@ -2,21 +2,17 @@ import State from "../../State";
|
|||
import Combine from "../Base/Combine";
|
||||
import LanguagePicker from "../LanguagePicker";
|
||||
import Translations from "../i18n/Translations";
|
||||
import {VariableUiElement} from "../Base/VariableUIElement";
|
||||
import Toggle from "../Input/Toggle";
|
||||
import {SubtleButton} from "../Base/SubtleButton";
|
||||
import Svg from "../../Svg";
|
||||
import {UIEventSource} from "../../Logic/UIEventSource";
|
||||
|
||||
export default class ThemeIntroductionPanel extends VariableUiElement {
|
||||
export default class ThemeIntroductionPanel extends Combine {
|
||||
|
||||
constructor(isShown: UIEventSource<boolean>) {
|
||||
const layout = State.state.layoutToUse
|
||||
|
||||
const languagePicker =
|
||||
new VariableUiElement(
|
||||
State.state.layoutToUse.map(layout => LanguagePicker.CreateLanguagePicker(layout.language, Translations.t.general.pickLanguage.Clone()))
|
||||
)
|
||||
;
|
||||
const languagePicker = LanguagePicker.CreateLanguagePicker(layout.language, Translations.t.general.pickLanguage.Clone())
|
||||
|
||||
const toTheMap = new SubtleButton(
|
||||
undefined,
|
||||
|
@ -53,8 +49,7 @@ export default class ThemeIntroductionPanel extends VariableUiElement {
|
|||
State.state.featureSwitchUserbadge
|
||||
)
|
||||
|
||||
|
||||
super(State.state.layoutToUse.map(layout => new Combine([
|
||||
super([
|
||||
layout.description.Clone(),
|
||||
"<br/><br/>",
|
||||
toTheMap,
|
||||
|
@ -63,7 +58,7 @@ export default class ThemeIntroductionPanel extends VariableUiElement {
|
|||
"<br/>",
|
||||
languagePicker,
|
||||
...layout.CustomCodeSnippets()
|
||||
])))
|
||||
])
|
||||
|
||||
this.SetClass("link-underline")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue