]> git.localhorst.tv Git - alttp.git/commitdiff
fix tech basepath
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Sun, 20 Aug 2023 22:07:46 +0000 (00:07 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Sun, 20 Aug 2023 22:07:46 +0000 (00:07 +0200)
resources/js/components/app/Routes.js
resources/js/components/pages/Technique.js

index 396b2a7e6321715a67f8fec96fb65ceb3622579b..5f2ed26e7d7c97e7655154f3bf817e2bfb5557ee 100644 (file)
@@ -22,7 +22,7 @@ const AppRoutes = ({ doLogout }) => <Routes>
                />
                <Route
                        path="dungeons/:name"
-                       element={<Technique namespace="dungeons" type="dungeon" />}
+                       element={<Technique basepath="dungeons" type="dungeon" />}
                />
                <Route
                        path="events/:name"
@@ -35,7 +35,7 @@ const AppRoutes = ({ doLogout }) => <Routes>
                />
                <Route
                        path="locations/:name"
-                       element={<Technique namespace="locations" type="location" />}
+                       element={<Technique basepath="locations" type="location" />}
                />
                <Route path="map">
                        <Route index element={<Navigate replace to="lw" />} />
@@ -47,7 +47,7 @@ const AppRoutes = ({ doLogout }) => <Routes>
                />
                <Route
                        path="modes/:name"
-                       element={<Technique namespace="modes" type="mode" />}
+                       element={<Technique basepath="modes" type="mode" />}
                />
                <Route
                        path="rulesets"
@@ -55,7 +55,7 @@ const AppRoutes = ({ doLogout }) => <Routes>
                        />
                <Route
                        path="rulesets/:name"
-                       element={<Technique namespace="rulesets" type="ruleset" />}
+                       element={<Technique basepath="rulesets" type="ruleset" />}
                />
                <Route path="schedule" element={<Schedule />} />
                <Route
@@ -64,7 +64,7 @@ const AppRoutes = ({ doLogout }) => <Routes>
                />
                <Route
                        path="tech/:name"
-                       element={<Technique namespace="techniques" type="tech" />}
+                       element={<Technique basepath="tech" type="tech" />}
                />
                <Route path="tournaments/:id" element={<Tournament />} />
                <Route path="users/:id" element={<User />} />
index 32acd284f56fcd5f4250432ed7c4368e4ced245c..30eed5b03a4104634ac5f806f3c7a563693b76cb 100644 (file)
@@ -20,7 +20,7 @@ import { getLanguages, getMatchedLocale, getTranslation } from '../../helpers/Te
 import { useUser } from '../../helpers/UserContext';
 import i18n from '../../i18n';
 
-const Technique = ({ type }) => {
+const Technique = ({ basepath, type }) => {
        const params = useParams();
        const { name } = params;
        const user = useUser();
@@ -91,7 +91,7 @@ const Technique = ({ type }) => {
                        <meta name="description" content={getTranslation(technique, 'short', i18n.language)} />
                </Helmet>
                <CanonicalLinks
-                       base={`/tech/${technique.name}`}
+                       base={`/${basepath}/${technique.name}`}
                        lang={getMatchedLocale(technique, i18n.language)}
                        langs={getLanguages(technique)}
                />
@@ -107,6 +107,7 @@ const Technique = ({ type }) => {
 };
 
 Technique.propTypes = {
+       basepath: PropTypes.string,
        type: PropTypes.string,
 };