feat: mobile-optimize admin section
- Layout: sidebar hidden on mobile, replaced with horizontal top nav strip - Tables: overflow-x-auto + hide secondary columns (email/category/dates/ plays/likes) on small screens; show email inline under name on mobile - Forms: grid-cols-2 → grid-cols-1 sm:grid-cols-2 on all admin forms - Markdown editor: Write/Preview tab toggle on mobile, side-by-side on sm+ - Padding: p-3 sm:p-6 on all admin pages for tighter mobile layout Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -82,7 +82,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="p-6">
|
||||
<div class="p-3 sm:p-6">
|
||||
<div class="flex items-center justify-between mb-6">
|
||||
<h1 class="text-2xl font-bold">Users</h1>
|
||||
<span class="text-sm text-muted-foreground">{data.total} total</span>
|
||||
@@ -114,14 +114,14 @@
|
||||
</div>
|
||||
|
||||
<!-- Table -->
|
||||
<div class="rounded-lg border border-border/40 overflow-hidden">
|
||||
<div class="rounded-lg border border-border/40 overflow-x-auto">
|
||||
<table class="w-full text-sm">
|
||||
<thead class="bg-muted/30">
|
||||
<tr>
|
||||
<th class="px-4 py-3 text-left font-medium text-muted-foreground">User</th>
|
||||
<th class="px-4 py-3 text-left font-medium text-muted-foreground">Email</th>
|
||||
<th class="px-4 py-3 text-left font-medium text-muted-foreground hidden sm:table-cell">Email</th>
|
||||
<th class="px-4 py-3 text-left font-medium text-muted-foreground">Role</th>
|
||||
<th class="px-4 py-3 text-left font-medium text-muted-foreground">Joined</th>
|
||||
<th class="px-4 py-3 text-left font-medium text-muted-foreground hidden md:table-cell">Joined</th>
|
||||
<th class="px-4 py-3 text-right font-medium text-muted-foreground">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -134,19 +134,22 @@
|
||||
<img
|
||||
src={getAssetUrl(user.avatar, "mini")}
|
||||
alt=""
|
||||
class="h-8 w-8 rounded-full object-cover"
|
||||
class="h-8 w-8 rounded-full object-cover shrink-0"
|
||||
/>
|
||||
{:else}
|
||||
<div
|
||||
class="h-8 w-8 rounded-full bg-primary/20 flex items-center justify-center text-xs font-semibold text-primary"
|
||||
class="h-8 w-8 rounded-full bg-primary/20 flex items-center justify-center text-xs font-semibold text-primary shrink-0"
|
||||
>
|
||||
{(user.artist_name || user.email)[0].toUpperCase()}
|
||||
</div>
|
||||
{/if}
|
||||
<span class="font-medium">{user.artist_name || user.first_name || "—"}</span>
|
||||
<div class="min-w-0">
|
||||
<span class="font-medium block truncate">{user.artist_name || user.first_name || "—"}</span>
|
||||
<span class="text-xs text-muted-foreground sm:hidden truncate block">{user.email}</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-muted-foreground">{user.email}</td>
|
||||
<td class="px-4 py-3 text-muted-foreground hidden sm:table-cell">{user.email}</td>
|
||||
<td class="px-4 py-3">
|
||||
<Select
|
||||
type="single"
|
||||
@@ -164,7 +167,7 @@
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-muted-foreground">{formatDate(user.date_created)}</td>
|
||||
<td class="px-4 py-3 text-muted-foreground hidden md:table-cell">{formatDate(user.date_created)}</td>
|
||||
<td class="px-4 py-3 text-right">
|
||||
<div class="flex items-center justify-end gap-1">
|
||||
<Button size="sm" variant="ghost" href="/admin/users/{user.id}">
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="p-6 max-w-2xl">
|
||||
<div class="p-3 sm:p-6 max-w-2xl">
|
||||
<div class="flex items-center gap-4 mb-6">
|
||||
<Button variant="ghost" href="/admin/users" size="sm">
|
||||
<span class="icon-[ri--arrow-left-line] h-4 w-4 mr-1"></span>Back
|
||||
@@ -109,7 +109,7 @@
|
||||
|
||||
<div class="space-y-6">
|
||||
<!-- Basic info -->
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
||||
<div class="space-y-1.5">
|
||||
<Label for="firstName">First name</Label>
|
||||
<Input id="firstName" bind:value={firstName} />
|
||||
|
||||
Reference in New Issue
Block a user