feat: add and fix #148

This commit is contained in:
Xyphyn committed 2023-09-19 15:43:24 -07:00
1 parent 2a0a3d4fbf
commit e0f4624489
5 files changed
+27 -11

No files matched your search

+1
View File
@@ -8,6 +8,7 @@
viewBox="0 0 100 100"
fill="none"
xmlns="http://www.w3.org/2000/svg"
class="inline"
>
<linearGradient
gradientTransform="rotate(315, 0.5, 0.5)"
+11 -10
View File
@@ -62,17 +62,18 @@
<span class="opacity-30 text-xl">/</span>
<div class="text-sm font-bold inline-flex flex-col">
<span>{$site.site_view.site.name}</span>
<span
class="font-normal text-xs flex items-center gap-1 text-slate-600 dark:text-zinc-400"
>
Powered by <Link
href="https://github.com/Xyphyn/photon"
highlight={false}
class="!font-bold flex items-center gap-0.5 hover:underline text-black dark:text-white"
{#if !$userSettings.hidePhoton}
<span
class="text-xs flex items-center gap-1 text-slate-600 dark:text-zinc-400 font-normal"
>
<Logo width={12} /> Photon
</Link>
</span>
Powered by <a
href="https://github.com/Xyphyn/photon"
class="font-bold flex items-center gap-0.5 hover:underline text-black dark:text-white"
>
<Logo width={12} /> Photon
</a>
</span>
{/if}
</div>
</div>
{:else}
+2
View File
@@ -60,6 +60,7 @@ interface Settings {
font: 'inter' | 'system' | 'browser'
leftAlign: boolean
hidePhoton: boolean
}
export const defaultSettings: Settings = {
@@ -99,6 +100,7 @@ export const defaultSettings: Settings = {
view: 'list',
font: 'system',
leftAlign: false,
hidePhoton: toBool(env.PUBLIC_HIDE_POWERED_BY) ?? false,
}
export const userSettings = writable(defaultSettings)
+12
View File
@@ -16,6 +16,7 @@
import { removalTemplate } from '$lib/components/lemmy/moderation/moderation.js'
import { Button, Checkbox, Select } from 'mono-svelte'
import ViewSelect from '$lib/components/lemmy/ViewSelect.svelte'
import { LINKED_INSTANCE_URL } from '$lib/instance.js'
let data = {
loading: false,
@@ -169,6 +170,17 @@
bind:selected={$userSettings.leftAlign}
/>
</Setting>
{#if LINKED_INSTANCE_URL}
<Setting>
<span slot="title">Disable "powered by"</span>
<span slot="description">
Disable the "Powered by Photon" in the top left corner.
</span>
<Checkbox bind:checked={$userSettings.hidePhoton}>
{$userSettings.hidePhoton ? 'Enabled' : 'Disabled'}
</Checkbox>
</Setting>
{/if}
<SectionTitle class="mt-4">Instances</SectionTitle>
<Setting>