enrecipes/app/components/modal/ConfirmDialog.vue

75 lines
1.7 KiB
Vue
Raw Normal View History

2020-10-21 17:54:45 +00:00
<template>
2021-03-10 15:59:50 +00:00
<Page @loaded="onPageLoad" backgroundColor="transparent">
2021-02-28 15:10:26 +00:00
<StackLayout class="dialogContainer" :class="appTheme">
2021-03-21 17:02:04 +00:00
<StackLayout class="dialogHeader" orientation="horizontal">
<Label
class="er dialogIcon"
:color="iconColor"
:text="icon[helpIcon]"
/>
<Label
2021-03-23 06:16:25 +00:00
class="dialogTitle "
2021-03-21 17:02:04 +00:00
:text="`${title}` | L"
textWrap="true"
/>
</StackLayout>
2021-02-28 15:10:26 +00:00
<Label
v-if="description"
class="dialogDescription"
:text="description"
textWrap="true"
/>
<GridLayout rows="auto" columns="*, auto, auto" class="actionsContainer">
<MDButton
v-if="cancelButtonText"
variant="text"
col="1"
2021-03-23 06:16:25 +00:00
class="action tb"
2021-02-28 15:10:26 +00:00
:text="`${cancelButtonText}` | L"
@tap="$modal.close(false)"
/>
<MDButton
variant="text"
col="2"
2021-03-23 06:16:25 +00:00
class="action tb"
2021-02-28 15:10:26 +00:00
:text="`${okButtonText}` | L"
@tap="$modal.close(true)"
/>
</GridLayout>
</StackLayout>
</Page>
2020-10-21 17:54:45 +00:00
</template>
<script>
2021-03-10 15:59:50 +00:00
import { Application, Color } from "@nativescript/core";
2021-02-28 15:10:26 +00:00
import { mapState } from "vuex";
2020-10-21 17:54:45 +00:00
export default {
2021-02-28 15:10:26 +00:00
props: [
"title",
"description",
"cancelButtonText",
"okButtonText",
"helpIcon",
2021-03-21 17:02:04 +00:00
"iconColor",
2021-02-28 15:10:26 +00:00
],
computed: {
2021-02-28 15:10:26 +00:00
...mapState(["icon"]),
2020-11-10 18:28:48 +00:00
appTheme() {
2021-02-28 15:10:26 +00:00
return Application.systemAppearance();
},
2020-10-22 18:36:50 +00:00
},
2021-03-10 15:59:50 +00:00
methods: {
onPageLoad(args) {
args.object._dialogFragment
.getDialog()
.getWindow()
.setBackgroundDrawable(
new android.graphics.drawable.ColorDrawable(
android.graphics.Color.TRANSPARENT
)
);
},
},
2021-02-28 15:10:26 +00:00
};
2020-10-21 17:54:45 +00:00
</script>