dev-api-ui 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -70,6 +70,12 @@ const GROUP_CONFIG: Record<string, GroupConfig> = {
|
|
|
70
70
|
|
|
71
71
|
type Row = { sym: string; name: string; last: string; delta: string; up: boolean; status: string; cat: string; slug: string };
|
|
72
72
|
|
|
73
|
+
// Route slug derived from the symbol so links always follow the house lowercase-hyphen convention
|
|
74
|
+
// (EUR/USD → eur-usd), matching every vertical's /<group>/<base>-<quote> routes. Used by BOTH the
|
|
75
|
+
// leaf "Popular" cards and the list/search RowTable — the hand-maintained `slug` field shipped
|
|
76
|
+
// un-hyphenated demo values (eurusd) that 404'd (BUG-3). Slash-less symbols (PJM-RT) just lowercase.
|
|
77
|
+
const routeSlug = (sym: string) => sym.toLowerCase().replace('/', '-');
|
|
78
|
+
|
|
73
79
|
const GROUP_ROWS: Record<string, Row[]> = {
|
|
74
80
|
fx: [
|
|
75
81
|
{ sym: 'EUR/USD', name: 'Euro / US Dollar', last: '1.08642', delta: '+0.31%', up: true, status: 'Live', cat: 'Majors', slug: 'eurusd' },
|
|
@@ -145,12 +151,7 @@ function deltaColor(up: boolean): string {
|
|
|
145
151
|
|
|
146
152
|
// The shared table / list layout used in both list and search modes
|
|
147
153
|
function RowTable({ rows, group }: { rows: Row[]; group: string }) {
|
|
148
|
-
|
|
149
|
-
// convention (EUR/USD → eur-usd), matching every vertical's /<group>/<base>-<quote> routes.
|
|
150
|
-
// The hand-maintained `slug` field shipped un-hyphenated demo values (eurusd) that 404'd on the
|
|
151
|
-
// real hyphenated routes (BUG-3); deriving removes that drift class. Symbols without a slash
|
|
152
|
-
// (energy: PJM-RT) pass through lowercased, matching their existing slugs.
|
|
153
|
-
const slugFor = (r: Row) => r.sym.toLowerCase().replace('/', '-');
|
|
154
|
+
const slugFor = (r: Row) => routeSlug(r.sym);
|
|
154
155
|
return (
|
|
155
156
|
<div
|
|
156
157
|
style={{
|
|
@@ -379,7 +380,7 @@ export default function HubPage({ group, description, pairs: pairsOverride, eyeb
|
|
|
379
380
|
{popular.map((p) => (
|
|
380
381
|
<Link
|
|
381
382
|
key={p.sym}
|
|
382
|
-
href={`/${group}/${p.
|
|
383
|
+
href={`/${group}/${routeSlug(p.sym)}`}
|
|
383
384
|
style={{
|
|
384
385
|
display: 'block',
|
|
385
386
|
background: 'var(--surface)',
|