iceshrimp-legacy/packages/client/src/ui/deck/notifications-column.vue

63 lines
1.3 KiB
Vue
Raw Normal View History

<template>
2023-04-08 02:01:42 +02:00
<XColumn
:column="column"
:is-stacked="isStacked"
:menu="menu"
@parent-focus="($event) => emit('parent-focus', $event)"
>
<template #header
><i class="ph-bell ph-bold ph-lg" style="margin-right: 8px"></i
>{{ column.name }}</template
>
2023-04-08 02:01:42 +02:00
<XNotifications :include-types="column.includingTypes" />
</XColumn>
</template>
<script lang="ts" setup>
2023-04-08 02:01:42 +02:00
import { defineAsyncComponent } from "vue";
import XColumn from "./column.vue";
import { updateColumn } from "./deck-store";
import type { Column } from "./deck-store";
import XNotifications from "@/components/MkNotifications.vue";
import * as os from "@/os";
import { i18n } from "@/i18n";
const props = defineProps<{
column: Column;
isStacked: boolean;
}>();
const emit = defineEmits<{
2023-04-08 02:01:42 +02:00
(ev: "parent-focus", direction: "up" | "down" | "left" | "right"): void;
}>();
2022-12-06 07:50:59 +01:00
function func(): void {
2023-04-08 02:01:42 +02:00
os.popup(
defineAsyncComponent(
2023-07-06 03:28:27 +02:00
() => import("@/components/MkNotificationSettingWindow.vue"),
2023-04-08 02:01:42 +02:00
),
{
includingTypes: props.column.includingTypes,
},
2023-04-08 02:01:42 +02:00
{
done: async (res) => {
const { includingTypes } = res;
updateColumn(props.column.id, {
2023-07-17 00:32:32 +02:00
includingTypes,
2023-04-08 02:01:42 +02:00
});
},
},
2023-07-06 03:28:27 +02:00
"closed",
2023-04-08 02:01:42 +02:00
);
}
2022-07-16 22:33:21 +02:00
2023-04-08 02:01:42 +02:00
const menu = [
{
icon: "ph-pencil ph-bold ph-lg",
text: i18n.ts.notificationSetting,
action: func,
},
];
</script>