mirror of
https://github.com/modrinth/code.git
synced 2026-09-02 13:05:50 +00:00
feat: blocking frontend (#6911)
* feat: blocking api interfaces * feat: block action on user pages + shared instance flows * feat: safety settings subpage * feat: interaction source settings * feat: finish social settings * feat: profile settings xplat * fix: prepr * feat: click on friends * default instance -> game options & fix feature flag width * fix: scroll indicators --------- Co-authored-by: Prospector <6166773+Prospector@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<template>
|
||||
<section v-if="auth.user" class="universal-card">
|
||||
<AccountSocialSettings
|
||||
:get-blocked-users="getBlockedUsers"
|
||||
:get-users="getUsers"
|
||||
:unblock-user="unblockUser"
|
||||
/>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { Labrinth } from '@modrinth/api-client'
|
||||
import {
|
||||
AccountSocialSettings,
|
||||
commonSettingsMessages,
|
||||
injectModrinthClient,
|
||||
useVIntl,
|
||||
} from '@modrinth/ui'
|
||||
|
||||
definePageMeta({
|
||||
middleware: 'auth',
|
||||
})
|
||||
|
||||
const auth = await useAuth()
|
||||
const client = injectModrinthClient()
|
||||
const { formatMessage } = useVIntl()
|
||||
|
||||
function getBlockedUsers(): Promise<Labrinth.BlockedUsers.v3.BlockedUserId[]> {
|
||||
return client.labrinth.blocked_users_v3.list()
|
||||
}
|
||||
|
||||
function getUsers(userIds: string[]): Promise<Labrinth.Users.v2.User[]> {
|
||||
return client.labrinth.users_v2.getMultiple(userIds)
|
||||
}
|
||||
|
||||
function unblockUser(userId: string): Promise<void> {
|
||||
return client.labrinth.blocked_users_v3.unblock(userId)
|
||||
}
|
||||
|
||||
useHead({
|
||||
title: () => `${formatMessage(commonSettingsMessages.social)} - Modrinth`,
|
||||
})
|
||||
</script>
|
||||
Reference in New Issue
Block a user