Prettier format pending files
This commit is contained in:
parent
89812edb4f
commit
afea50d396
1 changed files with 45 additions and 9 deletions
|
|
@ -27,11 +27,31 @@ export default function Admin() {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const isOwner = Array.isArray(roles) && roles.includes("owner");
|
const isOwner = Array.isArray(roles) && roles.includes("owner");
|
||||||
const [demoProfiles, setDemoProfiles] = useState<any[]>([]);
|
const [demoProfiles, setDemoProfiles] = useState<any[]>([]);
|
||||||
type Studio = { name: string; tagline?: string; metrics?: string; specialties?: string[] };
|
type Studio = {
|
||||||
|
name: string;
|
||||||
|
tagline?: string;
|
||||||
|
metrics?: string;
|
||||||
|
specialties?: string[];
|
||||||
|
};
|
||||||
const [studios, setStudios] = useState<Studio[]>([
|
const [studios, setStudios] = useState<Studio[]>([
|
||||||
{ name: "Lone Star Studio", tagline: "Indie craftsmanship with AAA polish", metrics: "Top-rated indie hits", specialties: ["Unity", "Unreal", "Pixel Art"] },
|
{
|
||||||
{ name: "AeThex | GameForge", tagline: "High-performance cross-platform experiences", metrics: "Billions of player sessions", specialties: ["Roblox", "Backend", "LiveOps"] },
|
name: "Lone Star Studio",
|
||||||
{ name: "Gaming Control", tagline: "Strategy, simulation, and systems-first design", metrics: "Award-winning franchises", specialties: ["Simulation", "AI/ML", "Economy"] },
|
tagline: "Indie craftsmanship with AAA polish",
|
||||||
|
metrics: "Top-rated indie hits",
|
||||||
|
specialties: ["Unity", "Unreal", "Pixel Art"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "AeThex | GameForge",
|
||||||
|
tagline: "High-performance cross-platform experiences",
|
||||||
|
metrics: "Billions of player sessions",
|
||||||
|
specialties: ["Roblox", "Backend", "LiveOps"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Gaming Control",
|
||||||
|
tagline: "Strategy, simulation, and systems-first design",
|
||||||
|
metrics: "Award-winning franchises",
|
||||||
|
specialties: ["Simulation", "AI/ML", "Economy"],
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -177,11 +197,16 @@ export default function Admin() {
|
||||||
<Settings className="h-5 w-5 text-yellow-400" />
|
<Settings className="h-5 w-5 text-yellow-400" />
|
||||||
<CardTitle className="text-lg">Featured Studios</CardTitle>
|
<CardTitle className="text-lg">Featured Studios</CardTitle>
|
||||||
</div>
|
</div>
|
||||||
<CardDescription>Manage studios shown on Game Development page</CardDescription>
|
<CardDescription>
|
||||||
|
Manage studios shown on Game Development page
|
||||||
|
</CardDescription>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent className="space-y-3">
|
<CardContent className="space-y-3">
|
||||||
{studios.map((s, i) => (
|
{studios.map((s, i) => (
|
||||||
<div key={i} className="p-3 rounded border border-border/40 space-y-2">
|
<div
|
||||||
|
key={i}
|
||||||
|
className="p-3 rounded border border-border/40 space-y-2"
|
||||||
|
>
|
||||||
<div className="grid md:grid-cols-2 gap-2">
|
<div className="grid md:grid-cols-2 gap-2">
|
||||||
<input
|
<input
|
||||||
className="bg-background/50 border border-border/40 rounded px-2 py-1 text-sm"
|
className="bg-background/50 border border-border/40 rounded px-2 py-1 text-sm"
|
||||||
|
|
@ -220,7 +245,13 @@ export default function Admin() {
|
||||||
value={(s.specialties || []).join(", ")}
|
value={(s.specialties || []).join(", ")}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
const next = studios.slice();
|
const next = studios.slice();
|
||||||
next[i] = { ...next[i], specialties: e.target.value.split(",").map(v => v.trim()).filter(Boolean) };
|
next[i] = {
|
||||||
|
...next[i],
|
||||||
|
specialties: e.target.value
|
||||||
|
.split(",")
|
||||||
|
.map((v) => v.trim())
|
||||||
|
.filter(Boolean),
|
||||||
|
};
|
||||||
setStudios(next);
|
setStudios(next);
|
||||||
}}
|
}}
|
||||||
placeholder="Specialties (comma separated)"
|
placeholder="Specialties (comma separated)"
|
||||||
|
|
@ -244,7 +275,9 @@ export default function Admin() {
|
||||||
<Button
|
<Button
|
||||||
size="sm"
|
size="sm"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
onClick={() => setStudios([...studios, { name: "New Studio" }])}
|
onClick={() =>
|
||||||
|
setStudios([...studios, { name: "New Studio" }])
|
||||||
|
}
|
||||||
>
|
>
|
||||||
Add Studio
|
Add Studio
|
||||||
</Button>
|
</Button>
|
||||||
|
|
@ -252,7 +285,10 @@ export default function Admin() {
|
||||||
size="sm"
|
size="sm"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
try {
|
try {
|
||||||
localStorage.setItem("featured_studios", JSON.stringify(studios));
|
localStorage.setItem(
|
||||||
|
"featured_studios",
|
||||||
|
JSON.stringify(studios),
|
||||||
|
);
|
||||||
} catch {}
|
} catch {}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue