feat: separate instance options

This commit is contained in:
Xyphyn committed 2023-08-03 12:17:34 -07:00
1 parent e34cace14f
commit 56b2175ab3
7 files changed
+55 -16

No files matched your search

+1 -1
View File
@@ -5,7 +5,7 @@
<label>
<div
class="relative w-10 border-2 h-6 transition-colors cursor-pointer
rounded-full flex flex-row items-center shadow-lg {enabled
rounded-full flex flex-row items-center {enabled
? 'bg-blue-500 border-blue-500'
: 'bg-slate-200 dark:bg-zinc-800 border-slate-200 dark:border-zinc-800'}"
>
@@ -84,7 +84,12 @@
class="flex flex-row cursor-pointer gap-2 items-center group text-xs flex-wrap"
>
<span class:font-bold={op} class="flex flex-row gap-1 items-center">
<UserLink avatarSize={20} avatar user={node.comment_view.creator} />
<UserLink
inComment
avatarSize={20}
avatar
user={node.comment_view.creator}
/>
{#if op}
<span class="text-sky-500">OP</span>
{/if}
@@ -1,5 +1,6 @@
<script lang="ts">
import Avatar from '$lib/components/ui/Avatar.svelte'
import { userSettings } from '$lib/settings.js'
import type { Community } from 'lemmy-js-client'
export let community: Community
@@ -24,5 +25,15 @@
width={avatarSize}
/>
{/if}
{community.title}
<span class="flex gap-0">
{#if $userSettings.showInstances.community}
{community.title}
<span class="text-slate-600 dark:text-zinc-400 font-normal">
@{new URL(community.actor_id).hostname}
</span>
{:else}
{community.name}
{/if}
</span>
</a>
@@ -9,6 +9,7 @@
export let avatar: boolean = false
export let avatarSize: number = 24
export let badges: boolean = true
export let inComment: boolean = false
function linkFromCommunity(user: Person) {
const domain = new URL(user.actor_id).hostname
@@ -29,7 +30,7 @@
class:text-red-500={user.admin}
class:font-bold={user.admin}
>
{#if $userSettings.showInstance}
{#if $userSettings.showInstances.user || ($userSettings.showInstances.comments && inComment)}
{user.name}
<span class="text-slate-600 dark:text-zinc-400 font-normal">
@{new URL(user.actor_id).hostname}
+10 -2
View File
@@ -6,7 +6,11 @@ interface Settings {
markReadPosts: boolean
instance?: string
revertColors: boolean
showInstance: boolean
showInstances: {
user: boolean
community: boolean
comments: boolean
}
showCompactPosts: boolean
defaultSort: {
sort: 'Hot' | 'TopAll' | 'Active' | 'New'
@@ -20,7 +24,11 @@ const defaultSettings: Settings = {
expandableImages: true,
markReadPosts: true,
revertColors: false,
showInstance: false,
showInstances: {
user: false,
community: false,
comments: false,
},
showCompactPosts: false,
defaultSort: {
sort: 'Active',