|
1 | 1 | import React, { useContext, useMemo, useState } from "react"; |
2 | | -import { href } from "react-router"; |
3 | 2 | import { Link } from "../Link"; |
4 | 3 | import { styled } from "@linaria/react"; |
5 | 4 | import * as api from "../../data/types"; |
6 | 5 | import { SchemaTypeView, MetadataTags } from "./SchemaType"; |
7 | 6 | import { ReferencedBy } from "./ReferencedBy"; |
8 | 7 | import { CrossGameRefs } from "./CrossGameRefs"; |
9 | 8 | import { KindIcon, ICONS_URL } from "../kind-icon/KindIcon"; |
10 | | -import { DeclarationsContext, declarationKey, declarationPath } from "./DeclarationsContext"; |
| 9 | +import { DeclarationsContext, declarationKey, schemaPath } from "./DeclarationsContext"; |
11 | 10 | import { getGameDef } from "../../games-list"; |
12 | 11 | import { searchLink, useFieldParam } from "../../utils/filtering"; |
13 | 12 | import { formatHexOffset } from "../../utils/format"; |
@@ -70,7 +69,7 @@ const FieldOffset = styled(Link)` |
70 | 69 | export const ModuleBadge: React.FC<{ module: string }> = ({ module }) => { |
71 | 70 | const { game } = useContext(DeclarationsContext); |
72 | 71 | return ( |
73 | | - <SectionLink to={href("/:game/:module?/:scope?", { game, module })}> |
| 72 | + <SectionLink to={schemaPath(game, module)}> |
74 | 73 | <svg width="16" height="16" aria-hidden="true"> |
75 | 74 | <use href={`${ICONS_URL}#ki-module`} /> |
76 | 75 | </svg> |
@@ -140,7 +139,7 @@ export const SchemaClassView: React.FC<{ |
140 | 139 | }, [declaration.parents, classesByKey, isSearchResult]); |
141 | 140 |
|
142 | 141 | const bitfieldInfo = useMemo(() => computeBitfieldInfo(declaration.fields), [declaration.fields]); |
143 | | - const declPath = declarationPath(game, declaration.module, declaration.name); |
| 142 | + const declPath = schemaPath(game, declaration.module, declaration.name); |
144 | 143 |
|
145 | 144 | return ( |
146 | 145 | <CommonGroupWrapper> |
@@ -197,7 +196,7 @@ function InheritedSection({ |
197 | 196 | {groups.toReversed().map((group) => ( |
198 | 197 | <SectionLink |
199 | 198 | key={`inherited-${group.parent.module}/${group.parent.name}`} |
200 | | - to={declarationPath(game, group.parent.module, group.parent.name)} |
| 199 | + to={schemaPath(game, group.parent.module, group.parent.name)} |
201 | 200 | title={`class in ${group.parent.module}`} |
202 | 201 | > |
203 | 202 | <KindIcon kind="inherited-class" size="small" /> |
|
0 commit comments