feat: switch from card to material
This commit is contained in:
1 parent
43b0e87ebf
commit
c53ec52d86
16 files changed
+61
-126
No files matched your search
@@ -1,10 +1,8 @@
|
||||
<script lang="ts">
|
||||
import { profile } from '$lib/auth.js'
|
||||
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
||||
|
||||
import Card from '$lib/components/ui/Card.svelte'
|
||||
import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
|
||||
import { toast } from 'mono-svelte'
|
||||
import { Material, toast } from 'mono-svelte'
|
||||
import { getClient } from '$lib/lemmy.js'
|
||||
import type { RegistrationApplicationView } from 'lemmy-js-client'
|
||||
import { Button } from 'mono-svelte'
|
||||
@@ -50,7 +48,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<Card elevation={0} class="p-4 flex flex-col gap-2">
|
||||
<Material class="flex flex-col gap-2">
|
||||
<div class="flex flex-col gap-1">
|
||||
<SectionTitle>User</SectionTitle>
|
||||
<span class="text-sm">
|
||||
@@ -102,4 +100,4 @@
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
</Material>
|
||||
@@ -1,7 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation'
|
||||
import PostForm from '$lib/components/lemmy/post/PostForm.svelte'
|
||||
import Card from '$lib/components/ui/Card.svelte'
|
||||
import { profile } from '$lib/auth.js'
|
||||
import { onMount } from 'svelte'
|
||||
import { getSessionStorage, setSessionStorage } from '$lib/session.js'
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import { goto } from '$app/navigation'
|
||||
import Comment from '$lib/components/lemmy/comment/Comment.svelte'
|
||||
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
||||
import Card from '$lib/components/ui/Card.svelte'
|
||||
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
||||
import { getClient } from '$lib/lemmy.js'
|
||||
import { profile } from '$lib/auth.js'
|
||||
@@ -13,7 +12,7 @@
|
||||
} from 'lemmy-js-client'
|
||||
import { ChatBubbleOvalLeft, Check, Icon } from 'svelte-hero-icons'
|
||||
import { page } from '$app/stores'
|
||||
import { toast } from 'mono-svelte'
|
||||
import { Material, toast } from 'mono-svelte'
|
||||
import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte'
|
||||
import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
|
||||
import { Button } from 'mono-svelte'
|
||||
@@ -90,7 +89,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<Card elevation={0} class="flex flex-col rounded-md p-5 max-w-full gap-2">
|
||||
<Material padding="lg" class="flex flex-col max-w-full gap-2">
|
||||
{#if !isPrivateMessage(item)}
|
||||
<PostMeta
|
||||
published={new Date(item.post.published)}
|
||||
@@ -192,4 +191,4 @@
|
||||
{/if}
|
||||
{/if}
|
||||
{/if}
|
||||
</Card>
|
||||
</Material>
|
||||
@@ -1,15 +1,13 @@
|
||||
<script lang="ts">
|
||||
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
||||
import Card from '$lib/components/ui/Card.svelte'
|
||||
import { fly } from 'svelte/transition'
|
||||
import Report from './Report.svelte'
|
||||
import MultiSelect from '$lib/components/input/MultiSelect.svelte'
|
||||
import { page } from '$app/stores'
|
||||
import { goto } from '$app/navigation'
|
||||
import { EnvelopeOpen, Icon, Inbox, Newspaper } from 'svelte-hero-icons'
|
||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||
import { searchParam } from '$lib/util.js'
|
||||
import { Button } from 'mono-svelte'
|
||||
import { Button, Material } from 'mono-svelte'
|
||||
|
||||
export let data
|
||||
</script>
|
||||
@@ -33,9 +31,7 @@
|
||||
<div class="flex flex-col gap-4">
|
||||
{#each data.items as item}
|
||||
<div in:fly={{ y: -6, opacity: 0, duration: 500 }}>
|
||||
<Card
|
||||
class="p-4 flex flex-col gap-4 text-sm !bg-slate-100 dark:!bg-zinc-950"
|
||||
>
|
||||
<Material class="flex flex-col gap-4 text-sm">
|
||||
<div class="flex flex-col gap-1.5">
|
||||
<span class="text-xs font-bold dark:text-zinc-400 text-slate-600">
|
||||
Report from
|
||||
@@ -46,7 +42,7 @@
|
||||
</div>
|
||||
|
||||
<Report {item} />
|
||||
</Card>
|
||||
</Material>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
import { page } from '$app/stores'
|
||||
import ObjectAutocomplete from '$lib/components/lemmy/ObjectAutocomplete.svelte'
|
||||
import { profile } from '$lib/auth.js'
|
||||
import MultiSelect from '$lib/components/input/MultiSelect.svelte'
|
||||
import { userSettings } from '$lib/settings.js'
|
||||
import ModlogItemCard from './item/ModlogItemCard.svelte'
|
||||
import ModlogItemTable from './item/ModlogItemTable.svelte'
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte'
|
||||
import ShieldIcon from '$lib/components/lemmy/moderation/ShieldIcon.svelte'
|
||||
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
||||
import Card from '$lib/components/ui/Card.svelte'
|
||||
import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
|
||||
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
||||
import { Material } from 'mono-svelte'
|
||||
import type { ModLog } from '../+page.js'
|
||||
import ModlogAction from '../ModlogAction.svelte'
|
||||
|
||||
export let item: ModLog
|
||||
</script>
|
||||
|
||||
<Card elevation={0} class="p-5 flex flex-col gap-2 text-sm">
|
||||
<Material padding="lg" class="flex flex-col gap-2">
|
||||
<div class="flex flex-row justify-between flex-wrap gap-2">
|
||||
{#if item.community}
|
||||
<CommunityLink community={item.community} avatar showInstance />
|
||||
@@ -58,4 +58,4 @@
|
||||
<SectionTitle class="mt-2">Reason</SectionTitle>
|
||||
<p>{item.reason}</p>
|
||||
{/if}
|
||||
</Card>
|
||||
</Material>
|
||||
@@ -9,10 +9,9 @@
|
||||
import { page } from '$app/stores'
|
||||
import PostActions from '$lib/components/lemmy/post/PostActions.svelte'
|
||||
import { ExclamationTriangle, Icon } from 'svelte-hero-icons'
|
||||
import Card from '$lib/components/ui/Card.svelte'
|
||||
import PostLink from '$lib/components/lemmy/post/PostLink.svelte'
|
||||
import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte'
|
||||
import { Spinner, removeToast, toast } from 'mono-svelte'
|
||||
import { Material, Spinner, removeToast, toast } from 'mono-svelte'
|
||||
import type { CommentSortType } from 'lemmy-js-client'
|
||||
import MultiSelect from '$lib/components/input/MultiSelect.svelte'
|
||||
import { profile } from '$lib/auth.js'
|
||||
@@ -112,7 +111,10 @@
|
||||
|
||||
<div class="flex flex-col gap-2">
|
||||
{#if $page.params.instance.toLowerCase() != $instance.toLowerCase()}
|
||||
<Card cardColor="warning" class="p-4 flex flex-col gap-1">
|
||||
<Material
|
||||
class="p-4 flex flex-col gap-1 border
|
||||
border-yellow-300 dark:bg-yellow-950/30 dark:border-yellow-900 bg-yellow-50"
|
||||
>
|
||||
<Icon
|
||||
src={ExclamationTriangle}
|
||||
width={24}
|
||||
@@ -124,7 +126,7 @@
|
||||
This URL is for a different instance than you're logged into. You
|
||||
probably won't be able to vote or comment.
|
||||
</p>
|
||||
</Card>
|
||||
</Material>
|
||||
{/if}
|
||||
|
||||
<PostMeta
|
||||
@@ -221,7 +223,19 @@
|
||||
</details>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="mt-4 flex flex-col gap-2">
|
||||
{#if data.singleThread}
|
||||
<Material
|
||||
elevation="max"
|
||||
padding="none"
|
||||
color="distinct"
|
||||
class="py-2 px-4 text-sm flex flex-row justify-between items-center
|
||||
flex-wrap gap-4 sticky top-20 w-full box-border z-[100] mt-4"
|
||||
>
|
||||
<p>You're viewing a single thread.</p>
|
||||
<Button on:click={reloadComments}>View full thread</Button>
|
||||
</Material>
|
||||
{/if}
|
||||
<div class="mt-4 flex flex-col gap-2 w-full">
|
||||
<div class="flex flex-row justify-between">
|
||||
<div class="font-bold opacity-80 text-base">
|
||||
Comments <span class="text-lg font-medium ml-2">
|
||||
@@ -235,12 +249,6 @@
|
||||
headless
|
||||
/>
|
||||
</div>
|
||||
{#if data.singleThread}
|
||||
<Card class="py-2 px-4 text-sm flex flex-row items-center flex-wrap gap-4">
|
||||
<p>You're viewing a single thread.</p>
|
||||
<Button on:click={reloadComments}>View full thread</Button>
|
||||
</Card>
|
||||
{/if}
|
||||
{#await data.streamed.comments}
|
||||
<div class="h-16 mx-auto grid place-items-center">
|
||||
<Spinner width={24} />
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
import { profile, profileData, setUserID } from '$lib/auth.js'
|
||||
import FileInput from '$lib/components/input/FileInput.svelte'
|
||||
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
|
||||
import Card from '$lib/components/ui/Card.svelte'
|
||||
import { removeToast, toast } from 'mono-svelte'
|
||||
import { Material, removeToast, toast } from 'mono-svelte'
|
||||
import { getClient, uploadImage } from '$lib/lemmy.js'
|
||||
import type { SaveUserSettings } from 'lemmy-js-client'
|
||||
import { Button, Checkbox, Modal, TextInput } from 'mono-svelte'
|
||||
@@ -187,9 +186,7 @@
|
||||
Save
|
||||
</Button>
|
||||
{:else}
|
||||
<Card cardColor="warning" class="p-5">
|
||||
The API didn't return your user settings.
|
||||
</Card>
|
||||
<Material padding="lg">The API didn't return your user settings.</Material>
|
||||
{/if}
|
||||
<Button
|
||||
on:click={() => deleteAccount(0)}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
<script lang="ts">
|
||||
import type { CommentView, PostView } from 'lemmy-js-client'
|
||||
import Card from '$lib/components/ui/Card.svelte'
|
||||
import Post from '$lib/components/lemmy/post/Post.svelte'
|
||||
import Comment from '$lib/components/lemmy/comment/Comment.svelte'
|
||||
import { fly } from 'svelte/transition'
|
||||
import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte'
|
||||
import { Button } from 'mono-svelte'
|
||||
import { Button, Material } from 'mono-svelte'
|
||||
|
||||
export let data
|
||||
|
||||
@@ -27,7 +26,7 @@
|
||||
{#each data.data as item, index}
|
||||
<div in:fly={{ opacity: 0, y: -4, delay: index * 50 }}>
|
||||
{#if isComment(item)}
|
||||
<Card class="flex flex-col bg-white rounded-md p-5 flex-1">
|
||||
<Material padding="lg" color="distinct" class="flex flex-col flex-1">
|
||||
<div class="flex flex-row items-center">
|
||||
<PostMeta
|
||||
title={item.post.name}
|
||||
@@ -45,7 +44,7 @@
|
||||
<Button class="ml-auto" href="/comment/{item.comment.id}">
|
||||
Jump
|
||||
</Button>
|
||||
</Card>
|
||||
</Material>
|
||||
{:else}
|
||||
<Post post={item} />
|
||||
{/if}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<script lang="ts">
|
||||
import Card from '$lib/components/ui/Card.svelte'
|
||||
import { Material } from 'mono-svelte'
|
||||
</script>
|
||||
|
||||
<Card class="flex flex-col gap-3 p-5 text-sm my-2">
|
||||
<Material padding="lg" class="flex flex-col gap-3 my-2">
|
||||
<h1 class="font-bold"><slot name="title" /></h1>
|
||||
{#if $$slots.description}
|
||||
<p class="text-slate-700 dark:text-zinc-300">
|
||||
@@ -10,4 +10,4 @@
|
||||
</p>
|
||||
{/if}
|
||||
<slot />
|
||||
</Card>
|
||||
</Material>
|
||||
@@ -5,12 +5,11 @@
|
||||
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
||||
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
|
||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||
import Card from '$lib/components/ui/Card.svelte'
|
||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||
import { Spinner, toast } from 'mono-svelte'
|
||||
import { Material, Spinner, toast } from 'mono-svelte'
|
||||
import { getClient } from '$lib/lemmy.js'
|
||||
import type { GetCaptchaResponse } from 'lemmy-js-client'
|
||||
import { Button, TextArea, TextInput } from 'mono-svelte'
|
||||
import { Button, TextInput } from 'mono-svelte'
|
||||
import {
|
||||
ArrowPath,
|
||||
ExclamationCircle,
|
||||
@@ -131,14 +130,11 @@
|
||||
type="password"
|
||||
/>
|
||||
{#if data.site_view.local_site.registration_mode == 'RequireApplication'}
|
||||
<Card
|
||||
class="p-4 dark:text-yellow-200 text-yellow-800"
|
||||
cardColor="warning"
|
||||
>
|
||||
<Material class="dark:text-yellow-200 text-yellow-800 bg-yellow-500/20">
|
||||
<Icon src={ExclamationTriangle} mini size="20" />
|
||||
To join this instance, you need to fill out this application, and wait to
|
||||
be accepted.
|
||||
</Card>
|
||||
</Material>
|
||||
{#if data.site_view.local_site.application_question}
|
||||
<Markdown source={data.site_view.local_site.application_question} />
|
||||
{/if}
|
||||
@@ -164,16 +160,21 @@
|
||||
/>
|
||||
<audio controls src={captchaAudio} />
|
||||
{:else}
|
||||
<Card cardColor="warning" class="p-3 flex gap-2">
|
||||
<Material
|
||||
class="flex gap-2 dark:text-yellow-200 text-yellow-800 bg-yellow-500/20"
|
||||
>
|
||||
<Icon src={QuestionMarkCircle} mini size="24" />
|
||||
No captcha was returned
|
||||
</Card>
|
||||
</Material>
|
||||
{/if}
|
||||
{:catch err}
|
||||
<Card cardColor="error" class="p-3 flex gap-2">
|
||||
<Material
|
||||
padding="sm"
|
||||
class="flex gap-2 dark:text-yellow-200 text-yellow-800 bg-yellow-500/20"
|
||||
>
|
||||
<Icon src={ExclamationCircle} mini size="24" />
|
||||
{err}
|
||||
</Card>
|
||||
</Material>
|
||||
{/await}
|
||||
<Button on:click={() => getCaptcha()} size="square-md">
|
||||
<Icon src={ArrowPath} size="16" mini />
|
||||
|
||||
Reference in new issue
Block a user