enrecipes/app/components/settings/About.vue

115 lines
3.1 KiB
Vue
Raw Normal View History

2021-03-21 17:02:04 +00:00
<template>
2021-06-15 11:04:42 +00:00
<Page @loaded="pgLoad" actionBarHidden="true">
<RGridLayout :rtl="RTL" rows="*, auto" columns="auto, *">
<ListView rowSpan="2" colSpan="2" class="options" for="item in items">
2021-04-01 10:55:35 +00:00
<v-template if="$index == 0">
2021-06-18 12:52:03 +00:00
<Label class="pTitle tw tb" :text="'About' | L" />
2021-04-01 10:55:35 +00:00
</v-template>
<v-template if="$index == 1">
2021-06-18 18:37:01 +00:00
<StackLayout class="appInfo">
<Image class="logo" src="res://logo" stretch="none" />
2021-06-18 12:52:03 +00:00
<Label class="name tb tc" :text="'EnRecipes' | L" />
2021-06-18 18:37:01 +00:00
<Label :text="getVersion" class="tb tc" />
2021-03-21 17:02:04 +00:00
2021-06-18 18:37:01 +00:00
<Label class="info tc tw lh4" :text="'appInfo' | L" />
2021-04-01 10:55:35 +00:00
</StackLayout>
</v-template>
2021-04-12 18:09:48 +00:00
<v-template if="$index == 8">
2021-06-18 18:37:01 +00:00
<StackLayout class="ls"> </StackLayout>
2021-04-01 10:55:35 +00:00
</v-template>
2021-03-21 17:02:04 +00:00
<v-template>
2021-06-15 11:04:42 +00:00
<RGridLayout
:rtl="RTL"
2021-03-21 17:02:04 +00:00
columns="auto, *"
2021-04-01 10:55:35 +00:00
class="option"
@touch="touch($event, item.url)"
2021-03-21 17:02:04 +00:00
>
2021-06-15 11:04:42 +00:00
<Label
class="ico"
:class="{ rtl: /help|don/.test(item.icon) }"
:text="icon[item.icon]"
/>
<Label col="1" class="info" :text="item.title | L" />
</RGridLayout>
2021-03-21 17:02:04 +00:00
</v-template>
</ListView>
2021-06-15 11:04:42 +00:00
<GridLayout row="1" class="appbar rtl" rows="*" columns="auto, *">
2021-04-12 18:09:48 +00:00
<Button class="ico" :text="icon.back" @tap="$navigateBack()" />
2021-04-01 10:55:35 +00:00
</GridLayout>
2021-06-18 12:52:03 +00:00
<Label rowSpan="2" class="edge hal rtl" @swipe="swipeBack" />
<Label
rowSpan="2"
colSpan="2"
class="edge har rtl f"
@swipe="swipeBack"
/>
2021-06-15 11:04:42 +00:00
</RGridLayout>
2021-03-21 17:02:04 +00:00
</Page>
</template>
<script>
import { Application, Observable, Utils } from "@nativescript/core";
import { mapState } from "vuex";
export default {
computed: {
2021-06-15 11:04:42 +00:00
...mapState(["icon", "RTL"]),
2021-03-21 17:02:04 +00:00
items() {
return [
2021-04-01 10:55:35 +00:00
{},
{},
2021-03-21 17:02:04 +00:00
{
icon: "gh",
title: "gh",
url: "https://github.com/vishnuraghavb/EnRecipes",
},
2021-04-12 18:09:48 +00:00
{
icon: "tg",
title: "joinTG",
url: "https://t.me/enrecipes",
},
{
icon: "help",
title: "guide",
2021-04-23 14:49:27 +00:00
url: "https://github.com/vishnuraghavb/EnRecipes/wiki/User-Guide",
2021-04-12 18:09:48 +00:00
},
2021-04-01 10:55:35 +00:00
{
icon: "priv",
title: "priv",
2021-06-15 11:04:42 +00:00
url: "https://github.com/vishnuraghavb/EnRecipes/blob/main/PRIVACY.md",
2021-04-01 10:55:35 +00:00
},
2021-03-21 17:02:04 +00:00
{
icon: "don",
title: "donate",
url: "https://www.vishnuraghav.com/donate",
},
{
icon: "trans",
title: "trnsl",
url: "https://hosted.weblate.org/projects/enrecipes/app-translations",
},
2021-04-01 10:55:35 +00:00
{},
2021-03-21 17:02:04 +00:00
];
},
getVersion() {
let ctx = Application.android.context;
return (
"v" +
ctx.getPackageManager().getPackageInfo(ctx.getPackageName(), 0)
.versionName
);
},
},
methods: {
2021-06-15 11:04:42 +00:00
pgLoad({ object }) {
2021-05-25 14:32:53 +00:00
object.bindingContext = new Observable();
2021-03-21 17:02:04 +00:00
},
2021-04-01 10:55:35 +00:00
touch({ object, action }, url) {
2021-06-18 12:52:03 +00:00
this.touchFade(object, action);
2021-06-18 18:37:01 +00:00
if (action == "up") Utils.openUrl(url);
2021-04-01 10:55:35 +00:00
},
2021-03-21 17:02:04 +00:00
},
};
</script>