2022-03-27 04:31:32 +00:00
|
|
|
<template>
|
2022-04-13 03:55:29 +00:00
|
|
|
<div class="description" v-if="render.descriptionBodyText" ref="description">
|
2022-04-04 11:33:16 +00:00
|
|
|
<template v-for="(text, index) in render.descriptionBodyText.runs">
|
|
|
|
<template v-if="$rendererUtils.checkInternal(text)">
|
2022-03-28 02:07:03 +00:00
|
|
|
<a
|
2022-04-04 11:33:16 +00:00
|
|
|
@click="openInternal($rendererUtils.getNavigationEndpoints(text))"
|
2022-03-28 02:07:03 +00:00
|
|
|
:key="index"
|
|
|
|
>{{ text.text }}</a
|
|
|
|
>
|
2022-03-27 11:24:34 +00:00
|
|
|
</template>
|
2022-04-04 11:33:16 +00:00
|
|
|
<template
|
|
|
|
v-else-if="
|
|
|
|
text.navigationEndpoint && text.navigationEndpoint.urlEndpoint
|
|
|
|
"
|
|
|
|
>
|
2022-03-28 02:07:03 +00:00
|
|
|
<a
|
2022-04-04 11:33:16 +00:00
|
|
|
@click="openExternal($rendererUtils.getNavigationEndpoints(text))"
|
2022-03-28 02:07:03 +00:00
|
|
|
:key="index"
|
|
|
|
>{{ text.text }}</a
|
|
|
|
>
|
2022-03-27 05:48:27 +00:00
|
|
|
</template>
|
|
|
|
<template v-else> {{ text.text }} </template>
|
|
|
|
</template>
|
2022-03-27 04:31:32 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2022-03-29 02:30:20 +00:00
|
|
|
<style scoped>
|
|
|
|
.description {
|
|
|
|
white-space: pre-line;
|
|
|
|
}
|
|
|
|
</style>
|
2022-03-27 04:31:32 +00:00
|
|
|
|
|
|
|
<script>
|
2022-03-27 11:24:34 +00:00
|
|
|
import { Browser } from "@capacitor/browser";
|
2022-04-13 03:55:29 +00:00
|
|
|
import { parseEmoji } from "~/plugins/utils";
|
2022-03-27 04:31:32 +00:00
|
|
|
export default {
|
|
|
|
props: ["render"],
|
|
|
|
|
|
|
|
methods: {
|
2022-03-27 11:24:34 +00:00
|
|
|
async openExternal(url) {
|
|
|
|
await Browser.open({ url: url });
|
|
|
|
},
|
|
|
|
async openInternal(url) {
|
|
|
|
await this.$router.push(url);
|
|
|
|
},
|
2022-03-27 04:31:32 +00:00
|
|
|
},
|
2022-04-13 03:55:29 +00:00
|
|
|
|
|
|
|
mounted() {
|
|
|
|
const twemojiParse = parseEmoji(this.$refs.description);
|
|
|
|
if (twemojiParse) this.$refs.description = twemojiParse;
|
|
|
|
},
|
2022-03-27 04:31:32 +00:00
|
|
|
};
|
|
|
|
</script>
|