enrecipes/app/components/modal/ConfirmDialog.vue

49 lines
1.2 KiB
Vue
Raw Normal View History

2020-10-21 17:54:45 +00:00
<template>
<Page>
2020-11-10 18:28:48 +00:00
<StackLayout class="dialogContainer" :class="appTheme">
2020-11-23 09:49:58 +00:00
<Label class="dialogTitle orkm" :text="title" textWrap="true"/>
2020-11-02 11:36:53 +00:00
<Label
v-if="description"
class="dialogDescription"
:text="description"
textWrap="true"
/>
2020-11-10 18:28:48 +00:00
<GridLayout rows="auto" columns="*, auto, auto" class="actionsContainer">
<MDButton
:rippleColor="rippleColor"
variant="text"
2020-11-02 11:36:53 +00:00
col="1"
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)"
/>
2020-11-10 18:28:48 +00:00
<MDButton
:rippleColor="rippleColor"
variant="text"
col="2"
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)"
/>
2020-11-02 11:36:53 +00:00
</GridLayout>
2020-10-21 17:54:45 +00:00
</StackLayout>
</Page>
</template>
<script>
import { Application } from "@nativescript/core"
2020-10-21 17:54:45 +00:00
export default {
props: ["title", "description", "cancelButtonText", "okButtonText"],
computed: {
2020-11-10 18:28:48 +00:00
appTheme() {
return Application.systemAppearance()
},
2020-11-10 18:28:48 +00:00
rippleColor() {
return this.appTheme == "light"
? "rgba(134,142,150,0.2)"
: "rgba(206,212,218,0.1)"
},
2020-10-22 18:36:50 +00:00
},
2020-10-21 17:54:45 +00:00
}
</script>