Add button to create a custom theme

This commit is contained in:
Pieter Vander Vennet 2020-08-24 20:24:53 +02:00
parent 5d1754bcd6
commit 3b3c8f3b55
2 changed files with 20 additions and 8 deletions

View file

@ -34,6 +34,24 @@ export class MoreScreen extends UIElement {
}) })
)); ));
els.push(new VariableUiElement(
State.state.osmConnection.userDetails.map(userDetails => {
if (userDetails.csCount < State.userJourney.customLayoutUnlock) {
return "";
}
return new SubtleButton("./assets/star.svg",
new Combine([
"<b>",
Translations.t.favourite.title,
"</b>",
"<br>", Translations.t.favourite.description]), {
url: "https://pietervdvn.github.io/MapComplete/personal.html",
newTab: false
}).Render();
})
));
for (const k in AllKnownLayouts.allSets) { for (const k in AllKnownLayouts.allSets) {
const layout = AllKnownLayouts.allSets[k] const layout = AllKnownLayouts.allSets[k]
if (layout.hideFromOverview && State.state.osmConnection.userDetails.data.name !== "Pieter Vander Vennet") { if (layout.hideFromOverview && State.state.osmConnection.userDetails.data.name !== "Pieter Vander Vennet") {
@ -44,13 +62,7 @@ export class MoreScreen extends UIElement {
} }
if (layout.name === CustomLayout.NAME) { if (layout.name === CustomLayout.NAME) {
if (!State.state.osmConnection.userDetails.data.loggedIn) {
continue; continue;
}
if (State.state.osmConnection.userDetails.data.csCount <
State.userJourney.customLayoutUnlock) {
continue;
}
} }
const currentLocation = State.state.locationControl.data; const currentLocation = State.state.locationControl.data;

View file

@ -924,9 +924,9 @@ export default class Translations {
}) })
}, },
favourite: { favourite: {
title: new T({en: "Custom"}), title: new T({en: "Personal theme"}),
description: new T({ description: new T({
en: "<h3>Your custom theme</h3>In your custom theme, you can add some favourite layers from other themes to create a custom theme." en: "Add favourite layers from other themes to create a custom theme."
}), }),
panelIntro: new T({ panelIntro: new T({
en: "<h3>Your custom theme</h3>Create your own theme here by picking your favourite layers" en: "<h3>Your custom theme</h3>Create your own theme here by picking your favourite layers"