enrecipes/app/components/About.vue

126 lines
3.9 KiB
Vue
Raw Normal View History

2020-09-15 11:10:16 +00:00
<template>
2020-11-10 18:28:48 +00:00
<Page @loaded="onPageLoad">
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-11-10 18:28:48 +00:00
<MDButton
variant="text"
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-12 12:06:17 +00:00
<Image src="res://logo" class="appIcon" stretch="aspectFit" />
2020-10-14 19:32:32 +00:00
</StackLayout>
2020-11-10 18:28:48 +00:00
<StackLayout class="m-8"></StackLayout>
<GridLayout columns="auto, *" class="option">
<Label col="0" class="bx" :text="icon.info" />
<StackLayout col="1">
2020-11-02 11:36:53 +00:00
<Label text="Version" />
2020-11-10 18:28:48 +00:00
<Label :text="getVersion" class="info" textWrap="true" />
2020-10-14 19:32:32 +00:00
</StackLayout>
2020-11-10 18:28:48 +00:00
</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" />
2020-11-12 12:06:17 +00:00
<StackLayout col="1">
<Label text="Join the Telegram group" />
<Label
text="for reporting issues, suggestions and feedback"
class="info"
textWrap="true"
/>
</StackLayout>
2020-11-10 18:28:48 +00:00
</GridLayout>
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-11-10 18:28:48 +00:00
<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" />
</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>
2020-10-14 19:32:32 +00:00
</StackLayout>
</ScrollView>
</Page>
2020-09-15 11:10:16 +00:00
</template>
<script>
2020-11-10 18:28:48 +00:00
import { Application, Utils } from "@nativescript/core"
import { mapActions, mapState } from "vuex"
2020-09-15 11:10:16 +00:00
export default {
2020-11-10 18:28:48 +00:00
props: ["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-11-06 09:07:41 +00:00
appTheme: "Light",
2020-11-02 11:36:53 +00:00
}
2020-09-15 11:10:16 +00:00
},
methods: {
2020-10-22 18:36:50 +00:00
...mapActions(["setCurrentComponentAction"]),
2020-11-10 18:28:48 +00:00
onPageLoad() {
2020-10-22 18:36:50 +00:00
this.setCurrentComponentAction("About")
2020-10-21 17:54:45 +00:00
},
2020-11-10 18:28:48 +00:00
// HELPERS
2020-11-02 11:36:53 +00:00
onScroll(args) {
args.scrollY
? (this.viewIsScrolled = true)
: (this.viewIsScrolled = false)
},
2020-11-10 18:28:48 +00:00
openURL(url) {
2020-10-22 18:36:50 +00:00
Utils.openUrl(url)
2020-09-15 11:10:16 +00:00
},
},
}
</script>