egirlskey/packages/frontend/src/pages/settings/notifications.notification-config.vue

55 lines
1.7 KiB
Vue
Raw Normal View History

2023-09-29 02:29:54 +00:00
<!--
SPDX-FileCopyrightText: syuilo and misskey-project
2023-09-29 02:29:54 +00:00
SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
<div class="_gaps_m">
<MkSelect v-model="type">
<option value="all">{{ i18n.ts.all }}</option>
<option v-if="hasSender" value="following">{{ i18n.ts.following }}</option>
<option v-if="hasSender" value="follower">{{ i18n.ts.followers }}</option>
<option v-if="hasSender" value="mutualFollow">{{ i18n.ts.mutualFollow }}</option>
<option v-if="hasSender" value="followingOrFollower">{{ i18n.ts.followingOrFollower }}</option>
<option v-if="hasSender" value="list">{{ i18n.ts.userList }}</option>
2023-09-29 02:29:54 +00:00
<option value="never">{{ i18n.ts.none }}</option>
</MkSelect>
<MkSelect v-if="type === 'list'" v-model="userListId">
<template #label>{{ i18n.ts.userList }}</template>
<option v-for="list in props.userLists" :key="list.id" :value="list.id">{{ list.name }}</option>
</MkSelect>
<div class="_buttons">
2023-10-31 18:33:24 +00:00
<MkButton inline primary @click="save"><i class="ph-check ph-bold ph-lg"></i> {{ i18n.ts.save }}</MkButton>
2023-09-29 02:29:54 +00:00
</div>
</div>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
2023-09-29 02:29:54 +00:00
import * as Misskey from 'misskey-js';
import MkSelect from '@/components/MkSelect.vue';
import MkButton from '@/components/MkButton.vue';
import { i18n } from '@/i18n.js';
const props = withDefaults(defineProps<{
2023-09-29 02:29:54 +00:00
value: any;
userLists: Misskey.entities.UserList[];
hasSender: boolean;
}>(), {
hasSender: true,
});
2023-09-29 02:29:54 +00:00
const emit = defineEmits<{
(ev: 'update', result: any): void;
}>();
const type = ref(props.value.type);
const userListId = ref(props.value.userListId);
2023-09-29 02:29:54 +00:00
function save() {
emit('update', { type: type.value, userListId: userListId.value });
2023-09-29 02:29:54 +00:00
}
</script>