enrecipes/app/components/About.vue

120 lines
3.5 KiB
Vue
Raw Normal View History

2020-09-15 11:10:16 +00:00
<template>
2020-10-22 18:36:50 +00:00
<Page @loaded="initializePage">
2020-10-14 19:32:32 +00:00
<ActionBar :flat="viewIsScrolled ? false : true">
2020-11-02 11:36:53 +00:00
<GridLayout rows="*" columns="auto, *">
2020-10-14 19:32:32 +00:00
<Label
2020-11-02 11:36:53 +00:00
class="bx"
2020-10-14 19:32:32 +00:00
:text="icon.menu"
2020-11-02 11:36:53 +00:00
automationText="Back"
2020-10-14 19:32:32 +00:00
@tap="showDrawer"
col="0"
/>
2020-10-21 17:54:45 +00:00
<Label class="title orkm" text="About" col="1" />
2020-10-14 19:32:32 +00:00
</GridLayout>
</ActionBar>
2020-11-02 11:36:53 +00:00
<ScrollView scrollBarIndicatorVisible="false" @scroll="onScroll">
2020-10-14 19:32:32 +00:00
<StackLayout class="main-container">
<StackLayout
horizontalAlignment="center"
orientation="horizontal"
2020-11-02 11:36:53 +00:00
class="appIconContainer"
2020-10-14 19:32:32 +00:00
>
2020-11-02 11:36:53 +00:00
<Image src="res://icon" class="appIcon" stretch="fill" />
2020-10-14 19:32:32 +00:00
<Label
text="EnRecipes"
verticalAlignment="center"
2020-11-02 11:36:53 +00:00
class="appName orkb"
2020-10-14 19:32:32 +00:00
/>
</StackLayout>
2020-11-02 11:36:53 +00:00
<StackLayout orientation="horizontal" class="option">
<Label class="bx" :text="icon.info" />
2020-10-14 19:32:32 +00:00
<StackLayout>
2020-11-02 11:36:53 +00:00
<Label text="Version" />
<Label :text="getVersion" class="option-info" textWrap="true" />
2020-10-14 19:32:32 +00:00
</StackLayout>
</StackLayout>
<StackLayout
orientation="horizontal"
2020-11-02 11:36:53 +00:00
class="option"
2020-10-14 19:32:32 +00:00
@tap="openURL($event, 'https://github.com/vishnuraghavb/enrecipes')"
>
<Label class="bx" :text="icon.link" />
2020-11-02 11:36:53 +00:00
<Label text="View project on GitHub" />
2020-10-14 19:32:32 +00:00
</StackLayout>
<StackLayout
orientation="horizontal"
2020-11-02 11:36:53 +00:00
class="option"
@tap="openURL($event, 'https://t.me/enrecipes')"
>
<Label class="bx" :text="icon.telegram" />
2020-11-02 11:36:53 +00:00
<Label text="Join the Telegram group" />
</StackLayout>
2020-09-15 11:10:16 +00:00
2020-10-14 19:32:32 +00:00
<StackLayout class="hr m-10"></StackLayout>
2020-09-15 11:10:16 +00:00
2020-10-14 19:32:32 +00:00
<Label text="Author" class="group-header" />
<StackLayout
orientation="horizontal"
2020-11-02 11:36:53 +00:00
class="option"
2020-10-14 19:32:32 +00:00
@tap="openURL($event, 'https://www.vishnuraghav.com')"
>
<Label class="bx" :text="icon.user" />
2020-11-02 11:36:53 +00:00
<Label text="Vishnu Raghav" />
2020-10-14 19:32:32 +00:00
</StackLayout>
<StackLayout
orientation="horizontal"
2020-11-02 11:36:53 +00:00
class="option"
2020-10-14 19:32:32 +00:00
@tap="openURL($event, 'https://github.com/vishnuraghavb')"
>
<Label class="bx" :text="icon.link" />
2020-11-02 11:36:53 +00:00
<Label text="Follow on GitHub" />
2020-10-14 19:32:32 +00:00
</StackLayout>
<StackLayout
orientation="horizontal"
2020-11-02 11:36:53 +00:00
class="option"
2020-10-14 19:32:32 +00:00
@tap="openURL($event, 'https://mastodon.social/@vishnuraghavb')"
>
<Label class="bx" :text="icon.link" />
2020-11-02 11:36:53 +00:00
<Label text="Follow on Mastodon" />
2020-10-14 19:32:32 +00:00
</StackLayout>
</StackLayout>
</ScrollView>
</Page>
2020-09-15 11:10:16 +00:00
</template>
<script>
2020-11-02 11:36:53 +00:00
import { Utils, Application } from "@nativescript/core"
2020-10-14 19:32:32 +00:00
import { mapState, mapActions } from "vuex"
2020-09-15 11:10:16 +00:00
export default {
2020-11-02 11:36:53 +00:00
props: ["highlight", "showDrawer", "title"],
2020-10-14 19:32:32 +00:00
computed: {
2020-10-22 18:36:50 +00:00
...mapState(["icon", "currentComponent"]),
2020-11-02 11:36:53 +00:00
getVersion() {
let ctx = Application.android.context
return ctx.getPackageManager().getPackageInfo(ctx.getPackageName(), 0)
.versionName
},
},
data() {
return {
viewIsScrolled: false,
}
2020-09-15 11:10:16 +00:00
},
methods: {
2020-10-22 18:36:50 +00:00
...mapActions(["setCurrentComponentAction"]),
initializePage() {
this.setCurrentComponentAction("About")
2020-10-21 17:54:45 +00:00
},
2020-11-02 11:36:53 +00:00
onScroll(args) {
args.scrollY
? (this.viewIsScrolled = true)
: (this.viewIsScrolled = false)
},
2020-09-15 11:10:16 +00:00
openURL(args, url) {
this.highlight(args)
2020-10-22 18:36:50 +00:00
Utils.openUrl(url)
2020-09-15 11:10:16 +00:00
},
},
}
</script>