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) {
const layout = AllKnownLayouts.allSets[k]
if (layout.hideFromOverview && State.state.osmConnection.userDetails.data.name !== "Pieter Vander Vennet") {
@ -44,14 +62,8 @@ export class MoreScreen extends UIElement {
}
if (layout.name === CustomLayout.NAME) {
if (!State.state.osmConnection.userDetails.data.loggedIn) {
continue;
}
if (State.state.osmConnection.userDetails.data.csCount <
State.userJourney.customLayoutUnlock) {
continue;
}
}
const currentLocation = State.state.locationControl.data;
const linkText =

View file

@ -924,9 +924,9 @@ export default class Translations {
})
},
favourite: {
title: new T({en: "Custom"}),
title: new T({en: "Personal theme"}),
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({
en: "<h3>Your custom theme</h3>Create your own theme here by picking your favourite layers"