Skip to content

Commit 30e8b85

Browse files
committed
refactor: rename route path from /databases to /db and update all related references; resolves #51
1 parent 9a2b79a commit 30e8b85

File tree

5 files changed

+933
-797
lines changed

5 files changed

+933
-797
lines changed

src/components/HomePageComponents/Section2.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import ForceGraphModal from "modules/universe/ForceGraphModal";
55
import { NodeObject } from "modules/universe/NeuroJsonGraph";
66
import React from "react";
77
import { useNavigate } from "react-router-dom";
8+
import RoutesEnum from "types/routes.enum";
89

910
interface Section2Props {
1011
registry: any[] | null;
@@ -122,7 +123,7 @@ const Section2: React.FC<Section2Props> = ({
122123
borderColor: Colors.lightGray,
123124
},
124125
}}
125-
onClick={() => navigate("/databases")}
126+
onClick={() => navigate(`${RoutesEnum.DATABASES}`)}
126127
>
127128
View All Databases
128129
</Button>

src/components/NodeInfoPanel.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import React, { useEffect, useRef } from "react";
1818
import { useNavigate } from "react-router-dom";
1919
import { fetchDbInfo } from "redux/neurojson/neurojson.action";
2020
import { RootState } from "redux/store";
21+
import RoutesEnum from "types/routes.enum";
2122

2223
interface NodeInfoPanelProps {
2324
open: boolean;
@@ -280,7 +281,9 @@ const NodeInfoPanel: React.FC<NodeInfoPanelProps> = ({
280281
backgroundColor: Colors.secondaryPurple,
281282
},
282283
}}
283-
onClick={() => navigate(`/databases/${nodeData.id}`)}
284+
onClick={() =>
285+
navigate(`${RoutesEnum.DATABASES}/${nodeData.id}`)
286+
}
284287
>
285288
Browse Database
286289
</Button>

src/pages/DatabasePage.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import React, { useEffect } from "react";
66
import { useNavigate } from "react-router-dom";
77
import { fetchRegistry } from "redux/neurojson/neurojson.action";
88
import { NeurojsonSelector } from "redux/neurojson/neurojson.selector";
9+
import RoutesEnum from "types/routes.enum";
910

1011
const DatabasePage: React.FC = () => {
1112
const navigate = useNavigate();
@@ -87,7 +88,8 @@ const DatabasePage: React.FC = () => {
8788
boxShadow: 3,
8889
},
8990
}}
90-
onClick={() => navigate(`/databases/${db.id}`)}
91+
// onClick={() => navigate(`/databases/${db.id}`)}
92+
onClick={() => navigate(`${RoutesEnum.DATABASES}/${db.id}`)}
9193
>
9294
<Typography variant="h6" component="span">
9395
{db.name || "Unnamed Database"}

0 commit comments

Comments
 (0)