impr: use common components for admin pages
This commit is contained in:
10 files changed
+54
-48
No files matched your search
@@ -64,7 +64,7 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#snippet icon(width: number)}
|
||||
{#snippet pfp(width: number)}
|
||||
<Avatar
|
||||
{width}
|
||||
url={avatar}
|
||||
@@ -79,20 +79,22 @@
|
||||
{/snippet}
|
||||
|
||||
<div class="contents @md:hidden">
|
||||
{@render icon(48)}
|
||||
{@render pfp(48)}
|
||||
</div>
|
||||
|
||||
<div class="hidden @md:contents">
|
||||
{@render icon(72)}
|
||||
{@render pfp(72)}
|
||||
</div>
|
||||
|
||||
<div class="space-y-1">
|
||||
<svelte:element
|
||||
this={url ? 'a' : 'h1'}
|
||||
href={url}
|
||||
class="text-xl @md:text-2xl font-medium tracking-tight {url
|
||||
? 'hover:underline hover:text-primary-900 dark:hover:text-primary-100'
|
||||
: ''}"
|
||||
class={[
|
||||
'text-xl @md:text-2xl font-medium tracking-tight',
|
||||
url &&
|
||||
'hover:underline hover:text-primary-900 dark:hover:text-primary-100',
|
||||
]}
|
||||
>
|
||||
{name}
|
||||
</svelte:element>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { Icon, type IconSource } from 'svelte-hero-icons/dist'
|
||||
import type { ClassValue, HTMLAttributes } from 'svelte/elements'
|
||||
|
||||
type Elevation = keyof typeof elevationClass
|
||||
@@ -53,6 +54,7 @@
|
||||
rounding?: Rounding
|
||||
color?: Color
|
||||
element?: string
|
||||
icon?: IconSource
|
||||
class?: ClassValue
|
||||
children?: import('svelte').Snippet
|
||||
[key: string]: any
|
||||
@@ -64,6 +66,7 @@
|
||||
rounding = 'xl',
|
||||
color = 'uniform',
|
||||
element = 'div',
|
||||
icon,
|
||||
class: clazz = '',
|
||||
children,
|
||||
...rest
|
||||
@@ -82,6 +85,14 @@
|
||||
clazz,
|
||||
]}
|
||||
>
|
||||
{#if icon}
|
||||
<Icon
|
||||
src={icon}
|
||||
size="20"
|
||||
mini
|
||||
class="inline-block rounded-lg clear-both float-left mr-2"
|
||||
/>
|
||||
{/if}
|
||||
{@render children?.()}
|
||||
</svelte:element>
|
||||
|
||||
@@ -159,7 +170,7 @@
|
||||
.material-error {
|
||||
background: linear-gradient(
|
||||
to bottom,
|
||||
--alpha(var(--color-red-300) / 10%),
|
||||
--alpha(var(--color-red-300) / 5%),
|
||||
--alpha(var(--color-red-500) / 15%)
|
||||
);
|
||||
|
||||
@@ -189,7 +200,7 @@
|
||||
.material-warning {
|
||||
background: linear-gradient(
|
||||
to bottom,
|
||||
--alpha(var(--color-yellow-300) / 10%),
|
||||
--alpha(var(--color-yellow-300) / 5%),
|
||||
--alpha(var(--color-yellow-500) / 15%)
|
||||
);
|
||||
|
||||
|
||||
Reference in new issue
Block a user