Files
interview-demo-code/frontend/spa/src/components/PrivacyPolicy.vue
Nikita Kiselev 0e48b9d56d
Some checks failed
Telegram Mini App Shop Builder / Compute version metadata (push) Has been cancelled
Telegram Mini App Shop Builder / Run Frontend tests (push) Has been cancelled
Telegram Mini App Shop Builder / Run Backend tests (push) Has been cancelled
Telegram Mini App Shop Builder / Run PHP_CodeSniffer (push) Has been cancelled
Telegram Mini App Shop Builder / Build module. (push) Has been cancelled
Telegram Mini App Shop Builder / release (push) Has been cancelled
Squashed commit message
2026-03-11 22:17:44 +03:00

54 lines
1.3 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<div v-if="isShown" class="toast toast-center toast-bottom-fix z-50">
<div class="alert alert-info">
<span>
Используя магазин, вы соглашаетесь с
<a v-if="settings.privacy_policy_link"
href="#" class="underline"
@click.prevent="showPrivacyPolicy"
>обработкой персональных данных</a>
<span v-else>обработкой персональных данных</span>.
</span>
<button
class="btn btn-outline"
@click="privacyConsent"
>
OK
</button>
</div>
</div>
</template>
<script setup>
import {userPrivacyConsent} from "@/utils/ftch.js";
import {ref} from "vue";
import {useSettingsStore} from "@/stores/SettingsStore.js";
const isShown = ref(true);
const settings = useSettingsStore();
async function privacyConsent() {
isShown.value = false;
await userPrivacyConsent();
}
function showPrivacyPolicy() {
if (settings.privacy_policy_link) {
window.Telegram.WebApp.openLink(settings.privacy_policy_link, {
try_instant_view: true,
});
}
}
</script>
<style scoped>
.toast-bottom-fix {
bottom: calc(
var(--dock-height, 0px)
+ var(--tg-content-safe-area-inset-bottom, 0px)
+ var(--tg-safe-area-inset-bottom, 0px)
+ 5px
);
}
</style>