admin layout redesign
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
---
|
||||
import Layout from '../layouts/Layout.astro';
|
||||
import PostList from '../components/react/PostList';
|
||||
import EditableText from '../components/react/EditableText';
|
||||
import AssetsButton from '../components/react/AssetsButton';
|
||||
|
||||
const API_URL = process.env.PUBLIC_API_URL || 'http://localhost:3000';
|
||||
|
||||
@@ -48,11 +50,34 @@ const isAdmin = Astro.cookies.get('admin_session')?.value === '1';
|
||||
<Layout title="Home" description={siteConfig.welcome_subtitle}>
|
||||
<div class="space-y-6 md:space-y-8">
|
||||
<section class="text-center py-6 md:py-12">
|
||||
<h1 class="text-3xl md:text-5xl font-extrabold mb-3 md:mb-4 pb-2 md:pb-4 leading-tight bg-clip-text text-transparent bg-gradient-to-r from-mauve via-blue to-teal">
|
||||
{siteConfig.welcome_title}
|
||||
<h1 class="text-3xl md:text-5xl font-extrabold mb-3 md:mb-4 pb-2 md:pb-4 leading-tight">
|
||||
{isAdmin ? (
|
||||
<EditableText
|
||||
client:load
|
||||
initial={siteConfig.welcome_title}
|
||||
fieldKey="welcome_title"
|
||||
isAdmin
|
||||
ariaLabel="welcome title"
|
||||
className="bg-clip-text text-transparent bg-gradient-to-r from-mauve via-blue to-teal"
|
||||
/>
|
||||
) : (
|
||||
<span class="bg-clip-text text-transparent bg-gradient-to-r from-mauve via-blue to-teal">
|
||||
{siteConfig.welcome_title}
|
||||
</span>
|
||||
)}
|
||||
</h1>
|
||||
<p class="text-subtext1 text-base md:text-lg max-w-2xl mx-auto px-4 md:px-0">
|
||||
{siteConfig.welcome_subtitle}
|
||||
{isAdmin ? (
|
||||
<EditableText
|
||||
client:load
|
||||
initial={siteConfig.welcome_subtitle}
|
||||
fieldKey="welcome_subtitle"
|
||||
isAdmin
|
||||
ariaLabel="welcome subtitle"
|
||||
multiline
|
||||
className="inline"
|
||||
/>
|
||||
) : siteConfig.welcome_subtitle}
|
||||
</p>
|
||||
|
||||
{isAdmin && (
|
||||
@@ -64,13 +89,7 @@ const isAdmin = Astro.cookies.get('admin_session')?.value === '1';
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="M12 5v14"/></svg>
|
||||
New Post
|
||||
</a>
|
||||
<a
|
||||
href="/admin/assets"
|
||||
class="inline-flex items-center gap-2 bg-surface0 hover:bg-surface1 text-subtext1 hover:text-text px-3 py-2 rounded-lg border border-surface1 transition-colors text-sm"
|
||||
>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>
|
||||
Assets
|
||||
</a>
|
||||
<AssetsButton client:load />
|
||||
<a
|
||||
href="/admin/settings"
|
||||
class="inline-flex items-center gap-2 bg-surface0 hover:bg-surface1 text-subtext1 hover:text-text px-3 py-2 rounded-lg border border-surface1 transition-colors text-sm"
|
||||
|
||||
Reference in New Issue
Block a user