feat: Initialize dashboard app with core structure and routing
This commit sets up the foundation for the new dashboard application by implementing the main component structure, routing, and a basic UI shell with KendoReact components. - Set up the main application shell - Implement a routing system with React Router - Build a new App Bar component - Create page placeholders for all routes - Corrected various import and export errors
This commit is contained in:
56
package-lock.json
generated
56
package-lock.json
generated
@@ -28,7 +28,8 @@
|
||||
"@progress/kendo-theme-default": "^12.0.1",
|
||||
"campfire-logs-dashboard": "file:./campfire-logs-dashboard",
|
||||
"react": "^19.1.1",
|
||||
"react-dom": "^19.1.1"
|
||||
"react-dom": "^19.1.1",
|
||||
"react-router-dom": "^7.9.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.33.0",
|
||||
@@ -2371,6 +2372,15 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/cookie": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/cookie/-/cookie-1.0.2.tgz",
|
||||
"integrity": "sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/cross-spawn": {
|
||||
"version": "7.0.6",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
||||
@@ -3784,6 +3794,44 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/react-router": {
|
||||
"version": "7.9.1",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-7.9.1.tgz",
|
||||
"integrity": "sha512-pfAByjcTpX55mqSDGwGnY9vDCpxqBLASg0BMNAuMmpSGESo/TaOUG6BllhAtAkCGx8Rnohik/XtaqiYUJtgW2g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"cookie": "^1.0.1",
|
||||
"set-cookie-parser": "^2.6.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=18",
|
||||
"react-dom": ">=18"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"react-dom": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/react-router-dom": {
|
||||
"version": "7.9.1",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.9.1.tgz",
|
||||
"integrity": "sha512-U9WBQssBE9B1vmRjo9qTM7YRzfZ3lUxESIZnsf4VjR/lXYz9MHjvOxHzr/aUm4efpktbVOrF09rL/y4VHa8RMw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"react-router": "7.9.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=18",
|
||||
"react-dom": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/react-transition-group": {
|
||||
"version": "4.4.5",
|
||||
"resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz",
|
||||
@@ -3888,6 +3936,12 @@
|
||||
"semver": "bin/semver.js"
|
||||
}
|
||||
},
|
||||
"node_modules/set-cookie-parser": {
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.1.tgz",
|
||||
"integrity": "sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/shebang-command": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
|
||||
|
@@ -28,9 +28,10 @@
|
||||
"@progress/kendo-react-progressbars": "^12.0.1",
|
||||
"@progress/kendo-react-tooltip": "^12.0.1",
|
||||
"@progress/kendo-theme-default": "^12.0.1",
|
||||
"campfire-logs-dashboard": "file:./campfire-logs-dashboard",
|
||||
"react": "^19.1.1",
|
||||
"react-dom": "^19.1.1",
|
||||
"campfire-logs-dashboard": "file:./campfire-logs-dashboard"
|
||||
"react-router-dom": "^7.9.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.33.0",
|
||||
|
42
src/App.jsx
42
src/App.jsx
@@ -1,35 +1,15 @@
|
||||
import { useState } from 'react'
|
||||
import reactLogo from './assets/react.svg'
|
||||
import viteLogo from '/vite.svg'
|
||||
import './App.css'
|
||||
import React from 'react';
|
||||
import AppRoutes from './routes/AppRoutes';
|
||||
import CampfireAppBar from './components/AppBar';
|
||||
|
||||
function App() {
|
||||
const [count, setCount] = useState(0)
|
||||
|
||||
return (
|
||||
<>
|
||||
<div>
|
||||
<a href="https://vite.dev" target="_blank">
|
||||
<img src={viteLogo} className="logo" alt="Vite logo" />
|
||||
</a>
|
||||
<a href="https://react.dev" target="_blank">
|
||||
<img src={reactLogo} className="logo react" alt="React logo" />
|
||||
</a>
|
||||
</div>
|
||||
<h1>Vite + React</h1>
|
||||
<div className="card">
|
||||
<button onClick={() => setCount((count) => count + 1)}>
|
||||
count is {count}
|
||||
</button>
|
||||
<p>
|
||||
Edit <code>src/App.jsx</code> and save to test HMR
|
||||
</p>
|
||||
</div>
|
||||
<p className="read-the-docs">
|
||||
Click on the Vite and React logos to learn more
|
||||
</p>
|
||||
</>
|
||||
)
|
||||
}
|
||||
<div>
|
||||
<CampfireAppBar />
|
||||
<AppRoutes />
|
||||
</div>
|
||||
);
|
||||
|
||||
export default App
|
||||
};
|
||||
|
||||
export default App;
|
@@ -0,0 +1,27 @@
|
||||
import React from 'react';
|
||||
import { AppBar, AppBarSection, AppBarSpacer } from '@progress/kendo-react-layout';
|
||||
import { Button } from '@progress/kendo-react-buttons';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
const CampfireAppBar = () => {
|
||||
return (
|
||||
<AppBar position="sticky">
|
||||
<AppBarSection>
|
||||
<Link to="/dashboard">
|
||||
<Button look="flat">Dashboard</Button>
|
||||
</Link>
|
||||
<Link to="/editor">
|
||||
<Button look="flat">New Post</Button>
|
||||
</Link>
|
||||
</AppBarSection>
|
||||
|
||||
<AppBarSpacer style={{width: 32 }} />
|
||||
|
||||
<AppBarSection>
|
||||
<Button look="flat">Logout</Button>
|
||||
</AppBarSection>
|
||||
</AppBar>
|
||||
);
|
||||
};
|
||||
|
||||
export default CampfireAppBar;
|
15
src/main.jsx
15
src/main.jsx
@@ -1,11 +1,14 @@
|
||||
import { StrictMode } from 'react'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import { StrictMode } from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import { BrowserRouter } from 'react-router-dom';
|
||||
import 'campfire-logs-dashboard/dist/css/campfire-logs-dashboard.css';
|
||||
import './index.css'
|
||||
import App from './App.jsx'
|
||||
import './index.css';
|
||||
import App from './App.jsx';
|
||||
|
||||
createRoot(document.getElementById('root')).render(
|
||||
<StrictMode>
|
||||
<App />
|
||||
<BrowserRouter>
|
||||
<App />
|
||||
</BrowserRouter>
|
||||
</StrictMode>,
|
||||
)
|
||||
);
|
||||
|
@@ -0,0 +1,9 @@
|
||||
import React from 'react';
|
||||
|
||||
const Dashboard = () => {
|
||||
return (
|
||||
<h1>This is the Dashboard Page</h1>
|
||||
);
|
||||
};
|
||||
|
||||
export default Dashboard;
|
@@ -0,0 +1,9 @@
|
||||
import React from 'react';
|
||||
|
||||
const EditorPage = () => {
|
||||
return (
|
||||
<h1>This is the Editor Page</h1>
|
||||
);
|
||||
};
|
||||
|
||||
export default EditorPage;
|
@@ -0,0 +1,9 @@
|
||||
import React from 'react';
|
||||
|
||||
const NotFound = () => {
|
||||
return (
|
||||
<h1>404: Page Not Found</h1>
|
||||
);
|
||||
};
|
||||
|
||||
export default NotFound;
|
@@ -0,0 +1,20 @@
|
||||
import React from 'react'
|
||||
import { Routes, Route } from 'react-router-dom';
|
||||
|
||||
import Dashboard from '../pages/Dashboard';
|
||||
import EditorPage from '../pages/EditorPage';
|
||||
import NotFound from '../pages/NotFound';
|
||||
|
||||
const AppRoutes = () => {
|
||||
return (
|
||||
<Routes>
|
||||
<Route path="/" element={<Dashboard />} />
|
||||
<Route path="/dashboard" element={<Dashboard />} />
|
||||
<Route path="/editor" element={<EditorPage />} />
|
||||
<Route path="*" element={<NotFound />} />
|
||||
</Routes>
|
||||
);
|
||||
};
|
||||
|
||||
export default AppRoutes;
|
||||
|
||||
|
Reference in New Issue
Block a user