Sort seed data routes by game progression instead of alphabetically
Add ROUTE_ORDER maps for Kanto (FRLG), Johto (HGSS), and Hoenn (Emerald) progressions with aliases for related version groups. Add Export Order button to admin game detail page for iterating on route orderings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { useState } from 'react'
|
||||
import { toast } from 'sonner'
|
||||
import { useParams, useNavigate, Link } from 'react-router-dom'
|
||||
import {
|
||||
DndContext,
|
||||
@@ -158,12 +159,24 @@ export function AdminGameDetail() {
|
||||
|
||||
<div className="flex justify-between items-center mb-4">
|
||||
<h3 className="text-lg font-medium">Routes ({routes.length})</h3>
|
||||
<button
|
||||
onClick={() => setShowCreate(true)}
|
||||
className="px-4 py-2 text-sm font-medium rounded-md bg-blue-600 text-white hover:bg-blue-700"
|
||||
>
|
||||
Add Route
|
||||
</button>
|
||||
<div className="flex gap-2">
|
||||
<button
|
||||
onClick={() => {
|
||||
const names = routes.map((r) => r.name)
|
||||
navigator.clipboard.writeText(JSON.stringify(names, null, 2))
|
||||
toast.success('Route order copied to clipboard')
|
||||
}}
|
||||
className="px-4 py-2 text-sm font-medium rounded-md border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-800"
|
||||
>
|
||||
Export Order
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setShowCreate(true)}
|
||||
className="px-4 py-2 text-sm font-medium rounded-md bg-blue-600 text-white hover:bg-blue-700"
|
||||
>
|
||||
Add Route
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{routes.length === 0 ? (
|
||||
|
||||
Reference in New Issue
Block a user