diff --git a/buildtime/client/logical-editor/package-lock.json b/buildtime/client/logical-editor/package-lock.json index 96c2612a4..4e2d054d4 100644 --- a/buildtime/client/logical-editor/package-lock.json +++ b/buildtime/client/logical-editor/package-lock.json @@ -9,7 +9,8 @@ "version": "0.0.0", "dependencies": { "react": "^19.2.7", - "react-dom": "^19.2.7" + "react-dom": "^19.2.7", + "react-router": "^8.3.0" }, "devDependencies": { "@types/react": "^19.2.17", @@ -768,6 +769,12 @@ } } }, + "node_modules/cookie-es": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/cookie-es/-/cookie-es-3.1.1.tgz", + "integrity": "sha512-UaXxwISYJPTr9hwQxMFYZ7kNhSXboMXP+Z3TRX6f1/NyaGPfuNUZOWP1pUEb75B2HjfklIYLVRfWiFZJyC6Npg==", + "license": "MIT" + }, "node_modules/csstype": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", @@ -1229,6 +1236,27 @@ "react": "^19.2.8" } }, + "node_modules/react-router": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-8.3.0.tgz", + "integrity": "sha512-qyPMvW83jGIct3yiieisxdk9M745anqhpIMKN5m1t6yBMfgVPpt77aHOqs5fUlEJRMCGffg9BaQLH9oPVOL7xQ==", + "license": "MIT", + "dependencies": { + "cookie-es": "^3.1.1" + }, + "engines": { + "node": ">=22.22.0" + }, + "peerDependencies": { + "react": ">=19.2.7", + "react-dom": ">=19.2.7" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + } + } + }, "node_modules/rolldown": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.1.5.tgz", diff --git a/buildtime/client/logical-editor/package.json b/buildtime/client/logical-editor/package.json index 18c08294f..989d3e099 100644 --- a/buildtime/client/logical-editor/package.json +++ b/buildtime/client/logical-editor/package.json @@ -11,7 +11,8 @@ }, "dependencies": { "react": "^19.2.7", - "react-dom": "^19.2.7" + "react-dom": "^19.2.7", + "react-router": "^8.3.0" }, "devDependencies": { "@types/react": "^19.2.17", diff --git a/buildtime/client/logical-editor/src/App-orig.css b/buildtime/client/logical-editor/src/99_Archive/App-orig.css similarity index 100% rename from buildtime/client/logical-editor/src/App-orig.css rename to buildtime/client/logical-editor/src/99_Archive/App-orig.css diff --git a/buildtime/client/logical-editor/src/App-orig.jsx b/buildtime/client/logical-editor/src/99_Archive/App-orig.jsx similarity index 100% rename from buildtime/client/logical-editor/src/App-orig.jsx rename to buildtime/client/logical-editor/src/99_Archive/App-orig.jsx diff --git a/buildtime/client/logical-editor/src/assets/hero.png b/buildtime/client/logical-editor/src/99_Archive/hero.png similarity index 100% rename from buildtime/client/logical-editor/src/assets/hero.png rename to buildtime/client/logical-editor/src/99_Archive/hero.png diff --git a/buildtime/client/logical-editor/src/assets/react.svg b/buildtime/client/logical-editor/src/99_Archive/react.svg similarity index 100% rename from buildtime/client/logical-editor/src/assets/react.svg rename to buildtime/client/logical-editor/src/99_Archive/react.svg diff --git a/buildtime/client/logical-editor/src/assets/vite.svg b/buildtime/client/logical-editor/src/99_Archive/vite.svg similarity index 100% rename from buildtime/client/logical-editor/src/assets/vite.svg rename to buildtime/client/logical-editor/src/99_Archive/vite.svg diff --git a/buildtime/client/logical-editor/src/App.css b/buildtime/client/logical-editor/src/App.css index 367a71a80..8ce2ffa1d 100644 --- a/buildtime/client/logical-editor/src/App.css +++ b/buildtime/client/logical-editor/src/App.css @@ -17,10 +17,20 @@ } } -.nav-links { +.nav-links{ display: flex; align-items: center; margin-left: auto; + padding-right: 16px; + padding-left: 16px; +} + +.nav-links a { + color: gray; + text-decoration: none; + margin-left: 16px; + font-size: 14px; + letter-spacing: -1px; } .logo { @@ -34,11 +44,13 @@ } .sidebar { + display: flex; + flex-flow: column; + height: 70vh; padding: 16px; color: gray; background: var(--code-bg); box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25); - height: 100%; width: 200px; } @@ -66,6 +78,22 @@ .treeElement h2 { font-size: 14px; + color: gray; letter-spacing: -1px; margin: 4px 16px 0 0; +} + +.spacer { + display: flex; + flex-flow: column; + height: 1vh; +} + +footer { + padding: 16px; + color: gray; + display: flex; + background: var(--code-bg); + box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25); + height: 20px; } \ No newline at end of file diff --git a/buildtime/client/logical-editor/src/App.jsx b/buildtime/client/logical-editor/src/App.jsx index 9363b85cb..3edff5383 100644 --- a/buildtime/client/logical-editor/src/App.jsx +++ b/buildtime/client/logical-editor/src/App.jsx @@ -1,18 +1,27 @@ -import { useState } from 'react' -import './App.css' -import NavBar from './components/NavBar.jsx' -import LangSideBar from './components/LangSideBar.jsx' +// Main App -const App = () => { - return ( -
-
-
-
-
-
-
- ) +import { createBrowserRouter, RouterProvider } from 'react-router' +import Layout from './Layout.jsx' +import HomePage from './pages/HomePage.jsx' +import LanguagePage from './pages/LanguagePage.jsx' +import NotFoundPage from './pages/NotFoundPage.jsx' + +import './App.css' + +const router = createBrowserRouter([ + { + path: '/', + element: , + children: [ + { index: true, element: }, + { path: 'language', element: }, + { path: '*', element: }, + ], + }, +]) + +function App() { + return } export default App diff --git a/buildtime/client/logical-editor/src/Layout.jsx b/buildtime/client/logical-editor/src/Layout.jsx new file mode 100644 index 000000000..0ef3735dd --- /dev/null +++ b/buildtime/client/logical-editor/src/Layout.jsx @@ -0,0 +1,19 @@ +// Layouting Main Application + +import { Outlet, Link } from 'react-router' +import NavBar from './components/NavBar.jsx' + + +function Layout() { + return ( +
+ +
+ +
+
My App, 2026
+
+ ) +} + +export default Layout \ No newline at end of file diff --git a/buildtime/client/logical-editor/src/components/LangSideBar.jsx b/buildtime/client/logical-editor/src/components/LangSideBar.jsx index a24a25b0d..c7292de15 100644 --- a/buildtime/client/logical-editor/src/components/LangSideBar.jsx +++ b/buildtime/client/logical-editor/src/components/LangSideBar.jsx @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { useState } from 'react' -import Language from './Language'; +import LanguageElement from './LanguageElement'; const LangSideBar = () => { return ( @@ -9,10 +9,11 @@ const LangSideBar = () => {

Available Languages:

- - - + + +
+
...
); }; diff --git a/buildtime/client/logical-editor/src/components/Language.jsx b/buildtime/client/logical-editor/src/components/LanguageElement.jsx similarity index 85% rename from buildtime/client/logical-editor/src/components/Language.jsx rename to buildtime/client/logical-editor/src/components/LanguageElement.jsx index 546b3ceec..ea2617b44 100644 --- a/buildtime/client/logical-editor/src/components/Language.jsx +++ b/buildtime/client/logical-editor/src/components/LanguageElement.jsx @@ -1,7 +1,7 @@ import { useState } from 'react' import UseFetch from './tools/UseFetch'; -const Language = ({ languageid }) => { +const LanguageElement = ({ languageid }) => { const { data: lang, isLoading, error } = UseFetch(`http://localhost:8088/language/${languageid}`) if (isLoading) return

Loading profile...

@@ -15,4 +15,4 @@ const Language = ({ languageid }) => { ); } -export default Language; +export default LanguageElement; diff --git a/buildtime/client/logical-editor/src/components/NavBar.jsx b/buildtime/client/logical-editor/src/components/NavBar.jsx index 2a0fa754b..eb9e430a1 100644 --- a/buildtime/client/logical-editor/src/components/NavBar.jsx +++ b/buildtime/client/logical-editor/src/components/NavBar.jsx @@ -1,4 +1,5 @@ -import React, { Component } from 'react'; +import React from 'react'; +import { Link } from 'react-router'; import scpqLogo from '../assets/SimplyCPQ_Logo.svg'; const NavBar = () => { @@ -8,9 +9,8 @@ const NavBar = () => {

Logical Editor

v.0.1

- Home - About - Contact + Home + Language
Simply CPQ diff --git a/buildtime/client/logical-editor/src/pages/HomePage.jsx b/buildtime/client/logical-editor/src/pages/HomePage.jsx new file mode 100644 index 000000000..848867a68 --- /dev/null +++ b/buildtime/client/logical-editor/src/pages/HomePage.jsx @@ -0,0 +1,12 @@ +import React from 'react'; + +const HomePage = () => { + return ( +
+

Welcome to the Home Page

+

This is the main landing page of the application.

+
+ ); +}; + +export default HomePage; diff --git a/buildtime/client/logical-editor/src/pages/LanguagePage.jsx b/buildtime/client/logical-editor/src/pages/LanguagePage.jsx new file mode 100644 index 000000000..63880f552 --- /dev/null +++ b/buildtime/client/logical-editor/src/pages/LanguagePage.jsx @@ -0,0 +1,14 @@ +import React from 'react'; +import LangSideBar from '../components/LangSideBar'; + +const LanguagePage = () => { + return ( +
+
+
+
+ ); +}; + +export default LanguagePage; + diff --git a/buildtime/client/logical-editor/src/pages/NotFoundPage.jsx b/buildtime/client/logical-editor/src/pages/NotFoundPage.jsx new file mode 100644 index 000000000..4ba08f87b --- /dev/null +++ b/buildtime/client/logical-editor/src/pages/NotFoundPage.jsx @@ -0,0 +1,13 @@ +import React from 'react'; + +const NotFoundPage = () => { + return ( +
+

404 - Page Not Found

+

The page you are looking for does not exist.

+
+ ); +}; + +export default NotFoundPage; +