fixed at least as far as possible right now. does render stuff

This commit is contained in:
2025-07-02 17:22:37 +02:00
parent 2331a79884
commit 4bc9ab19d5
5 changed files with 65 additions and 36 deletions

View File

@@ -1,34 +1,31 @@
import './App.css' import './App.css';
import Navbar from "./components/Navbar.tsx"; import Navbar from './components/Navbar';
import {BrowserRouter, Route, Routes} from "react-router-dom"; import { BrowserRouter, Routes, Route } from 'react-router-dom';
function Home() { function Home() {
return null; return <div className="p-4">Home Page</div>;
} }
function Feed() { function Feed() {
return null; return <div className="p-4">Feed Page</div>;
} }
function Record() { function Record() {
return null; return <div className="p-4">Record Page</div>;
} }
function Archive() { function Archive() {
return null; return <div className="p-4">Archive Page</div>;
} }
function Profile() { function Profile() {
return null; return <div className="p-4">Profile Page</div>;
} }
function App() { export default function App() {
return ( return (
<BrowserRouter> <BrowserRouter>
<div> <Navbar />
<Navbar/>
</div>
<Routes> <Routes>
<Route path="/" element={<Home />} /> <Route path="/" element={<Home />} />
<Route path="/feed" element={<Feed />} /> <Route path="/feed" element={<Feed />} />
@@ -37,7 +34,5 @@ function App() {
<Route path="/profile" element={<Profile />} /> <Route path="/profile" element={<Profile />} />
</Routes> </Routes>
</BrowserRouter> </BrowserRouter>
) );
} }
export default App

View File

@@ -1,14 +1,26 @@
import {NavLink} from 'react-router-dom' import { NavLink } from 'react-router-dom';
import '../styles/navbar.css'
export default function Navbar() { export default function Navbar() {
const linkClasses = ({ isActive }: { isActive: boolean }) =>
isActive ? 'text-blue-600 font-semibold' : 'text-gray-600';
return ( return (
<nav className="navbar flex gap-4"> <nav className="flex justify-center gap-8 bg-gray-100 py-4">
<NavLink to={"/"} className="navbar-left flex item-center gap-2">Home</NavLink> <NavLink to="/" className={linkClasses}>
<NavLink to={"/feed"} className="navbar-left">Feed</NavLink> Home
<NavLink to={"/record"} className="navbar-center">Record</NavLink> </NavLink>
<NavLink to={"/archive"} className="navbar-right">Find</NavLink> <NavLink to="/feed" className={linkClasses}>
<NavLink to={"/profile"} className="navbar-right">Profile</NavLink> Feed
</NavLink>
<NavLink to="/record" className={linkClasses}>
Record
</NavLink>
<NavLink to="/archive" className={linkClasses}>
Archive
</NavLink>
<NavLink to="/profile" className={linkClasses}>
Profile
</NavLink>
</nav> </nav>
) );
} }

View File

@@ -1,10 +1,12 @@
import { StrictMode } from 'react' import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client' import { createRoot } from 'react-dom/client';
import './index.css' import './index.css';
import App from './App.tsx' import App from './App';
createRoot(document.getElementById('root')!).render( const container = document.getElementById('root');
<StrictMode> if (!container) throw new Error('Root container missing in index.html');
<App /> createRoot(container).render(
</StrictMode>, <StrictMode>
) <App />
</StrictMode>
);

View File

@@ -0,0 +1,19 @@
/* Example custom styles: */
nav {
display: flex;
justify-content: center;
gap: 2rem;
background-color: #f3f4f6;
padding: 1rem 0;
}
nav a {
color: #4b5563;
text-decoration: none;
font-weight: 500;
}
nav a.active {
color: #2563eb;
font-weight: 600;
}

View File

@@ -21,7 +21,8 @@
"noUnusedParameters": true, "noUnusedParameters": true,
"erasableSyntaxOnly": true, "erasableSyntaxOnly": true,
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true "noUncheckedSideEffectImports": true,
"allowSyntheticDefaultImports": true
}, },
"include": ["src"] "include": ["src"]
} }