forked from Easterok/telegram-onboarding-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TelegramPopupButton.vue
98 lines (81 loc) · 1.67 KB
/
TelegramPopupButton.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<template>
<button
v-ripple
:class="[
$style.button,
border && $style.button_border,
$style['button_' + type],
]"
>
<slot name="icon" />
<div :class="$style.content">
<p>{{ text }}</p>
<svg-icon name="arrow-right" :class="$style.icon" :size="24" />
</div>
</button>
</template>
<script setup lang="ts">
import { SvgIcon } from '@tok/ui/components/SvgIcon';
import { RippleDirective as vRipple } from '@tok/ui/directives/ripple';
import type { PopupButton } from '@twa-dev/types';
type ButtonType = PopupButton['type'];
withDefaults(
defineProps<{
id?: string;
text?: string;
border?: boolean;
type?: ButtonType;
}>(),
{
text: '',
type: 'default',
}
);
</script>
<style lang="scss" module>
@import '@tok/ui/styles/local.scss';
.button {
@include clearbutton;
@include transition(opacity);
position: relative;
display: flex;
align-items: center;
flex: 1;
width: 100%;
padding: 0.6875rem 0.75rem;
text-align: left;
color: var(--tok-text-color);
font: var(--tok-font-l);
cursor: pointer;
border-radius: inherit;
&_border {
&:after {
position: absolute;
content: '';
right: 0.6875rem;
bottom: 0;
width: calc(100% - 4.125rem);
height: 1px;
background: var(--tok-text-color-08);
}
}
&_destructive {
color: var(--tok-error-fill);
background: var(--tok-error-bg);
}
&:hover {
opacity: var(--tok-hover-opacity);
}
}
.content {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
height: 100%;
}
.icon {
margin-left: 0.125rem;
color: var(--tok-text-color-32);
}
</style>