enrecipes/app/components/About.vue
2020-11-29 00:51:57 +05:30

128 lines
3.9 KiB
Vue

<template>
<Page @loaded="onPageLoad">
<ActionBar :androidElevation="viewIsScrolled ? 4 : 0">
<GridLayout rows="*" columns="auto, *">
<MDButton
variant="text"
class="bx"
:text="icon.menu"
automationText="Back"
@tap="showDrawer"
col="0"
/>
<Label class="title orkm" text="About" col="1" />
</GridLayout>
</ActionBar>
<ScrollView @scroll="onScroll">
<StackLayout class="main-container">
<StackLayout
horizontalAlignment="center"
orientation="horizontal"
class="appIconContainer"
>
<Image src="res://logo" class="appIcon" stretch="aspectFit" />
</StackLayout>
<StackLayout class="m-8"></StackLayout>
<GridLayout columns="auto, *" class="option">
<Label col="0" class="bx" :text="icon.info" />
<StackLayout col="1">
<Label text="Version" />
<Label :text="getVersion" class="info" textWrap="true" />
</StackLayout>
</GridLayout>
<GridLayout columns="auto, *" class="option">
<MDRipple
colSpan="2"
@tap="openURL('https://github.com/vishnuraghavb/enrecipes')"
/>
<Label col="0" class="bx" :text="icon.link" />
<Label
verticalAlignment="center"
col="1"
text="View project on GitHub"
/>
</GridLayout>
<GridLayout columns="auto, *" class="option">
<MDRipple colSpan="2" @tap="openURL('https://t.me/enrecipes')" />
<Label col="0" class="bx" :text="icon.telegram" />
<StackLayout col="1">
<Label text="Join the Telegram group" />
<Label
text="for reporting issues, suggestions and feedback"
class="info"
textWrap="true"
/>
</StackLayout>
</GridLayout>
<StackLayout class="hr m-10"></StackLayout>
<Label text="Author" class="group-header orkm" />
<GridLayout columns="auto, *" class="option">
<MDRipple
colSpan="2"
@tap="openURL('https://www.vishnuraghav.com')"
/>
<Label col="0" class="bx" :text="icon.user" />
<Label verticalAlignment="center" col="1" text="Vishnu Raghav B" />
</GridLayout>
<GridLayout columns="auto, *" class="option">
<MDRipple
colSpan="2"
@tap="openURL('https://github.com/vishnuraghavb')"
/>
<Label col="0" class="bx" :text="icon.link" />
<Label verticalAlignment="center" col="1" text="Follow on GitHub" />
</GridLayout>
<GridLayout columns="auto, *" class="option">
<MDRipple
colSpan="2"
@tap="openURL('https://mastodon.social/@vishnuraghavb')"
/>
<Label col="0" class="bx" :text="icon.link" />
<Label verticalAlignment="center" col="1" text="Follow on Mastodon" />
</GridLayout>
</StackLayout>
</ScrollView>
</Page>
</template>
<script>
import { Application, Utils } from "@nativescript/core"
import { mapActions, mapState } from "vuex"
import * as utils from "~/shared/utils"
export default {
computed: {
...mapState(["icon", "currentComponent"]),
getVersion() {
let ctx = Application.android.context
return ctx.getPackageManager().getPackageInfo(ctx.getPackageName(), 0)
.versionName
},
},
data() {
return {
viewIsScrolled: false,
appTheme: "Light",
}
},
methods: {
...mapActions(["setCurrentComponentAction"]),
onPageLoad() {
this.setCurrentComponentAction("About")
},
// HELPERS
showDrawer() {
utils.showDrawer()
},
onScroll(args) {
this.viewIsScrolled = args.scrollY ? true : false
},
openURL(url) {
Utils.openUrl(url)
},
},
}
</script>