forked from MapComplete/MapComplete
Cleaning away fullscreenmessage
This commit is contained in:
parent
977991cced
commit
7f1b78198a
12 changed files with 50 additions and 145 deletions
|
@ -15,8 +15,7 @@ import {TabbedComponent} from "../Base/TabbedComponent";
|
|||
import {UIEventSource} from "../../Logic/UIEventSource";
|
||||
import LayoutConfig from "../../Customizations/JSON/LayoutConfig";
|
||||
import UserDetails from "../../Logic/Osm/OsmConnection";
|
||||
import {FixedUiElement} from "../Base/FixedUiElement";
|
||||
import CombinedInputElement from "../Input/CombinedInputElement";
|
||||
import ScrollableFullScreen from "../Base/ScrollableFullScreen";
|
||||
|
||||
export default class FullWelcomePaneWithTabs extends UIElement {
|
||||
private readonly _layoutToUse: UIEventSource<LayoutConfig>;
|
||||
|
@ -24,7 +23,7 @@ export default class FullWelcomePaneWithTabs extends UIElement {
|
|||
|
||||
private readonly _component: UIElement;
|
||||
|
||||
constructor() {
|
||||
constructor(onClose: () => void) {
|
||||
super(State.state.layoutToUse);
|
||||
this._layoutToUse = State.state.layoutToUse;
|
||||
this._userDetails = State.state.osmConnection.userDetails;
|
||||
|
@ -71,14 +70,13 @@ export default class FullWelcomePaneWithTabs extends UIElement {
|
|||
const tabbedPart = new TabbedComponent(tabs, State.state.welcomeMessageOpenedTab)
|
||||
.ListenTo(this._userDetails);
|
||||
|
||||
const backButton = new Combine([
|
||||
new Combine([Translations.t.general.returnToTheMap.Clone().SetClass("to-the-map")])
|
||||
.SetClass("to-the-map-inner")
|
||||
|
||||
]).SetClass("only-on-mobile")
|
||||
.onClick(() => State.state.fullScreenMessage.setData(undefined));
|
||||
|
||||
|
||||
this._component = new Combine([tabbedPart, backButton]).SetStyle("width:100%;");
|
||||
this._component = new ScrollableFullScreen(
|
||||
layoutToUse.title,
|
||||
tabbedPart,
|
||||
onClose
|
||||
)
|
||||
}
|
||||
|
||||
InnerRender(): string {
|
||||
|
|
|
@ -11,7 +11,7 @@ export default class LayerControlPanel extends UIElement {
|
|||
private readonly _panel: UIElement;
|
||||
|
||||
|
||||
constructor() {
|
||||
constructor(onClose: () => void) {
|
||||
super();
|
||||
let layerControlPanel: UIElement = new FixedUiElement("");
|
||||
if (State.state.layoutToUse.data.enableBackgroundLayerSelection) {
|
||||
|
@ -31,7 +31,9 @@ export default class LayerControlPanel extends UIElement {
|
|||
|
||||
const title =Translations.t.general.layerSelection.title.SetClass("featureinfobox-title")
|
||||
|
||||
this._panel = new ScrollableFullScreen(title, layerControlPanel);
|
||||
this._panel = new ScrollableFullScreen(title, layerControlPanel, () => {
|
||||
onClose
|
||||
});
|
||||
}
|
||||
|
||||
InnerRender(): string {
|
||||
|
|
|
@ -37,7 +37,7 @@ export default class SimpleAddUI extends UIElement {
|
|||
private readonly goToInboxButton: UIElement = new SubtleButton(Svg.envelope_ui(),
|
||||
Translations.t.general.goToInbox, {url: "https://www.openstreetmap.org/messages/inbox", newTab: false});
|
||||
|
||||
constructor() {
|
||||
constructor(onClose: () => void) {
|
||||
super(State.state.locationControl.map(loc => loc.zoom));
|
||||
const self = this;
|
||||
this.ListenTo(Locale.language);
|
||||
|
@ -61,17 +61,17 @@ export default class SimpleAddUI extends UIElement {
|
|||
this.openLayerControl = new SubtleButton(Svg.layers_ui(),
|
||||
Translations.t.general.add.openLayerControl
|
||||
).onClick(() => {
|
||||
State.state.fullScreenMessage.setData(undefined);
|
||||
State.state.layerControlIsOpened.setData(true);
|
||||
})
|
||||
|
||||
this._component = new ScrollableFullScreen(
|
||||
Translations.t.general.add.title,
|
||||
this.CreateContent(),
|
||||
onClose
|
||||
);
|
||||
}
|
||||
|
||||
InnerRender(): string {
|
||||
|
||||
this._component = new ScrollableFullScreen(
|
||||
Translations.t.general.add.title,
|
||||
this.CreateContent()
|
||||
)
|
||||
return this._component.Render();
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue