misc: Minor design tweaks
This commit is contained in:
1 parent
3bb849cb4b
commit
9d21f6331a
14 files changed
+25
-26
No files matched your search
@@ -18,9 +18,7 @@
|
|||||||
on:click={(e) => dispatch('click', e)}
|
on:click={(e) => dispatch('click', e)}
|
||||||
class="{large
|
class="{large
|
||||||
? 'w-full px-4 py-2'
|
? 'w-full px-4 py-2'
|
||||||
: 'px-3 py-1.5'} rounded-md {color} text-sm transition-all {disabled
|
: 'px-3 py-1.5'} rounded-md {color} text-sm transition-all disabled:opacity-50 disabled:pointer-events-none"
|
||||||
? 'opacity-50 pointer-events-none'
|
|
||||||
: ''}"
|
|
||||||
type={submit ? 'submit' : 'button'}
|
type={submit ? 'submit' : 'button'}
|
||||||
aria-label={label}
|
aria-label={label}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
import { createEventDispatcher } from 'svelte'
|
import { createEventDispatcher } from 'svelte'
|
||||||
type T = $$Generic
|
type T = $$Generic
|
||||||
export let options: T[]
|
export let options: T[]
|
||||||
|
export let disabled: boolean[] = []
|
||||||
export let optionNames: string[] = []
|
export let optionNames: string[] = []
|
||||||
export let selected: T
|
export let selected: T
|
||||||
export let separate = false
|
export let separate = false
|
||||||
@@ -25,9 +26,11 @@
|
|||||||
{selected == option
|
{selected == option
|
||||||
? 'bg-black text-white dark:bg-white dark:text-black\
|
? 'bg-black text-white dark:bg-white dark:text-black\
|
||||||
hover:bg-zinc-900 hover:dark:bg-zinc-300'
|
hover:bg-zinc-900 hover:dark:bg-zinc-300'
|
||||||
: 'bg-slate-100 dark:bg-zinc-900 hover:bg-slate-200 hover:dark:bg-zinc-800'} {clazz}
|
: 'bg-slate-100 dark:bg-zinc-900 hover:bg-slate-200 hover:dark:bg-zinc-800'}
|
||||||
"
|
{clazz}
|
||||||
|
disabled:opacity-60 disabled:pointer-events-none"
|
||||||
on:click={() => (selected = option)}
|
on:click={() => (selected = option)}
|
||||||
|
disabled={disabled[index] ?? false}
|
||||||
>
|
>
|
||||||
{optionNames[index] || option}
|
{optionNames[index] || option}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
import Card from '$lib/components/ui/Card.svelte'
|
import Card from '$lib/components/ui/Card.svelte'
|
||||||
import { getInstance } from '$lib/lemmy.js'
|
import { getInstance } from '$lib/lemmy.js'
|
||||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||||
import PostActions from '$lib/components/lemmy/PostActions.svelte'
|
import PostActions from '$lib/components/lemmy/post/PostActions.svelte'
|
||||||
import Badge from '$lib/components/ui/Badge.svelte'
|
import Badge from '$lib/components/ui/Badge.svelte'
|
||||||
import {
|
import {
|
||||||
Bookmark,
|
Bookmark,
|
||||||
File renamed without changes.
File renamed without changes.
@@ -8,7 +8,7 @@
|
|||||||
<div
|
<div
|
||||||
class="bg-white border border-slate-200
|
class="bg-white border border-slate-200
|
||||||
dark:border-zinc-800 dark:bg-zinc-900 break-words
|
dark:border-zinc-800 dark:bg-zinc-900 break-words
|
||||||
p-1 rounded-lg {clazz}"
|
p-1 rounded-xl {clazz}"
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<aside
|
<aside
|
||||||
class="sticky top-20 border bg-white border-slate-200
|
class="sticky top-20 border bg-white border-slate-200
|
||||||
dark:border-zinc-800 dark:bg-zinc-900 break-words flex
|
dark:border-zinc-800 dark:bg-zinc-900 break-words flex
|
||||||
flex-col gap-4 p-6 w-[20rem] rounded-lg h-max max-h-[calc(100vh-6rem)]
|
flex-col gap-4 p-6 w-[20rem] rounded-xl h-max max-h-[calc(100vh-6rem)]
|
||||||
overflow-auto"
|
overflow-auto"
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export let width: number = 48
|
export let width: number = 40
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="spinner" style="width: {width}px; height: {width}px;">
|
<div class="spinner" style="width: {width}px; height: {width}px;">
|
||||||
|
|||||||
@@ -30,6 +30,6 @@
|
|||||||
|
|
||||||
<Navbar />
|
<Navbar />
|
||||||
<ToastContainer />
|
<ToastContainer />
|
||||||
<div class="mx-auto max-w-5xl p-4 h-full">
|
<div class="mx-auto max-w-5xl p-2 md:p-4 h-full">
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
@@ -4,10 +4,11 @@
|
|||||||
import Button from '$lib/components/input/Button.svelte'
|
import Button from '$lib/components/input/Button.svelte'
|
||||||
import StickyCard from '$lib/components/ui/StickyCard.svelte'
|
import StickyCard from '$lib/components/ui/StickyCard.svelte'
|
||||||
import MultiSelect from '$lib/components/input/MultiSelect.svelte'
|
import MultiSelect from '$lib/components/input/MultiSelect.svelte'
|
||||||
import Post from '$lib/components/lemmy/Post.svelte'
|
import Post from '$lib/components/lemmy/post/Post.svelte'
|
||||||
import SiteCard from '$lib/components/lemmy/SiteCard.svelte'
|
import SiteCard from '$lib/components/lemmy/SiteCard.svelte'
|
||||||
import { fly, scale } from 'svelte/transition'
|
import { fly, scale } from 'svelte/transition'
|
||||||
import Spinner from '$lib/components/ui/loader/Spinner.svelte'
|
import Spinner from '$lib/components/ui/loader/Spinner.svelte'
|
||||||
|
import { authData } from '$lib/lemmy.js'
|
||||||
|
|
||||||
export let data
|
export let data
|
||||||
</script>
|
</script>
|
||||||
@@ -18,9 +19,11 @@
|
|||||||
|
|
||||||
<div class="flex flex-row gap-4 w-full">
|
<div class="flex flex-row gap-4 w-full">
|
||||||
<div class="flex flex-col gap-4 max-w-full w-full min-w-0">
|
<div class="flex flex-col gap-4 max-w-full w-full min-w-0">
|
||||||
|
<h1 class="text-3xl font-bold">Frontpage</h1>
|
||||||
<div class="flex flex-col sm:flex-row gap-4 max-w-full w-full">
|
<div class="flex flex-col sm:flex-row gap-4 max-w-full w-full">
|
||||||
<MultiSelect
|
<MultiSelect
|
||||||
options={['Subscribed', 'Local', 'All']}
|
options={['Subscribed', 'Local', 'All']}
|
||||||
|
disabled={[$authData?.token == undefined]}
|
||||||
selected={$page.url.searchParams.get('type') ?? 'Local'}
|
selected={$page.url.searchParams.get('type') ?? 'Local'}
|
||||||
on:select={(e) => {
|
on:select={(e) => {
|
||||||
const url = $page.url
|
const url = $page.url
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import { page } from '$app/stores'
|
import { page } from '$app/stores'
|
||||||
import Link from '$lib/components/input/Link.svelte'
|
import Link from '$lib/components/input/Link.svelte'
|
||||||
import MultiSelect from '$lib/components/input/MultiSelect.svelte'
|
import MultiSelect from '$lib/components/input/MultiSelect.svelte'
|
||||||
import Post from '../../../lib/components/lemmy/Post.svelte'
|
import Post from '../../../lib/components/lemmy/post/Post.svelte'
|
||||||
import { goto } from '$app/navigation'
|
import { goto } from '$app/navigation'
|
||||||
import Card from '$lib/components/ui/StickyCard.svelte'
|
import Card from '$lib/components/ui/StickyCard.svelte'
|
||||||
import CommunityCard from '$lib/components/community/CommunityCard.svelte'
|
import CommunityCard from '$lib/components/community/CommunityCard.svelte'
|
||||||
@@ -43,6 +43,9 @@
|
|||||||
</details>
|
</details>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-4 max-w-full w-full">
|
<div class="flex flex-col gap-4 max-w-full w-full">
|
||||||
|
<h1 class="text-2xl font-bold">
|
||||||
|
{data.community.community_view.community.title}
|
||||||
|
</h1>
|
||||||
<div class="flex flex-col sm:flex-row gap-4 max-w-full w-full">
|
<div class="flex flex-col sm:flex-row gap-4 max-w-full w-full">
|
||||||
<MultiSelect
|
<MultiSelect
|
||||||
options={['Active', 'Hot', 'TopAll', 'New']}
|
options={['Active', 'Hot', 'TopAll', 'New']}
|
||||||
|
|||||||
@@ -1,26 +1,18 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import MultiSelect from '$lib/components/input/MultiSelect.svelte'
|
import { buildCommentsTree } from '$lib/components/lemmy/comment/comments.js'
|
||||||
import type { Comment, CommentView } from 'lemmy-js-client'
|
|
||||||
import {
|
|
||||||
buildCommentsTree,
|
|
||||||
type CommentNodeI,
|
|
||||||
} from '$lib/components/lemmy/comment/comments.js'
|
|
||||||
import Comments from '$lib/components/lemmy/comment/Comments.svelte'
|
import Comments from '$lib/components/lemmy/comment/Comments.svelte'
|
||||||
import CommunityLink from '$lib/components/community/CommunityLink.svelte'
|
import CommunityLink from '$lib/components/community/CommunityLink.svelte'
|
||||||
import { isImage, isVideo } from '$lib/ui/image.js'
|
import { isImage } from '$lib/ui/image.js'
|
||||||
import { authData, getClient, user } from '$lib/lemmy.js'
|
import { authData, getClient, user } from '$lib/lemmy.js'
|
||||||
import CommentForm from '$lib/components/lemmy/comment/CommentForm.svelte'
|
import CommentForm from '$lib/components/lemmy/comment/CommentForm.svelte'
|
||||||
import PostVote from '$lib/components/lemmy/PostVote.svelte'
|
|
||||||
import { onMount } from 'svelte'
|
import { onMount } from 'svelte'
|
||||||
import UserLink from '$lib/components/user/UserLink.svelte'
|
import UserLink from '$lib/components/user/UserLink.svelte'
|
||||||
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
||||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||||
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
||||||
import CommunityCard from '$lib/components/community/CommunityCard.svelte'
|
|
||||||
import Button from '$lib/components/input/Button.svelte'
|
import Button from '$lib/components/input/Button.svelte'
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/stores'
|
||||||
import PostActions from '$lib/components/lemmy/PostActions.svelte'
|
import PostActions from '$lib/components/lemmy/post/PostActions.svelte'
|
||||||
import Loading from '$lib/components/ui/loader/Loading.svelte'
|
|
||||||
import Badge from '$lib/components/ui/Badge.svelte'
|
import Badge from '$lib/components/ui/Badge.svelte'
|
||||||
import { Bookmark, Icon, InformationCircle, Trash } from 'svelte-hero-icons'
|
import { Bookmark, Icon, InformationCircle, Trash } from 'svelte-hero-icons'
|
||||||
import Link from '$lib/components/input/Link.svelte'
|
import Link from '$lib/components/input/Link.svelte'
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import type { CommentView, PostView } from 'lemmy-js-client'
|
import type { CommentView, PostView } from 'lemmy-js-client'
|
||||||
import InboxItem from '../inbox/InboxItem.svelte'
|
import InboxItem from '../inbox/InboxItem.svelte'
|
||||||
import Card from '$lib/components/ui/Card.svelte'
|
import Card from '$lib/components/ui/Card.svelte'
|
||||||
import Post from '$lib/components/lemmy/Post.svelte'
|
import Post from '$lib/components/lemmy/post/Post.svelte'
|
||||||
import CommunityLink from '$lib/components/community/CommunityLink.svelte'
|
import CommunityLink from '$lib/components/community/CommunityLink.svelte'
|
||||||
import Link from '$lib/components/input/Link.svelte'
|
import Link from '$lib/components/input/Link.svelte'
|
||||||
import Comment from '$lib/components/lemmy/comment/Comment.svelte'
|
import Comment from '$lib/components/lemmy/comment/Comment.svelte'
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import CommunityLink from '$lib/components/community/CommunityLink.svelte'
|
import CommunityLink from '$lib/components/community/CommunityLink.svelte'
|
||||||
import Link from '$lib/components/input/Link.svelte'
|
import Link from '$lib/components/input/Link.svelte'
|
||||||
import Post from '$lib/components/lemmy/Post.svelte'
|
import Post from '$lib/components/lemmy/post/Post.svelte'
|
||||||
import Comment from '$lib/components/lemmy/comment/Comment.svelte'
|
import Comment from '$lib/components/lemmy/comment/Comment.svelte'
|
||||||
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
||||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||||
@@ -108,7 +108,7 @@
|
|||||||
{data.user.person_view.person.display_name ??
|
{data.user.person_view.person.display_name ??
|
||||||
data.user.person_view.person.name}
|
data.user.person_view.person.name}
|
||||||
</h1>
|
</h1>
|
||||||
<span class="text-sm opacity-80">
|
<span class="text-sm opacity-80 flex flex-row gap-0">
|
||||||
{#if data.user.person_view.person.display_name}
|
{#if data.user.person_view.person.display_name}
|
||||||
{data.user.person_view.person.name}@
|
{data.user.person_view.person.name}@
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
Reference in new issue
Block a user