web client v0.2 (add restaurant OK, settings OK)

This commit is contained in:
2020-09-19 18:16:26 +02:00
parent 732ad74657
commit 68ecf13aa1
16 changed files with 546 additions and 86 deletions

View File

@@ -10,3 +10,26 @@ export function extractTags(tags) {
}
return results;
}
function findInArray(array, string) {
const result = array.indexOf(string) > -1;
return result;
}
export function prepareTags(tags) {
let outTags = {
cardPayments: findInArray(tags, "Płatność kartą"),
petFriendly: findInArray(tags, "Lubimy zwierzaki"),
glutenFree: findInArray(tags, "Bezglutenowe"),
vegan: findInArray(tags, "Wegańskie"),
vegetarian: findInArray(tags, "Wegetariańskie"),
alcohol: findInArray(tags, "Podajemy alkohol"),
delivery: findInArray(tags, "Dowozimy"),
};
return outTags;
}
export const openInNewTab = (url) => {
const newWindow = window.open(url, "_blank", "noopener,noreferrer");
if (newWindow) newWindow.opener = null;
};