feat: use list view by default
This commit is contained in:
1 parent
c53ec52d86
commit
54a9d1b346
5 files changed
+28
-9
No files matched your search
@@ -0,0 +1,18 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import { userSettings } from '$lib/settings.js'
|
||||||
|
import { Select } from 'mono-svelte'
|
||||||
|
import { Icon, ViewColumns } from 'svelte-hero-icons'
|
||||||
|
|
||||||
|
let value = `${$userSettings.showCompactPosts}`
|
||||||
|
|
||||||
|
$: $userSettings.showCompactPosts = value == 'true'
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<Select bind:value>
|
||||||
|
<span slot="label" class="flex items-center gap-1">
|
||||||
|
<Icon src={ViewColumns} size="14" mini />
|
||||||
|
View
|
||||||
|
</span>
|
||||||
|
<option value="true">List</option>
|
||||||
|
<option value="false">Cards</option>
|
||||||
|
</Select>
|
||||||
@@ -111,14 +111,14 @@
|
|||||||
<Menu
|
<Menu
|
||||||
alignment="bottom-right"
|
alignment="bottom-right"
|
||||||
containerClass="overflow-auto max-h-[400px]"
|
containerClass="overflow-auto max-h-[400px]"
|
||||||
class="h-full max-h-screen"
|
itemsClass="!h-full"
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
let:toggleOpen
|
let:toggleOpen
|
||||||
slot="button"
|
slot="button"
|
||||||
aria-label="Post actions"
|
aria-label="Post actions"
|
||||||
on:click={toggleOpen}
|
on:click={toggleOpen}
|
||||||
class="hover:text-inherit"
|
class="hover:text-inherit h-8"
|
||||||
size="square-md"
|
size="square-md"
|
||||||
>
|
>
|
||||||
<Icon slot="prefix" src={EllipsisHorizontal} width={16} mini />
|
<Icon slot="prefix" src={EllipsisHorizontal} width={16} mini />
|
||||||
|
|||||||
+1
-1
@@ -66,7 +66,7 @@ export const defaultSettings: Settings = {
|
|||||||
community: toBool(env.PUBLIC_SHOW_INSTANCES_COMMUNITY) ?? true,
|
community: toBool(env.PUBLIC_SHOW_INSTANCES_COMMUNITY) ?? true,
|
||||||
comments: toBool(env.PUBLIC_SHOW_INSTANCES_COMMENTS) ?? false,
|
comments: toBool(env.PUBLIC_SHOW_INSTANCES_COMMENTS) ?? false,
|
||||||
},
|
},
|
||||||
showCompactPosts: toBool(env.PUBLIC_SHOW_COMPACT_POSTS) ?? false,
|
showCompactPosts: toBool(env.PUBLIC_SHOW_COMPACT_POSTS) ?? true,
|
||||||
defaultSort: {
|
defaultSort: {
|
||||||
sort: env.PUBLIC_DEFAULT_FEED_SORT ?? ('Active' as any),
|
sort: env.PUBLIC_DEFAULT_FEED_SORT ?? ('Active' as any),
|
||||||
feed: env.PUBLIC_DEFAULT_FEED ?? ('Local' as any),
|
feed: env.PUBLIC_DEFAULT_FEED ?? ('Local' as any),
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
import { Button, Modal, Select, Spinner } from 'mono-svelte'
|
import { Button, Modal, Select, Spinner } from 'mono-svelte'
|
||||||
import { GlobeAmericas, Icon } from 'svelte-hero-icons'
|
import { GlobeAmericas, Icon } from 'svelte-hero-icons'
|
||||||
import { profile } from '$lib/auth.js'
|
import { profile } from '$lib/auth.js'
|
||||||
|
import ViewSelect from '$lib/components/lemmy/ViewSelect.svelte'
|
||||||
|
|
||||||
export let data
|
export let data
|
||||||
|
|
||||||
@@ -37,7 +38,7 @@
|
|||||||
<Button on:click={() => (sidebar = !sidebar)}>About</Button>
|
<Button on:click={() => (sidebar = !sidebar)}>About</Button>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="flex flex-row gap-4 max-w-full w-full justify-between flex-wrap"
|
class="flex flex-row gap-4 max-w-full justify-between w-full flex-wrap"
|
||||||
>
|
>
|
||||||
<Select
|
<Select
|
||||||
bind:value={data.listingType}
|
bind:value={data.listingType}
|
||||||
@@ -53,7 +54,10 @@
|
|||||||
<option value="Local">Local</option>
|
<option value="Local">Local</option>
|
||||||
<option value="Subscribed" disabled={!$profile?.jwt}>Subscribed</option>
|
<option value="Subscribed" disabled={!$profile?.jwt}>Subscribed</option>
|
||||||
</Select>
|
</Select>
|
||||||
|
<div class="flex gap-4 flex-wrap">
|
||||||
<Sort selected={data.sort} />
|
<Sort selected={data.sort} />
|
||||||
|
<ViewSelect />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<section class="flex flex-col gap-3 sm:gap-4 h-full">
|
<section class="flex flex-col gap-3 sm:gap-4 h-full">
|
||||||
<PostFeed posts={data.posts.posts} />
|
<PostFeed posts={data.posts.posts} />
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
|
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
|
||||||
import { removalTemplate } from '$lib/components/lemmy/moderation/moderation.js'
|
import { removalTemplate } from '$lib/components/lemmy/moderation/moderation.js'
|
||||||
import { Button, Checkbox, Select } from 'mono-svelte'
|
import { Button, Checkbox, Select } from 'mono-svelte'
|
||||||
|
import ViewSelect from '$lib/components/lemmy/ViewSelect.svelte'
|
||||||
|
|
||||||
let data = {
|
let data = {
|
||||||
loading: false,
|
loading: false,
|
||||||
@@ -130,11 +131,7 @@
|
|||||||
</Setting>
|
</Setting>
|
||||||
<Setting>
|
<Setting>
|
||||||
<span slot="title">Post style</span>
|
<span slot="title">Post style</span>
|
||||||
<MultiSelect
|
<ViewSelect />
|
||||||
options={[false, true]}
|
|
||||||
optionNames={['Cards', 'Compact']}
|
|
||||||
bind:selected={$userSettings.showCompactPosts}
|
|
||||||
/>
|
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting>
|
<Setting>
|
||||||
<Checkbox bind:checked={$userSettings.nsfwBlur} slot="title">
|
<Checkbox bind:checked={$userSettings.nsfwBlur} slot="title">
|
||||||
|
|||||||
Reference in new issue
Block a user