enrecipes/app/components/modal/ConfirmDialog.vue

43 lines
994 B
Vue
Raw Normal View History

2020-10-21 17:54:45 +00:00
<template>
<Page>
2020-10-22 18:36:50 +00:00
<StackLayout
class="dialogContainer"
:class="isLightTheme ? 'light' : 'dark'"
>
2020-10-21 17:54:45 +00:00
<Label class="dialogTitle orkm" :text="title" />
<Label class="dialogDescription" :text="description" textWrap="true" />
<StackLayout
orientation="horizontal"
class="actionsContainer"
horizontalAlignment="right"
>
<Label
2020-10-22 18:36:50 +00:00
class="action orkm"
2020-10-21 17:54:45 +00:00
:text="cancelButtonText"
@tap="$modal.close(false)"
/>
<Label
2020-10-22 18:36:50 +00:00
class="action orkm"
2020-10-21 17:54:45 +00:00
:text="okButtonText"
@tap="$modal.close(true)"
/>
</StackLayout>
</StackLayout>
</Page>
</template>
<script>
2020-10-22 18:36:50 +00:00
import Theme from "@nativescript/theme"
2020-10-21 17:54:45 +00:00
export default {
props: ["title", "description", "cancelButtonText", "okButtonText"],
2020-10-22 18:36:50 +00:00
data() {
return {
isLightTheme: true,
}
},
created() {
this.isLightTheme = Theme.getMode() == "ns-light" ? true : false
},
2020-10-21 17:54:45 +00:00
}
</script>