feat: separate instance options
This commit is contained in:
1 parent
e34cace14f
commit
56b2175ab3
7 files changed
+55
-16
No files matched your search
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "photon-lemmy",
|
||||
"version": "0.4.29",
|
||||
"version": "0.4.30",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite dev",
|
||||
|
||||
@@ -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
@@ -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',
|
||||
|
||||
@@ -60,15 +60,6 @@
|
||||
</span>
|
||||
<Switch bind:enabled={$userSettings.revertColors} />
|
||||
</Setting>
|
||||
<Setting>
|
||||
<span slot="title">Show user instances</span>
|
||||
<span slot="description">Show user's instances.</span>
|
||||
<span class="flex gap-0 px-3 py-2 bg-slate-100 dark:bg-zinc-800 rounded-md">
|
||||
Xylight
|
||||
<span class="opacity-50">@example.com</span>
|
||||
</span>
|
||||
<Switch bind:enabled={$userSettings.showInstance} />
|
||||
</Setting>
|
||||
<Setting>
|
||||
<span slot="title">Show compact posts</span>
|
||||
<span slot="description">
|
||||
@@ -76,4 +67,27 @@
|
||||
</span>
|
||||
<Switch bind:enabled={$userSettings.showCompactPosts} />
|
||||
</Setting>
|
||||
<h2 class="uppercase font-bold opacity-80 text-sm mt-4">Instances</h2>
|
||||
<Setting>
|
||||
<span slot="title">Show instances</span>
|
||||
<span slot="description">Show items' instances.</span>
|
||||
<span class="flex gap-0 px-3 py-2 bg-slate-100 dark:bg-zinc-800 rounded-md">
|
||||
Xylight
|
||||
<span class="opacity-50">@example.com</span>
|
||||
</span>
|
||||
<div class="flex flex-row items-center gap-4">
|
||||
<div class="flex items-center gap-1 font-bold">
|
||||
Users
|
||||
<Switch bind:enabled={$userSettings.showInstances.user} />
|
||||
</div>
|
||||
<div class="flex items-center gap-1 font-bold">
|
||||
Comments
|
||||
<Switch bind:enabled={$userSettings.showInstances.comments} />
|
||||
</div>
|
||||
<div class="flex items-center gap-1 font-bold">
|
||||
Communities
|
||||
<Switch bind:enabled={$userSettings.showInstances.community} />
|
||||
</div>
|
||||
</div>
|
||||
</Setting>
|
||||
</div>
|
||||
Reference in new issue
Block a user