enrecipes/app/components/settings/About.vue

121 lines
3.3 KiB
Vue
Raw Permalink 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-10-07 18:46:19 +00:00
<Label class="info tc tw lh4" text="by Vishnu Raghav B" />
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-06-28 11:38:21 +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>
2021-10-07 18:46:19 +00:00
import { Application, Observable, Utils } from '@nativescript/core'
import { mapState } from 'vuex'
2021-03-21 17:02:04 +00:00
export default {
computed: {
2021-10-07 18:46:19 +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
{
2021-10-07 18:46:19 +00:00
icon: 'lang',
title: 'Official Website',
url: 'https://enrecipes.vercel.app',
2021-03-21 17:02:04 +00:00
},
2021-10-07 18:46:19 +00:00
// {
// icon: 'gh',
// title: 'gh',
// url: 'https://github.com/vishnuraghavb/EnRecipes',
// },
2021-04-12 18:09:48 +00:00
{
2021-10-07 18:46:19 +00:00
icon: 'tg',
title: 'joinTG',
url: 'https://t.me/enrecipes',
2021-04-12 18:09:48 +00:00
},
{
2021-10-07 18:46:19 +00:00
icon: 'help',
title: 'guide',
url: 'https://github.com/vishnuraghavb/EnRecipes-Wiki/wiki/User-Guide',
2021-04-12 18:09:48 +00:00
},
2021-04-01 10:55:35 +00:00
{
2021-10-07 18:46:19 +00:00
icon: 'priv',
title: 'priv',
url: 'https://github.com/vishnuraghavb/EnRecipes-Wiki/blob/main/PRIVACY.md',
2021-04-01 10:55:35 +00:00
},
2021-03-21 17:02:04 +00:00
{
2021-10-07 18:46:19 +00:00
icon: 'don',
title: 'donate',
url: 'https://www.vishnuraghav.com/donate',
2021-03-21 17:02:04 +00:00
},
2021-10-07 18:46:19 +00:00
// {
// icon: "trans",
// title: "trnsl",
// url: "https://hosted.weblate.org/projects/enrecipes/app-translations",
// },
2021-04-01 10:55:35 +00:00
{},
2021-10-07 18:46:19 +00:00
]
2021-03-21 17:02:04 +00:00
},
getVersion() {
2021-10-07 18:46:19 +00:00
let ctx = Application.android.context
2021-03-21 17:02:04 +00:00
return (
2021-10-07 18:46:19 +00:00
'v' +
2021-03-21 17:02:04 +00:00
ctx.getPackageManager().getPackageInfo(ctx.getPackageName(), 0)
.versionName
2021-10-07 18:46:19 +00:00
)
2021-03-21 17:02:04 +00:00
},
},
methods: {
2021-06-15 11:04:42 +00:00
pgLoad({ object }) {
2021-10-07 18:46:19 +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-10-07 18:46:19 +00:00
this.touchFade(object, action)
if (action == 'up') Utils.openUrl(url)
2021-04-01 10:55:35 +00:00
},
2021-03-21 17:02:04 +00:00
},
2021-10-07 18:46:19 +00:00
}
2021-03-21 17:02:04 +00:00
</script>