design: redesign blocked pages to not look like buns
This commit is contained in:
16 files changed
+336
-271
No files matched your search
@@ -84,14 +84,14 @@
|
||||
"time": {
|
||||
"label": "Period",
|
||||
"all": "All time",
|
||||
"9months": "Past 9 months",
|
||||
"6months": "Past 6 months",
|
||||
"3months": "Past 3 months",
|
||||
"9months": "9 months",
|
||||
"6months": "6 months",
|
||||
"3months": "3 months",
|
||||
"month": "Past month",
|
||||
"week": "Past week",
|
||||
"day": "Past day",
|
||||
"12hours": "Past 12 hours",
|
||||
"6hours": "Past 6 hours",
|
||||
"12hours": "12 hours",
|
||||
"6hours": "6 hours",
|
||||
"hour": "Past hour"
|
||||
}
|
||||
},
|
||||
@@ -250,8 +250,18 @@
|
||||
"blocks": {
|
||||
"title": "Blocked",
|
||||
"empty": {
|
||||
"title": "No blocked entities",
|
||||
"description": "When you block anything, it will no longer appear in your feeds."
|
||||
"user": {
|
||||
"title": "No blocked users",
|
||||
"description": "Blocking a user will hide the user's posts and comments from feeds."
|
||||
},
|
||||
"community": {
|
||||
"title": "No blocked communities",
|
||||
"description": "Blocking a community will hide its posts from feeds."
|
||||
},
|
||||
"instance": {
|
||||
"title": "No blocked servers",
|
||||
"description": "Blocking a server will hide posts from its communities from feeds."
|
||||
}
|
||||
}
|
||||
},
|
||||
"credentials": "Credentials",
|
||||
|
||||
@@ -140,6 +140,7 @@ export interface FeedTypes {
|
||||
}
|
||||
},
|
||||
]
|
||||
'/profile/user': [GetPersonDetails, GetPersonDetailsResponse]
|
||||
}
|
||||
|
||||
export const feeds = new SvelteMap<keyof FeedTypes, Feed<any, any>>()
|
||||
|
||||
@@ -4,18 +4,14 @@ import { profile, type ProfileInfo } from '$lib/app/auth.svelte'
|
||||
|
||||
// TODO obliterate this file
|
||||
export async function blockUser(block: boolean, id: number) {
|
||||
const auth = profile.current?.jwt
|
||||
|
||||
if (!auth) throw new Error('Unauthorized')
|
||||
|
||||
await client().blockPerson({
|
||||
return await client().blockPerson({
|
||||
block: block,
|
||||
person_id: id,
|
||||
})
|
||||
}
|
||||
|
||||
export function isBlocked(me: MyUserInfo, user: number) {
|
||||
return me.person_blocks.map((b) => b.target.id).includes(user)
|
||||
return me.person_blocks.find((b) => b.target.id == user)
|
||||
}
|
||||
|
||||
export function addSubscription(
|
||||
|
||||
@@ -1,19 +1,25 @@
|
||||
<script lang="ts">
|
||||
import { Button } from 'mono-svelte'
|
||||
import type { Snippet } from 'svelte'
|
||||
import { CommonList } from '../layout'
|
||||
import Avatar from './Avatar.svelte'
|
||||
|
||||
interface Props {
|
||||
items: {
|
||||
avatar?: string
|
||||
name: string
|
||||
instance?: string
|
||||
id: number
|
||||
url: string
|
||||
}[]
|
||||
type Item = {
|
||||
avatar?: string
|
||||
name: string
|
||||
instance?: string
|
||||
id: number
|
||||
url?: string
|
||||
circle?: boolean
|
||||
}
|
||||
|
||||
let { items }: Props = $props()
|
||||
interface Props {
|
||||
items: Item[]
|
||||
link?: boolean
|
||||
action?: Snippet<[Item]>
|
||||
}
|
||||
|
||||
let { items, link, action }: Props = $props()
|
||||
</script>
|
||||
|
||||
<CommonList animate={false} class="px-1 py-0.5" size="xs" {items}>
|
||||
@@ -23,7 +29,7 @@
|
||||
gap="lg"
|
||||
color="none"
|
||||
alignment="left"
|
||||
href={item.url}
|
||||
href={link ? item.url : undefined}
|
||||
>
|
||||
<div class="flex-none">
|
||||
<Avatar
|
||||
@@ -31,7 +37,7 @@
|
||||
alt={item.name}
|
||||
title={item.name}
|
||||
width={24}
|
||||
circle={false}
|
||||
circle={item.circle ?? false}
|
||||
/>
|
||||
</div>
|
||||
<div class="flex flex-col max-w-full break-words">
|
||||
@@ -42,6 +48,10 @@
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
{#if action}
|
||||
<div class="flex-1"></div>
|
||||
{@render action(item)}
|
||||
{/if}
|
||||
</Button>
|
||||
{/snippet}
|
||||
</CommonList>
|
||||
Reference in new issue
Block a user