Replace Site Settings card with Featured Studios management UI
cgen-da788874e12444f59ddadd30f016f1a4
This commit is contained in:
parent
e2b7a320eb
commit
89812edb4f
1 changed files with 82 additions and 9 deletions
|
|
@ -175,17 +175,90 @@ export default function Admin() {
|
||||||
<CardHeader>
|
<CardHeader>
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<Settings className="h-5 w-5 text-yellow-400" />
|
<Settings className="h-5 w-5 text-yellow-400" />
|
||||||
<CardTitle className="text-lg">Site Settings</CardTitle>
|
<CardTitle className="text-lg">Featured Studios</CardTitle>
|
||||||
</div>
|
</div>
|
||||||
<CardDescription>Branding, legal, integrations</CardDescription>
|
<CardDescription>Manage studios shown on Game Development page</CardDescription>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent>
|
<CardContent className="space-y-3">
|
||||||
<Button
|
{studios.map((s, i) => (
|
||||||
variant="outline"
|
<div key={i} className="p-3 rounded border border-border/40 space-y-2">
|
||||||
onClick={() => navigate("/get-started")}
|
<div className="grid md:grid-cols-2 gap-2">
|
||||||
>
|
<input
|
||||||
Open Settings
|
className="bg-background/50 border border-border/40 rounded px-2 py-1 text-sm"
|
||||||
</Button>
|
value={s.name}
|
||||||
|
onChange={(e) => {
|
||||||
|
const next = studios.slice();
|
||||||
|
next[i] = { ...next[i], name: e.target.value };
|
||||||
|
setStudios(next);
|
||||||
|
}}
|
||||||
|
placeholder="Studio name"
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
className="bg-background/50 border border-border/40 rounded px-2 py-1 text-sm"
|
||||||
|
value={s.tagline || ""}
|
||||||
|
onChange={(e) => {
|
||||||
|
const next = studios.slice();
|
||||||
|
next[i] = { ...next[i], tagline: e.target.value };
|
||||||
|
setStudios(next);
|
||||||
|
}}
|
||||||
|
placeholder="Tagline"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="grid md:grid-cols-2 gap-2">
|
||||||
|
<input
|
||||||
|
className="bg-background/50 border border-border/40 rounded px-2 py-1 text-sm"
|
||||||
|
value={s.metrics || ""}
|
||||||
|
onChange={(e) => {
|
||||||
|
const next = studios.slice();
|
||||||
|
next[i] = { ...next[i], metrics: e.target.value };
|
||||||
|
setStudios(next);
|
||||||
|
}}
|
||||||
|
placeholder="Metrics (e.g., 1B+ sessions)"
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
className="bg-background/50 border border-border/40 rounded px-2 py-1 text-sm"
|
||||||
|
value={(s.specialties || []).join(", ")}
|
||||||
|
onChange={(e) => {
|
||||||
|
const next = studios.slice();
|
||||||
|
next[i] = { ...next[i], specialties: e.target.value.split(",").map(v => v.trim()).filter(Boolean) };
|
||||||
|
setStudios(next);
|
||||||
|
}}
|
||||||
|
placeholder="Specialties (comma separated)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="flex justify-end gap-2">
|
||||||
|
<Button
|
||||||
|
size="sm"
|
||||||
|
variant="outline"
|
||||||
|
onClick={() => {
|
||||||
|
const next = studios.filter((_, idx) => idx !== i);
|
||||||
|
setStudios(next);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Remove
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
<div className="flex justify-between">
|
||||||
|
<Button
|
||||||
|
size="sm"
|
||||||
|
variant="outline"
|
||||||
|
onClick={() => setStudios([...studios, { name: "New Studio" }])}
|
||||||
|
>
|
||||||
|
Add Studio
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
size="sm"
|
||||||
|
onClick={() => {
|
||||||
|
try {
|
||||||
|
localStorage.setItem("featured_studios", JSON.stringify(studios));
|
||||||
|
} catch {}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Save
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue