Skip to content

Commit

Permalink
[#78] Refactor App component
Browse files Browse the repository at this point in the history
App component is refactored to Router component
react-router-dom bump to version 6
  • Loading branch information
palagdan committed Nov 12, 2024
1 parent 4378baf commit 1fccddb
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 198 deletions.
174 changes: 28 additions & 146 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@
"prepare": "husky"
},
"dependencies": {
"vite-plugin-env-compatible": "^2.0.1",
"@vitejs/plugin-react": "^4.3.1",
"vite": "^5.4.2",
"@fortawesome/fontawesome-svg-core": "^1.2.35",
"@fortawesome/free-solid-svg-icons": "^5.15.3",
"@fortawesome/react-fontawesome": "^0.1.14",
"@frogcat/ttl2jsonld": "^0.0.6",
"@kbss-cvut/s-forms": "^0.7.2-beta-6cfd5af.0",
"@tippyjs/react": "^4.2.5",
"@triply/yasgui": "^4.2.14",
"@vitejs/plugin-react": "^4.3.1",
"bootstrap": "^4.5.3",
"cytoscape": "^3.30.2",
"cytoscape-compound-drag-and-drop": "^1.1.0",
Expand All @@ -43,13 +41,14 @@
"react-bootstrap": "^1.4.3",
"react-cytoscapejs": "^1.2.1",
"react-dom": "^18.2.0",
"react-imported-component": "^6.5.4",
"react-json-pretty": "^2.2.0",
"react-router-dom": "^5.1.2",
"react-router-dom": "^6.27.0",
"react-spring": "^8.0.27",
"react-treebeard": "^3.2.4",
"semantic-ui-react": "^2.1.5",
"superagent": "^6.1.0"
"superagent": "^6.1.0",
"vite": "^5.4.2",
"vite-plugin-env-compatible": "^2.0.1"
},
"devDependencies": {
"autoprefixer": "^9.7.6",
Expand Down
24 changes: 24 additions & 0 deletions src/Router.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from "react";
import { Routes, BrowserRouter, Route } from "react-router-dom";
import Layout from "./components/Layout.jsx";
import Home from "./components/Home.jsx";
import Scripts from "./components/Scripts.jsx";
import Executions from "./components/Executions.jsx";
import NoMatch from "./components/NoMatch.jsx";
import Dagre from "./components/dagre/Dagre.jsx";

const Router = () => {
return (
<BrowserRouter>
<Routes>
<Route path="/" element={<Home />} />
<Route path="scripts" element={<Scripts />} />
<Route path="executions" element={<Executions />} />
<Route path="*" element={<NoMatch />} />
<Route path="script" element={<Dagre />} />
</Routes>
</BrowserRouter>
);
};

export default Router;
38 changes: 0 additions & 38 deletions src/components/App.jsx

This file was deleted.

7 changes: 4 additions & 3 deletions src/components/Layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import React from "react";
import { Container, Icon } from "semantic-ui-react";
import { Navbar } from "react-bootstrap";
import NavbarMenu from "./NavbarMenu";
import { Outlet } from "react-router-dom";

const Layout = ({ children }) => {
return (
<div>
<NavbarMenu />

<Container>{children}</Container>

<Container>
<Outlet />
</Container>
<div className="fixed-bottom">
<Navbar color="dark">
<Container>
Expand Down
Loading

0 comments on commit 1fccddb

Please sign in to comment.